Skip to content

Commit

Permalink
Merge branch 'ls/feat/add-helm-charts' of github.com:FuelLabs/fuel-ex…
Browse files Browse the repository at this point in the history
…plorer into ls/feat/add-helm-charts
  • Loading branch information
luizstacio committed Sep 25, 2023
2 parents 0a0cce5 + ab568d4 commit 62b9acc
Show file tree
Hide file tree
Showing 41 changed files with 3,998 additions and 3,694 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
.vercel
.turbo
dist
20 changes: 16 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
**/node_modules/
**/coverage/
*.js
.changeset
.eslintrc.js
.lintstagedrc.js
node_modules
**/node_modules/**
**/coverage/
dist
**/dist/**
build
**/build/**
CHANGELOG.md
*.typegen.ts
*.html
.next
.next/*
generated
**/generated/**
storybook
**/storybook/**
.turbo
pnpm-lock.yaml

7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const { resolve } = require('path');
const { dependencies } = require('./packages/app/package.json');

const project = [
resolve(__dirname, 'tsconfig.json'),
resolve(__dirname, 'packages/**/tsconfig.json'),
];

module.exports = {
root: true,
extends: [
'plugin:@fuels/typescript',
'plugin:@fuels/jest',
'plugin:@fuels/react',
],
parserOptions: {
project,
},
settings: {
react: {
version: dependencies.react,
},
'import/resolver': {
// TODO: add this extensions in the npm-packs
[require.resolve('eslint-import-resolver-node')]: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs'],
},
[require.resolve('eslint-import-resolver-typescript')]: {
alwaysTryTypes: true,
project,
},
},
},
rules: {
// TODO: this was added just for this pr, its already removed
// inside the updated branchs
'@typescript-eslint/no-explicit-any': 'off',
// TODO: add this rules in the npm-packs
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
],
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'no-html-link-for-pages': 'off',
'react-hooks/rules-of-hooks': 'off',
'react/jsx-sort-props': [
'warn',
{
callbacksLast: true,
shorthandFirst: true,
noSortAlphabetically: true,
reservedFirst: true,
multiline: 'last',
reservedFirst: true,
},
],
},
};
35 changes: 35 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy preview

on:
pull_request:
branches: [main]
types: [labeled, unlabeled, synchronize, closed, reopened]

jobs:
deploy:
permissions:
contents: read
deployments: write
pull-requests: write
statuses: write
name: deploy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3

- name: Add pullpreview label
if: ${{ github.event.action == 'opened' || github.event.action == 'synchronize' }}
uses: KeisukeYamashita/attach-labels@v1
with:
labels: pullpreview
token: ${{ secrets.GITHUB_TOKEN }}

- uses: pullpreview/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
compose_files: .preview/docker-compose.yml
env:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: "us-east-1"
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "PR Checks"

on:
pull_request:
types: [opened, synchronize, edited, closed]
types: [opened, synchronize, edited]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
target
out
packages/docs/.vscode
storybook

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.mjs → .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
'**/*.(md|mdx|json|yml|yaml|html|css)': ['prettier --write'],
'*.{js,jsx,ts,tsx}': ['prettier --write', 'eslint --fix'],
'.{ts,tsx}': ['tsc --noEmit'],
Expand Down
18 changes: 6 additions & 12 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ strict-peer-dependencies=false
# https://pnpm.io/npmrc#auto-install-peers
auto-install-peers=false

# Helps locating duplicates, default in v8
# https://pnpm.io/next/npmrc#use-lockfile-v6
use-lockfile-v6=true

# Will fix duplicates due to peer-dependencies (>=7.29.0), default in v8
# https://github.com/pnpm/pnpm/releases/tag/v7.29.0
dedupe-peer-dependents=true

# Helps with peer-deps (>=7.23.0), default in v8
# https://pnpm.io/npmrc#resolve-peers-from-workspace-root
resolve-peers-from-workspace-root=true

# Default in 8.1.0 to fix issues with root/workspaces hoisting
# https://pnpm.io/npmrc#dedupe-direct-deps
dedupe-direct-deps=false
Expand All @@ -36,3 +24,9 @@ save-prefix=''
# https://pnpm.io/npmrc#save-workspace-protocol
save-workspace-protocol=rolling

public-hoist-pattern[]=*tailwind-variants*
public-hoist-pattern[]=*framer-motion*
public-hoist-pattern[]=*@react-aria/interactions*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=@types*
23 changes: 16 additions & 7 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
**/*.template
.changeset
.coverage_*
.github
CHANGELOG.md
coverage
**/node_modules/
**/coverage/
dist
node_modules
pnpm-lock.yaml
**/dist/**
build
**/build/**
CHANGELOG.md
*.typegen.ts
*.html
.next/*
generated
**/generated/**
storybook
**/storybook/**
storybook-static
**/storybook-static/**
.turbo
pnpm-lock.yaml
.next
graphql.schema.json
deployment
27 changes: 27 additions & 0 deletions .preview/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:20-slim AS base

# Receive envs on build time
ARG IS_PREVIEW
ARG GRAPHQL_API
ARG FUEL_PROVIDER_URL

# Expose the args to the env of the container
ENV IS_PREVIEW="${IS_PREVIEW}"
ENV GRAPHQL_API="${GRAPHQL_API}"
ENV FUEL_PROVIDER_URL="${FUEL_PROVIDER_URL}"

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable

COPY . /preview

WORKDIR /preview

RUN pnpm install --frozen-lockfile
RUN pnpm build:preview

EXPOSE 3000

CMD ["pnpm", "start"]
16 changes: 16 additions & 0 deletions .preview/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.9'

services:
fuel-explorer:
platform: linux/amd64
container_name: fuel-explorer
build:
context: ../
dockerfile: ./.preview/Dockerfile
args:
IS_PREVIEW: true
GRAPHQL_API: http://localhost:4444/graphql
FUEL_PROVIDER_URL: http://beta-4.fuel.network/graphql
ports:
- '80:3000'
- '4000:4444'
49 changes: 33 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"engines": {
"node": ">=18",
"pnpm": ">=8"
"pnpm": ">=8.1.0"
},
"homepage": "https://github.com/FuelLabs/fuel-explorer",
"repository": {
Expand All @@ -20,18 +20,21 @@
"./packages/*"
],
"scripts": {
"build": "pnpm turbo:run build --filter=!custom-theme",
"build": "pnpm build:libs && pnpm turbo:run build --filter=!custom-theme",
"build:preview": "pnpm turbo:run build:preview --filter=app",
"build:storybook": "pnpm turbo:run build:storybook --filter=!custom-theme",
"build:libs": "pnpm turbo:run build --filter=!app",
"clean:indexer": "pnpm --filter=indexer clean",
"deploy:indexer": "pnpm --filter=indexer run deploy",
"deps:update": "updates -gu && pnpm -r exec updates -gu",
"dev": "pnpm turbo:run dev --filter=!indexer",
"dev": "pnpm turbo:run --filter=!indexer dev",
"dev:app": "pnpm --filter=app dev",
"dev:graphql": "pnpm --filter=graphql dev",
"dev:indexer": "pnpm --filter=indexer dev:indexer",
"dev:indexer": "pnpm --filter=indexer dev",
"start": "pnpm turbo:run --filter=!indexer start",
"lint": "run-s lint:check prettier:check",
"lint:check": "pnpm turbo:run lint",
"lint:check": "eslint .",
"lint:fix": "pnpm lint:check --fix",
"node:clean": "make -C ./docker clean",
"node:logs": "make -C ./docker logs",
"node:restart": "make -C ./docker restart",
Expand All @@ -40,7 +43,6 @@
"prepare": "husky install",
"prettier:check": "prettier --check .",
"prettier:format": "prettier --write .",
"postinstall": "./scripts/copy-icons.sh",
"test": "pnpm turbo:run test",
"test:ci": "pnpm turbo:run test -- --ci --testLocationInResults --json --coverage",
"test:clear": "pnpm turbo:run test -- --clearCache",
Expand All @@ -50,25 +52,40 @@
"turbo:run": "./scripts/turbo.sh"
},
"dependencies": {
"@fuels/eslint-plugin": "^0.0.9",
"@fuels/jest": "^0.0.9",
"@fuels/prettier-config": "^0.0.9",
"@fuels/ts-config": "^0.0.9",
"@fuels/eslint-plugin": "^0.0.11",
"@fuels/jest": "^0.0.11",
"@fuels/prettier-config": "^0.0.11",
"@fuels/ts-config": "^0.0.11",
"jest": "29.7.0",
"lint-staged": "14.0.1"
},
"devDependencies": {
"@fuels/tsup-config": "^0.0.9",
"@swc/core": "1.3.84",
"@fuels/tsup-config": "^0.0.11",
"@swc/core": "1.3.88",
"@swc/jest": "0.2.29",
"@types/jest": "29.5.4",
"@types/node": "20.6.0",
"eslint": "^8.49.0",
"@types/jest": "29.5.5",
"@types/node": "20.6.5",
"deepmerge-json": "1.5.0",
"@next/eslint-plugin-next": "^13.5.3",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.0.2",
"husky": "^8.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"tsup": "7.2.0",
"turbo": "^1.10.13",
"turbo": "^1.10.14",
"typescript": "5.2.2",
"updates": "^15.0.2"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/app/.eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const config = require('../../.eslintrc.js');

module.exports = {
extends: [
'plugin:@fuels/typescript',
'plugin:@fuels/jest',
'plugin:@fuels/react',
'plugin:@fuels/next',
],
rules: config.rules,
};
8 changes: 6 additions & 2 deletions packages/app/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ const config: StorybookConfig = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
'@storybook/addon-storysource',
'storybook-dark-mode',
'@storybook/addon-a11y',
'storybook-addon-theme/register',
],
staticDirs: ['../public'],
core: {},
framework: {
name: '@storybook/nextjs',
options: {},
},
typescript: {
check: false,
reactDocgen: 'react-docgen',
},
};

export default config;
Loading

0 comments on commit 62b9acc

Please sign in to comment.