Skip to content

Commit

Permalink
Merge branch 'master' into richardgreg/docs/contributing-giude-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf authored Oct 2, 2024
2 parents c11cda6 + 8321098 commit ca5bcc8
Show file tree
Hide file tree
Showing 296 changed files with 11,427 additions and 6,335 deletions.
7 changes: 0 additions & 7 deletions .changeset/brown-forks-fly.md

This file was deleted.

3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"demo-nextjs",
"demo-node-esm",
"demo-typegen",
"@fuel-ts/docs-snippets",
"docs-snippets",
"docs-snippets2",
"template-nextjs",
"create-fuels-counter-guide",
"demo-wallet-sdk-react",
Expand Down
5 changes: 0 additions & 5 deletions .changeset/cool-vans-attend.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/eleven-jeans-matter.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/fair-walls-smile.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/four-students-join.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/lovely-rivers-impress.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/polite-pugs-sing.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/serious-carrots-nail.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/small-readers-hug.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/sweet-wasps-thank.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/three-hairs-approve.md

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ apps/demo-nextjs
apps/demo-react-cra
apps/demo-react-vite
apps/create-fuels-counter-guide
apps/docs-snippets2/src/typegend
apps/docs-snippets2/src/**/*.wrapped.ts

packages/fuels/src/cli/commands/deploy/proxy
packages/fuels/test/fixtures/project
packages/account/src/providers/__generated__
packages/account/src/providers/assets
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
benchmarks:
runs-on: ubuntu-latest
# remove if:false after fine-tuning benchmarks
if: false
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/linear-pr-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Linear Issue To PR Linker

on:
pull_request:
types: [opened, edited]

jobs:
link-pr-to-linear-issues:
name: "Link PR to Linear issues"
runs-on: ubuntu-latest

steps:
- uses: FuelLabs/github-actions/linear/link-pr-to-linear-issue@master
with:
pull_number: ${{ github.event.pull_request.number }}
linear_api_key: ${{ secrets.LINEAR_TOKEN }}
github_token: ${{ secrets.REPO_TOKEN }}
2 changes: 2 additions & 0 deletions .knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"/apps/docs/*",
"/packages/abi-typegen/test/**",
"templates/**",
"/apps/docs-snippets2/**/*.test.ts",
"apps/create-fuels-counter-guide/**"
],
"ignoreDependencies": [
Expand All @@ -19,6 +20,7 @@
"@types/rimraf",
"@graphql-codegen*",
"graphql-tag",
"get-graphql-schema",
"events",
"eslint-plugin-jsdoc",
"eslint-plugin-jsx-a11y",
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ apps/demo-typegen/src/predicate-types
apps/docs/.vitepress/cache/
apps/create-fuels-counter-guide

packages/fuels/src/cli/commands/deploy/proxy
packages/fuels/test/fixtures/project
packages/account/src/providers/assets

Expand Down
3 changes: 2 additions & 1 deletion apps/create-fuels-counter-guide/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_FUEL_NODE_PORT=4000
VITE_DAPP_ENVIRONMENT=local
VITE_DAPP_ENVIRONMENT=local
VITE_GENESIS_WALLET_PRIVATE_KEY=0x01
4 changes: 2 additions & 2 deletions apps/create-fuels-counter-guide/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ src/sway-api/index.ts
sway-programs/**/out
.turbo

playwright-report
test-results
test-results
playwright-report
17 changes: 7 additions & 10 deletions apps/create-fuels-counter-guide/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config({
extends: [js.configs.recommended, ...tseslint.configs.recommended],
Expand All @@ -18,9 +18,6 @@ export default tseslint.config({
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
})
});
4 changes: 2 additions & 2 deletions apps/create-fuels-counter-guide/fuel-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
channel = "testnet"

[components]
forc = "0.63.1"
fuel-core = "0.34.0"
forc = "0.63.5"
fuel-core = "0.35.0"
6 changes: 3 additions & 3 deletions apps/create-fuels-counter-guide/fuels.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #region fuels-config-file-env
import { createConfig } from 'fuels';
import dotenv from 'dotenv';
import { NODE_URL } from './src/lib';
import { providerUrl } from './src/lib';

dotenv.config({
path: ['.env.local', '.env'],
Expand All @@ -14,8 +14,8 @@ export default createConfig({
workspace: './sway-programs', // Path to your Sway workspace
output: './src/sway-api', // Where your generated types will be saved
fuelCorePort,
providerUrl: NODE_URL,
fuelCorePath: 'fuels-core',
providerUrl,
forcPath: 'fuels-forc',
fuelCorePath: 'fuels-core',
});
// #endregion fuels-config-file-env
2 changes: 1 addition & 1 deletion apps/create-fuels-counter-guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/fuel.ico" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fuel dApp</title>
</head>
Expand Down
24 changes: 11 additions & 13 deletions apps/create-fuels-counter-guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,32 @@
"@fuels/connectors": "^0.27.1",
"@fuels/react": "^0.27.1",
"@tanstack/react-query": "^5.55.4",
"@tanstack/react-router": "^1.56.5",
"fuels": "workspace:*",
"@wagmi/connectors": "^5.1.10",
"@wagmi/core": "^2.13.5",
"clsx": "2.1.1",
"@wagmi/connectors": "^5.1.12",
"@wagmi/core": "^2.13.6",
"dotenv": "^16.4.5",
"fuels": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"react-use": "^17.5.1"
"react-toastify": "^10.0.5"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.1",
"@eslint/js": "^9.10.0",
"@tanstack/router-plugin": "^1.56.4",
"@types/node": "^22.5.5",
"@playwright/test": "^1.47.1",
"@types/react": "^18.3.6",
"@playwright/test": "^1.47.2",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.3",
"@vitejs/plugin-react-swc": "^3.7.0",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.11",
"tailwindcss": "^3.4.12",
"typescript": "~5.6.2",
"typescript-eslint": "^8.5.0",
"vite": "^5.4.5",
"vitest": "^2.0.5"
"vite": "^5.4.7",
"vitest": "~2.0.5"
}
}
4 changes: 2 additions & 2 deletions apps/create-fuels-counter-guide/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export default defineConfig({
command: 'pnpm run fuels:dev',
port: 4000,
reuseExistingServer: !process.env.CI,
}
]
},
],
});
2 changes: 1 addition & 1 deletion apps/create-fuels-counter-guide/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
}
};
1 change: 0 additions & 1 deletion apps/create-fuels-counter-guide/public/copy.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions apps/create-fuels-counter-guide/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { useConnectUI, useIsConnected, useNetwork } from "@fuels/react";
import { useEffect } from "react";

import { useRouter } from "./hooks/useRouter";
import Button from "./components/Button";
import Info from "./components/Info";
import Wallet from "./components/Wallet";
import Contract from "./components/Contract";
import Predicate from "./components/Predicate";
import Script from "./components/Script";
import Faucet from "./components/Faucet";
import { providerUrl } from './lib'

function App() {
const { connect } = useConnectUI();
const { isConnected, refetch } = useIsConnected();
const { network } = useNetwork();
const { view, views, setRoute } = useRouter();
const isConnectedToCorrectNetwork = network?.url === providerUrl;


useEffect(() => {
refetch();
}, [refetch]);

return (
<main
data-theme="dark"
className="flex items-center justify-center lg:pt-6 text-zinc-50/90"
>
<div id="container" className="mx-8 mb-32 w-full max-w-6xl">
<nav id="nav" className="flex items-center justify-center py-1 md:py-6">
<a href="https://fuel.network/" target="_blank" rel="noreferrer">
<img src="./logo_white.png" alt="Fuel Logo" className="w-[124px]" />
</a>
</nav>

<div className="gradient-border rounded-2xl">
<div className="grain rounded-2xl p-1.5 drop-shadow-xl">
<div
id="grid"
className="lg:grid lg:grid-cols-7 lg:grid-rows-1 lg:gap-12"
>
<Info />
<div className="col-span-5">
<div className="gradient-border h-full rounded-xl bg-gradient-to-b from-zinc-900 to-zinc-950/80">
{!isConnected && (
<section className="flex h-full flex-col justify-center space-y-6 px-4 py-8 lg:px-[25%]">
<Button onClick={() => connect()}>Connect Wallet</Button>
</section>
)}

{isConnected && !isConnectedToCorrectNetwork && (
<section className="flex h-full flex-col justify-center space-y-6 px-4 py-8">
<p className="text-center">
You are connected to the wrong network. Please switch to{" "}
<a
href={providerUrl}
target="_blank"
rel="noreferrer"
className="text-green-500/80 transition-colors hover:text-green-500"
>
{providerUrl}
</a>
&nbsp;in your wallet.
</p>
</section>
)}

{isConnected && isConnectedToCorrectNetwork && (
<section className="flex h-full flex-col justify-center space-y-6 px-4 py-8">
<div className="flex flex-col sm:flex-row gap-3">
{views.map((viewName) => (
<Button
key={viewName}
className="w-full sm:flex-1 capitalize"
color={view === viewName ? "primary" : "inactive"}
onClick={() => setRoute(viewName)}
>
{viewName}
</Button>
))}
</div>

{view === "wallet" && <Wallet />}
{view === "contract" && <Contract />}
{view === "predicate" && <Predicate />}
{view === "script" && <Script />}
{view === "faucet" && <Faucet />}
</section>
)}
</div>
</div>
</div>
</div>
</div>
</div>
</main>
);
}

export default App;
Loading

0 comments on commit ca5bcc8

Please sign in to comment.