diff --git a/.github/workflows/ipfs.yml b/.github/workflows/ipfs.yml deleted file mode 100644 index 803972e..0000000 --- a/.github/workflows/ipfs.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: build and deploy -on: - push: - pull_request: - # schedule: - # - cron: '0 9 * * *' - -env: - ENS_NAME: ${{ vars.ENS_NAME }} - NFT_STORAGE_API_TOKEN: ${{ secrets.NFT_STORAGE_API_TOKEN }} - DWEBSERVICE_API_TOKEN: ${{ secrets.DWEBSERVICE_API_TOKEN }} - DWEBSERVICE_UUID: ${{ secrets.DWEBSERVICE_UUID }} - ETH_NODE_URI_sepolia: ${{ secrets.ETH_NODE_URI_sepolia }} - -jobs: - build_and_deploy: - if: github.ref == 'refs/heads/public' - runs-on: ubuntu-20.04 - strategy: - matrix: - node-version: [20] - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - name: Install dependencies - run: pnpm install - - name: build - run: pnpm build - # - name: deploy web - # id: cid - # run: pnpm run --filter ./web deploy >> "$GITHUB_OUTPUT" - - name: install deployment tool - run: pnpm add -g upload-to-ipfs@0.0.4 - - name: deploy to ipfs - id: cid - run: upload-to-ipfs web/build >> "$GITHUB_OUTPUT" - - name: echo CID - run: 'echo "Here is the URL: https://${{ steps.cid.outputs.CID }}.ipfs.dweb.link"' - - name: echo ENS_NAME - run: 'echo "name: $ENS_NAME"' - - name: IPNS update - if: ${{ ! env.DWEBSERVICE_UUID }} - run: 'curl -X "GET" "https://dwebservices.xyz/api/eth-names-ipns/$ENS_NAME/publish_by_name/${{ steps.cid.outputs.CID }}/" -H "accept: application/json" -H "Authorization: Bearer $DWEBSERVICE_API_TOKEN"' - - name: IPNS update - if: ${{ env.DWEBSERVICE_UUID }} - run: 'curl -X "GET" "https://dwebservices.xyz/api/eth-names-ipns/$DWEBSERVICE_UUID/publish/${{ steps.cid.outputs.CID }}/" -H "accept: application/json" -H "Authorization: Bearer $DWEBSERVICE_API_TOKEN"' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 1f02252..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: push stripped down version to main -on: push -jobs: - update: - if: github.ref == 'refs/heads/public' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: main - - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - # need anvil - # - run: echo "TESTING degit" && npx degit wighawag/jolly-roger#dev __test__ && cd __test__ && npx pnpm i && npx pnpm template-test && cd .. && rm -Rf __test__ - - - run: | - echo "fetching ${{ github.ref_name }}..." - git fetch origin ${{ github.ref_name }}:${{ github.ref_name }} - - # completely copy from public - git reset origin/${{ github.ref_name }} --hard - - - run: node transform.js - - - run: | - git add -A - git commit -m "Transform branch ${{ github.ref_name }} into a generic template" - git push --force diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 7520573..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Ronan Sandford - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/TODO.md b/TODO.md deleted file mode 100644 index c32fad9..0000000 --- a/TODO.md +++ /dev/null @@ -1 +0,0 @@ -- [ ] auto rename app ? diff --git a/publish.sh b/publish.sh deleted file mode 100644 index 38e7ec5..0000000 --- a/publish.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -git checkout public && git merge dev && git push && git checkout dev && git push diff --git a/reset.sh b/reset.sh deleted file mode 100644 index c02a7c7..0000000 --- a/reset.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -git clean -x -d --force \ No newline at end of file diff --git a/transform.js b/transform.js deleted file mode 100644 index 3d20d06..0000000 --- a/transform.js +++ /dev/null @@ -1,215 +0,0 @@ -// @ts-check -import path from 'path'; -import fs from 'fs'; -// import real_fs from 'fs'; -// const fs = { -// writeFileSync(p, c) { -// console.log(`writeFilySync`, p); -// }, -// rmSync(p, options) { -// console.log(`rmSync`, p); -// }, -// cpSync(f, t) { -// console.log(`cpSync`, f, t); -// }, -// existsSync(p) { -// return real_fs.existsSync(p); -// }, -// statSync(p) { -// return real_fs.statSync(p); -// }, -// readFileSync(p, options) { -// return real_fs.readFileSync(p, 'utf-8'); -// }, -// readdirSync(p) { -// return real_fs.readdirSync(p); -// }, -// }; - -/** - * @typedef RemoveAction - * @type {object} - * @property {string[]} files - files to remove - * @property {"remove"} action - remove action - */ - -/** - * @typedef DegitConf - * @type {RemoveAction[]} - */ - -/** @type {DegitConf | undefined} */ -let degit; -try { - degit = JSON.parse(fs.readFileSync('transform.json', 'utf-8')); -} catch {} -if (degit) { - for (const action of degit) { - if (action.action === 'remove') { - const filesToRemove = action.files; - for (const file of filesToRemove) { - try { - fs.rmSync(file, {recursive: true}); - } catch {} - } - } - } -} - -const doubleDashCommentsExtensions = ['.js', '.ts', '.sol']; -const htmlExtensions = ['.svelte', '.html']; -const ignore_folders = [ - '.git', - 'node_modules', - 'contracts/out', - 'contracts/cache', - 'contracts/artifacts', - 'contracts/coverage', - 'contracts/generated', - 'contracts/lib', - 'web/.svelte-kit', - 'web/build', - 'indexer/dist', -]; -/** - * @param {string} filepath - folder - * @param {string | undefined} parent - root to get path relative to - * @param {string[]} results - list of files to start with - */ -function files(filepath, parent = undefined, results = []) { - if (ignore_folders.indexOf(filepath) >= 0) { - return []; - } - - const actual_parent = parent || '.'; - const actual_path = path.join(actual_parent, filepath); - - if (ignore_folders.indexOf(actual_path) >= 0) { - return []; - } - - try { - const stats = fs.statSync(actual_path); - if (stats.isDirectory()) { - if (actual_parent !== '.') { - results.push(actual_path); - } - const list = fs.readdirSync(actual_path); - for (const file of list) { - files(file, actual_path, results); - } - } else { - results.push(actual_path); - } - } catch (err) { - console.error({err, filepath, parent, actual_path, actual_parent, results}); - throw err; - } - return results; -} - -const filesToProcess = files('.'); - -for (const file of filesToProcess) { - const basename = path.basename(file); - if (basename === '.degit') { - continue; - } - // console.log({basename}); - if (basename.startsWith('degit-')) { - let orginal_file = file.replace('degit-', ''); - - let is_directory = false; - let content; - try { - const stats = fs.statSync(file); - is_directory = stats.isDirectory(); - if (is_directory) { - console.log({is_directory: file}); - const degit_file = path.join(file, '.degit'); - if (fs.existsSync(degit_file) && fs.statSync(degit_file).isFile()) { - const relative = fs.readFileSync(degit_file, 'utf-8'); - orginal_file = path.join(file, relative); - console.log(`.degit`, {orginal_file}); - } - } else { - content = fs.readFileSync(file, 'utf-8'); - const lines = content.split('\n'); - const firstLine = lines.shift(); - if (firstLine) { - if ( - firstLine.startsWith('#degit:') || - firstLine.startsWith('//degit:') || - firstLine.startsWith('.*?\n?/gms; - const content = fs.readFileSync(file, 'utf-8'); - fs.writeFileSync(file, content.replace(regex, '')); - } else if (doubleDashCommentsExtensions.indexOf(path.extname(file)) >= 0) { - const regex = /\s?\/\/TEMPLATE_REMOVE.*?\/\/TEMPLATE_REMOVE\n?/gms; - const content = fs.readFileSync(file, 'utf-8'); - fs.writeFileSync(file, content.replace(regex, '')); - } - } -} diff --git a/transform.json b/transform.json deleted file mode 100644 index b103501..0000000 --- a/transform.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "action": "remove", - "files": [ - "transform.js", - "transform.json", - "reset.sh", - "LICENSE", - ".github", - "TODO.md", - "publish.sh", - "web/TODO.md", - "web/src/lib/components/jolly-roger", - "web/static/images/featured" - ] - } -] diff --git a/web/TODO.md b/web/TODO.md deleted file mode 100644 index 8816feb..0000000 --- a/web/TODO.md +++ /dev/null @@ -1,5 +0,0 @@ -- [ ] test edge-case where unlocking popup trigger but the modal disapear after some time -- [ ] ensure we see the "unlock error" case when a user is trying to click unlock after metamask has already a notificaiton icon about it -- [ ] ensure we show the metamask bug on reload -- [ ] Better getting started page (Home page [degit-home/+page.svelte](src/routes/degit-home/+page.svelte)) -- [ ] use finality and blocktime from data/networks.json diff --git a/web/src/app.html b/web/src/app.html index 43ff700..1e752b8 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -10,10 +10,7 @@ "use strict";var noop=function(){},W="undefined"!=typeof window?window:globalThis,oldConsole=W.console,disabledRegexps=[],enabledRegexps=[];function bindCall(e,l,s,a){return l.enabled&&(l.level>=a||logs.level>=a)?s<=a||logs.traceLevel<=a?oldConsole.trace.bind(oldConsole):e.bind(oldConsole):noop}var loggers={},logs=function(e){var l=loggers[e];if(l)return l;var s=logs.level,a=logs.traceLevel;return l=loggers[e]={get assert(){return bindCall(oldConsole.assert,l,a,1)},get error(){return bindCall(oldConsole.error,l,a,1)},get warn(){return bindCall(oldConsole.warn,l,a,2)},get info(){return bindCall(oldConsole.info,l,a,3)},get log(){return bindCall(oldConsole.log,l,a,4)},get debug(){return bindCall(oldConsole.debug,l,a,5)},get trace(){return bindCall(oldConsole.trace,l,a,6)},get dir(){return bindCall(oldConsole.dir,l,a,5)},get table(){return bindCall(oldConsole.table||oldConsole.debug,l,a,5)},get level(){return s},set level(e){s=e},get traceLevel(){return a},set traceLevel(e){a=e},enabled:enabled(e,{disabledRegexps:disabledRegexps,enabledRegexps:enabledRegexps})}},logLevels={error:1,warn:2,info:3,log:4,debug:5,trace:6};function enabled(e,l){var s,a,r=l.disabledRegexps,o=l.enabledRegexps;if("*"===e[e.length-1])return!0;for(s=0,a=r.length;s - - + - -
-
-

- {title} -

-

- -

-
-
diff --git a/web/src/lib/components/jolly-roger/Showcase.svelte b/web/src/lib/components/jolly-roger/Showcase.svelte deleted file mode 100644 index 3413c75..0000000 --- a/web/src/lib/components/jolly-roger/Showcase.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - -
-
- {name} -
-
-
-

- - {name} - -

-
-

- {title} -

-

- {description} -

-

- {#if source} - Check the source code. - {:else}Source code not yet available.{/if} -

-
-
-
-
diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index a654d5e..a606bd8 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -80,52 +80,4 @@
- - - diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 9b90898..829af9a 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -1,9 +1,6 @@
@@ -40,129 +37,32 @@ > -

Production-Ready Template To Build Decentralised Applications

+

Welcome to your !

- -
-

Use it:

- -

- Find out more on - github -

-
- - -
-
-

Showcase

-

- Here are examples of apps built using "{name}" -

-
-
- - - - - -
- -
-

Features

-
-
- - This template include setup for smart contracts, indexer and frontend. All runs locally for the - best-in-class developer experience. - - - The web app is fully PWA compliant, with offline caching, etc... The javascript code necessary to launch the - app is less than 50kB (15kB compressed), including the home page content. Achieves 100% score on a barebone - page without extra themes - - - Hardhat - for contracts, - hardhat-deploy - for contract deployment, the in-browser - ethereum-indexer - for contract's api, - svelte + Svelte Kit - for frontend with HMR (Hot Module Replacement) and production build. - - - On contract changes, contract get to keep their address and code get updated automatically. On frontend - changes, module get replaced using blazing fast - Vite - es module hot reload. - - - Fully IPFS ready with proper url routing. The web app works on both IPFS urls and ENS/DNS urls. PWA works on - IPFS too with scoped service workers. - - The whole app including indexer and, is written in typescript. - - By using Svelte Kit (and so Vite) and ES modules, the frontend benefit from code splitting an dynamic - imports as well as tree shaking. - - - The repo is setup as a vscode workspace with recommended plugins. Execute tests from the editor. Auto - format, etc... - - - Everything is setup, except for the private ENV variable to deploy the contracts. - -
+ + diff --git a/web/src/routes/degit-home/+page.svelte b/web/src/routes/degit-home/+page.svelte deleted file mode 100644 index 829af9a..0000000 --- a/web/src/routes/degit-home/+page.svelte +++ /dev/null @@ -1,68 +0,0 @@ - - -
-
- {name} -

- {name} -

-
-

- Build -

-

and

-

- Deploy -

-

for

-

- Eternity. -

-
-

Welcome to your !

-
-
- Demo -
-
-
-
- - diff --git a/web/src/routes/degit-home/.degit b/web/src/routes/degit-home/.degit deleted file mode 100644 index a96aa0e..0000000 --- a/web/src/routes/degit-home/.degit +++ /dev/null @@ -1 +0,0 @@ -.. \ No newline at end of file diff --git a/web/static/images/featured/bleeps-preview-small.png b/web/static/images/featured/bleeps-preview-small.png deleted file mode 100644 index 1505814..0000000 Binary files a/web/static/images/featured/bleeps-preview-small.png and /dev/null differ diff --git a/web/static/images/featured/bleeps-preview-small.webp b/web/static/images/featured/bleeps-preview-small.webp deleted file mode 100644 index ab3f10d..0000000 Binary files a/web/static/images/featured/bleeps-preview-small.webp and /dev/null differ diff --git a/web/static/images/featured/conquest-preview-small.png b/web/static/images/featured/conquest-preview-small.png deleted file mode 100644 index 24042a6..0000000 Binary files a/web/static/images/featured/conquest-preview-small.png and /dev/null differ diff --git a/web/static/images/featured/conquest-preview-small.webp b/web/static/images/featured/conquest-preview-small.webp deleted file mode 100644 index 1f679cc..0000000 Binary files a/web/static/images/featured/conquest-preview-small.webp and /dev/null differ diff --git a/web/static/images/featured/mandalas-preview-small.png b/web/static/images/featured/mandalas-preview-small.png deleted file mode 100644 index b094ddb..0000000 Binary files a/web/static/images/featured/mandalas-preview-small.png and /dev/null differ diff --git a/web/static/images/featured/mandalas-preview-small.webp b/web/static/images/featured/mandalas-preview-small.webp deleted file mode 100644 index f7c6d63..0000000 Binary files a/web/static/images/featured/mandalas-preview-small.webp and /dev/null differ diff --git a/web/vite.config.ts b/web/vite.config.ts index bb8386c..0e77535 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -3,10 +3,4 @@ import {defineConfig} from 'vite'; export default defineConfig({ plugins: [sveltekit()], - //TEMPLATE_REMOVE - build: { - minify: false, - sourcemap: true, - }, - //TEMPLATE_REMOVE });