diff --git a/.github/workflows/deploy-www.yml b/.github/workflows/deploy-www.yml new file mode 100644 index 0000000..012a885 --- /dev/null +++ b/.github/workflows/deploy-www.yml @@ -0,0 +1,66 @@ +name: Deploy WWW + +on: + push: + tags: + - "www@*" + +concurrency: + group: deploy-www + cancel-in-progress: false + +jobs: + validate: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v5 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: ${{ runner.os }}-bun- + - run: bun install --frozen-lockfile + - name: Validate tag matches package version + working-directory: packages/www + run: | + TAG_VERSION="${GITHUB_REF_NAME#www@}" + PKG_VERSION=$(node -p "require('./package.json').version") + if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then + echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)" + exit 1 + fi + - run: bun run check + working-directory: packages/www + - run: bun run lint + working-directory: packages/www + + deploy: + needs: validate + runs-on: ubuntu-latest + permissions: + contents: read + environment: production + steps: + - uses: actions/checkout@v5 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: ${{ runner.os }}-bun- + - run: bun install --frozen-lockfile + - run: bun run build + working-directory: packages/www + - uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: packages/www + command: pages deploy build --project-name=herald-www diff --git a/packages/www/.gitignore b/packages/www/.gitignore new file mode 100644 index 0000000..3328151 --- /dev/null +++ b/packages/www/.gitignore @@ -0,0 +1,8 @@ +# Output +.output +/.svelte-kit +/build + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/packages/www/.npmrc b/packages/www/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/packages/www/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/packages/www/.vscode/extensions.json b/packages/www/.vscode/extensions.json new file mode 100644 index 0000000..d73597d --- /dev/null +++ b/packages/www/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["svelte.svelte-vscode", "bradlc.vscode-tailwindcss"] +} diff --git a/packages/www/.vscode/settings.json b/packages/www/.vscode/settings.json new file mode 100644 index 0000000..5ac1c06 --- /dev/null +++ b/packages/www/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.css": "tailwindcss" + } +} diff --git a/packages/www/README.md b/packages/www/README.md new file mode 100644 index 0000000..02cd3af --- /dev/null +++ b/packages/www/README.md @@ -0,0 +1,42 @@ +# sv + +Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```sh +# create a new project +npx sv create my-app +``` + +To recreate this project with the same configuration: + +```sh +# recreate this project +bun x sv@0.15.1 create --template minimal --types ts --add tailwindcss="plugins:none" sveltekit-adapter="adapter:static" --no-download-check --install bun packages/www +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```sh +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```sh +npm run build +``` + +You can preview the production build with `npm run preview`. + +> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. diff --git a/packages/www/biome.json b/packages/www/biome.json new file mode 100644 index 0000000..8e314a9 --- /dev/null +++ b/packages/www/biome.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.4.10/schema.json", + "extends": "//", + "css": { + "parser": { + "tailwindDirectives": true + } + } +} diff --git a/packages/www/package.json b/packages/www/package.json new file mode 100644 index 0000000..3164e1c --- /dev/null +++ b/packages/www/package.json @@ -0,0 +1,28 @@ +{ + "name": "@heraldprotocol/www", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "prepare": "svelte-kit sync || echo ''", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "biome check", + "lint-staged": "biome check --write --staged --files-ignore-unknown=true --no-errors-on-unmatched" + }, + "devDependencies": { + "@biomejs/biome": "catalog:", + "@sveltejs/adapter-static": "^3.0.10", + "@sveltejs/kit": "^2.57.0", + "@sveltejs/vite-plugin-svelte": "^7.0.0", + "@tailwindcss/vite": "^4.2.2", + "svelte": "^5.55.2", + "svelte-check": "^4.4.6", + "tailwindcss": "^4.2.2", + "typescript": "catalog:", + "vite": "^8.0.7" + } +} diff --git a/packages/www/src/app.d.ts b/packages/www/src/app.d.ts new file mode 100644 index 0000000..520c421 --- /dev/null +++ b/packages/www/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://svelte.dev/docs/kit/types#app.d.ts +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/packages/www/src/app.html b/packages/www/src/app.html new file mode 100644 index 0000000..4be268b --- /dev/null +++ b/packages/www/src/app.html @@ -0,0 +1,19 @@ + + +
+ + + + + + + + %sveltekit.head% + + ++ Herald Protocol is the infrastructure layer for autonomous agent + economics, operating exclusively on the + 0G Chain. We provide the settlement primitives that allow AI agents to meter, + charge, and pay for digital resources at scale. +
+ ++ We ship an x402 facilitator so any API, MCP server, or agent can accept + onchain payments on 0G, and a cross-chain payment router so agents + holding funds on 0G can pay services on other chains without managing + multiple wallets. +
+ +