Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: beta-5 #150

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 25 additions & 19 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
.changeset
.eslintrc.js
.lintstagedrc.js
node_modules
**/node_modules/**
**/**/.*
**/build/**
**/coverage/
dist
**/dist/**
build
**/build/**
CHANGELOG.md
*.typegen.ts
*.html
.next/*
generated
**/fuel-v2-contracts
**/generated/**
storybook
**/node_modules/**
**/public/storybook/**
**/public/ui/**
**/storybook-static
**/storybook-static/**
**/storybook/**
*.html
*.typegen.ts
.changeset
.eslintrc.js
.lintstagedrc.js
.next/*
.turbo
CHANGELOG.md
build
dist
generated
generated
node_modules
packages/app-portal/public/**
packages/app-portal/src/types
pnpm-lock.yaml
**/**/.*
.*/
packages/app/public/**
contracts/predicate/vitest.config.ts
./tailwind.config.ts
scripts/bridge/fuel-bridge
**/**/tsconfig.json
**.js
12 changes: 2 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
const { resolve } = require('path');
const { dependencies } = require('./packages/app/package.json');

const project = [
resolve(__dirname, './tsconfig.json'),
resolve(__dirname, './packages/**/tsconfig.json'),
resolve(__dirname, './contracts/**/tsconfig.json'),
];
const { dependencies } = require('./packages/app-explorer/package.json');

module.exports = {
root: true,
Expand All @@ -16,7 +9,6 @@ module.exports = {
],
parserOptions: {
tsconfigRootDir: __dirname,
project,
},
settings: {
react: {
Expand All @@ -29,7 +21,6 @@ module.exports = {
},
[require.resolve('eslint-import-resolver-typescript')]: {
alwaysTryTypes: true,
project,
},
},
},
Expand All @@ -40,6 +31,7 @@ module.exports = {
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
],
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/namespace': 'off',
'import/order': [
'error',
{
Expand Down
11 changes: 1 addition & 10 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import { getTsconfig } from 'get-tsconfig';
import { relative } from 'node:path';

export default {
'**/*.(js|jsx|ts|jsx|md|mdx|json|html|css)': ['prettier --write'],
'**/*.ts?(x)': (files) => {
const commands = files.flatMap((file) => {
const tsConfig = relative(process.cwd(), getTsconfig(file).path);
return [`tsc -p ${tsConfig} --noEmit`, `eslint .`];
});
return Array.from(new Set(commands));
},
'**/*.ts?(x)': ['eslint'],
};
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node-version=18.19.0
node-version=20.11.0

# Not always possible to be strict, but if it works for you, keep it to true.
# https://pnpm.io/next/npmrc#strict-peer-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.0
20.11.0
38 changes: 19 additions & 19 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.changeset
**/node_modules/
**/**/.*
**/build/**
**/coverage/
dist
**/dist/**
build
**/build/**
CHANGELOG.md
*.typegen.ts
*.html
.next/*
generated
**/fuel-v2-contracts
**/generated/**
storybook
**/storybook/**
storybook-static
**/storybook-static/**
**/public/ui/**
**/node_modules/**
**/public/storybook/**
**/public/ui/**
**/storybook-static
**/storybook-static/**
**/storybook/**
*.typegen.ts
.next/*
.turbo
pnpm-lock.yaml
.next
graphql.schema.json
CHANGELOG.md
build
dist
generated
helm
packages/graphql/src/schemas/*.graphql
node_modules
packages/app-portal/public/**
packages/app-portal/src/types
pnpm-lock.yaml
scripts/bridge/fuel-bridge
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fuelPrettierConfig = require('@fuels/prettier-config');

/** @type {import("prettier").Config} */
module.exports = {
...fuelPrettierConfig,
// trailingComma always adds comma on the end of functions params, that can cause
// issues, when a second param can't be undefined.
trailingComma: 'es5',
overrides: [
{
files: '*.json',
options: {
trailingComma: 'none',
},
},
],
};
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"rust-analyzer.linkedProjects": ["./packages/indexer/Cargo.toml"],
"editor.quickSuggestions": {
"strings": "on"
},
Expand Down
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,40 @@

## 📗 Table of contents

- [Getting Started](./docs/GETTING_STARTED.md)
- [Requirements](./docs/GETTING_STARTED.md#requirements)
- [Running Project Locally](./docs/GETTING_STARTED.md#running-project-locally)
- [📚 - Getting the Repository](./docs/GETTING_STARTED.md#---getting-the-repository)
- [📦 - Install Dependencies](./docs/GETTING_STARTED.md#---install-dependencies)
- [📒 - Run Local Node](./docs/GETTING_STARTED.md#---run-local-node)
- [💻 - Run Web App](./docs/GETTING_STARTED.md#---run-web-app)
- [📗 Project Overview](./docs/GETTING_STARTED.md#-project-overview)
- [🧰 Useful Scripts](./docs/GETTING_STARTED.md#-useful-scripts)
- [Running Tests](./docs/GETTING_STARTED.md#run-tests)
- [Run Tests in Development Mode](./docs/GETTING_STARTED.md#run-tests)
- [Contribution Guide](./docs/CONTRIBUTING.md)
- [Finding Something to Work On](./docs/CONTRIBUTING.md#finding-something-to-work-on)
- [Contribution Flow](./docs/CONTRIBUTING.md#contribution-flow)
### Explorer

- [Getting Started](./docs/explorer/GETTING_STARTED.md)
- [Requirements](./docs/explorer/GETTING_STARTED.md#requirements)
- [Running Project Locally](./docs/explorer/GETTING_STARTED.md#running-project-locally)
- [📚 - Getting the Repository](./docs/explorer/GETTING_STARTED.md#---getting-the-repository)
- [📦 - Install Dependencies](./docs/explorer/GETTING_STARTED.md#---install-dependencies)
- [📒 - Run Local Node](./docs/explorer/GETTING_STARTED.md#---run-local-node)
- [💻 - Run Web App](./docs/explorer/GETTING_STARTED.md#---run-web-app)
- [📗 Project Overview](./docs/explorer/GETTING_STARTED.md#-project-overview)
- [🧰 Useful Scripts](./docs/explorer/GETTING_STARTED.md#-useful-scripts)
- [Running Tests](./docs/explorer/GETTING_STARTED.md#run-tests)
- [Run Tests in Development Mode](./docs/explorer/GETTING_STARTED.md#run-tests)
- [Contribution Guide](./docs/explorer/CONTRIBUTING.md)
- [Finding Something to Work On](./docs/explorer/CONTRIBUTING.md#finding-something-to-work-on)
- [Contribution Flow](./docs/explorer/CONTRIBUTING.md#contribution-flow)
- [License](#license)

### Portal

- [Getting Started](./docs/portal/GETTING_STARTED.md)
- [Requirements](./docs/portal/GETTING_STARTED.md#requirements)
- [Running Project Locally](./docs/portal/GETTING_STARTED.md#running-project-locally)
- [📚 - Getting the Repository](./docs/portal/GETTING_STARTED.md#---getting-the-repository)
- [📦 - Install Dependencies](./docs/portal/GETTING_STARTED.md#---install-dependencies)
- [📒 - Run Local Node](./docs/portal/GETTING_STARTED.md#---run-local-node)
- [💻 - Run Web App](./docs/portal/GETTING_STARTED.md#---run-web-app)
- [📗 Project Overview](./docs/portal/GETTING_STARTED.md#-project-overview)
- [🧰 Useful Scripts](./docs/portal/GETTING_STARTED.md#-useful-scripts)
- [Running Tests](./docs/portal/GETTING_STARTED.md#run-tests)
- [Run Tests in Development Mode](./docs/portal/GETTING_STARTED.md#run-tests)
- [Contribution Guide](./docs/portal/CONTRIBUTING.md)
- [Finding Something to Work On](./docs/portal/CONTRIBUTING.md#finding-something-to-work-on)
- [Contribution Flow](./docs/portal/CONTRIBUTING.md#contribution-flow)
- [License](#license)

## License
Expand Down
6 changes: 3 additions & 3 deletions contracts/predicate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"author": "",
"license": "ISC",
"devDependencies": {
"dotenv": "16.3.1",
"fuels": "0.71.0",
"vitest": "1.1.3",
"dotenv": "16.4.1",
"fuels": "0.71.1",
"vitest": "1.2.1",
"tsx": "4.7.0"
}
}
2 changes: 1 addition & 1 deletion contracts/predicate/scripts/run-predicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function main() {
BaseAssetId,
{
gasPrice,
},
}
);
const res2 = await tx2.waitForResult();
console.log(`→ Transaction Id: ${res2.id}`);
Expand Down
6 changes: 3 additions & 3 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ ENV PATH="$PNPM_HOME:$PATH"
# Enable pnpm using corepack form node.js
RUN corepack enable

COPY . /app
WORKDIR /app
COPY . /app-explorer
WORKDIR /app-explorer

RUN pnpm install --frozen-lockfile

EXPOSE 4444

WORKDIR /app/packages/graphql
WORKDIR /app-explorer/packages/graphql

CMD ["pnpm", "start"]
2 changes: 0 additions & 2 deletions docker/.env

This file was deleted.

18 changes: 8 additions & 10 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
start:
# sh ./scripts/start.sh
# docker compose up
echo "Docker env is temporary disabled on this project";
echo "Run pnpm dev for development";
build:
docker compose --env-file ./envs/ports.env build

down:
docker compose down
start:
docker compose --env-file ./envs/ports.env up -d --build

restart:
docker compose restart
stop:
docker compose stop

clean:
docker compose down --rmi local -v --remove-orphans
docker compose down --rmi local -v

logs:
docker compose logs -f

61 changes: 61 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Fuel Development Environment

This project runs a local Fuel development environment with both an L1 node and a Fuel node.

## Requirements

- docker
- docker-compose
- make

_Note_: Docker Desktop only allocates 2GB of memory by default, which isn't enough to run the docker-compose services reliably.

To allocate more memory, go to Settings > Resources in the Docker UI and use the slider to change the value (_8GB recommended_). Make sure to click Apply & Restart for the changes to take effect.

## Commands

### Starting containers

To start all containers and build it, use;

```
make up
```

### Stop containers

To stop to containers, use;

```
make stop
```

### Clean containers

To remove all images and containers, use;

```
make clean
```

### View logs

To open the logs from the env, use;

```
make logs
```

## Config options

A set of environment variables can be set before running.

You can change these configs on the env files;

- [Fuel Core env](./envs/fuel_core.env) Fuel Core configurations.
- [L1 env](./envs/l1_chain.env) L1 configurations.
- [PORTS](./envs/ports.env): Exposed ports on host machine.

## License

This repo is licensed under the `Apache-2.0` license. See [`LICENSE`](./LICENSE) for more information.
Loading
Loading