Skip to content

Commit

Permalink
feat: transform project into react app
Browse files Browse the repository at this point in the history
  • Loading branch information
braianj committed Nov 28, 2024
1 parent df6208d commit 9e350fa
Show file tree
Hide file tree
Showing 51 changed files with 13,564 additions and 502 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@dcl/eslint-config/ui"],
}
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
open-pull-requests-limit: 20
schedule:
interval: "weekly"
allow:
- dependency-name: "@dcl/*"
- dependency-name: "dcl-*"
versioning-strategy: auto
commit-message:
prefix: "chore: "
24 changes: 24 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Audit

on: [push, pull_request]

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Use Node.js 20.x
uses: actions/[email protected]
with:
node-version: 20.x
cache: "npm"

- name: Upgrade npm
run: npm i -g npm

- name: Install
run: npm ci

- name: Audit signatures
run: npm audit signatures
50 changes: 50 additions & 0 deletions .github/workflows/build-release.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and release

on:
push:
branches:
- master
release:
types:
- created

jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x

- name: Set package.json version
uses: menduz/oddish-action@master
with:
deterministic-snapshot: true
only-update-versions: true

- name: Install
run: npm ci
env:
HUSKY: 0

- name: Build
run: npm run build
env:
NODE_PATH: 'src'
NODE_OPTIONS: '--max-old-space-size=6144'

- name: Publish
uses: menduz/oddish-action@master
with:
cwd: './dist'
deterministic-snapshot: true
provenance: false
registry-url: 'https://registry.npmjs.org'
access: public
gitlab-token: ${{ secrets.GITLAB_CDN_DEPLOYER_TOKEN }}
gitlab-pipeline-url: ${{ secrets.GITLAB_CDN_DEPLOYER_URL }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/set-rollout-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Set rollout by path - Manual

on:
workflow_dispatch:
inputs:
packageVersion:
description: "NPM Version of the release (@dcl/catalyst-monitor-site)"
required: true
default: ""
deploymentEnvironment:
type: "choice"
description: "Deployment environment"
required: true
default: "zone"
options:
- zone
- today
- org
rolloutPercentage:
description: "The percentage for this rollout"
required: true
default: "100"

jobs:
set-manual-by-path-rollout:
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2
- name: Set Rollout
uses: decentraland/set-rollout-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

# Repo deployment info
ref: ${{ github.event.ref }}
sha: ${{ github.sha }}

# CDN information
packageName: "@dcl/catalyst-monitor-site"
packageVersion: ${{ github.event.inputs.packageVersion }}

# Rollout information
deploymentPath: "catalyst-monitor"
deploymentEnvironment: ${{ github.event.inputs.deploymentEnvironment }}
deploymentName: "_site"
percentage: ${{ github.event.inputs.rolloutPercentage }}
50 changes: 50 additions & 0 deletions .github/workflows/set-rollout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Set rollout by path

on: [deployment_status]

jobs:
set-rollout:
if: ${{ github.event.deployment.task == 'upload-to-cdn' && github.event.deployment_status.state == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2

# Dev
- name: Set Rollout - Development
uses: decentraland/set-rollout-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

# Repo deployment info
ref: ${{ github.event.deployment.ref }}
sha: ${{ github.event.deployment.sha }}

# CDN information
packageName: ${{ github.event.deployment.payload.packageName }}
packageVersion: ${{ github.event.deployment.payload.packageVersion }}

# Rollout information
deploymentPath: 'catalyst-monitor-site'
deploymentEnvironment: 'zone'
deploymentName: '_site'
percentage: 100

# Stg
- name: Set Rollout - Staging
uses: decentraland/set-rollout-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

# Repo deployment info
ref: ${{ github.event.deployment.ref }}
sha: ${{ github.event.deployment.sha }}

# CDN information
packageName: ${{ github.event.deployment.payload.packageName }}
packageVersion: ${{ github.event.deployment.payload.packageVersion }}

# Rollout information
deploymentPath: 'catalyst-monitor'
deploymentEnvironment: 'today'
deploymentName: '_site'
percentage: 100
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install
run: npm ci

- name: Test
run: npm run test:coverage
if: ${{ always() }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
6 changes: 6 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# npm run
{
"**/*.{ts,tsx,js,jsx,json,md,mdx,css}": ["prettier --write"],
"*.{js,jsx,ts,tsx}": ["eslint --fix"],
}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
Loading

0 comments on commit 9e350fa

Please sign in to comment.