Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from mapachurro/termsv1-1
Browse files Browse the repository at this point in the history
Updated terms
  • Loading branch information
mapachurro authored Jul 23, 2024
2 parents 1aa5ac9 + ed51ca8 commit 1c3dc14
Show file tree
Hide file tree
Showing 125 changed files with 52,157 additions and 3,884 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}

2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_API_URL=http://localhost:5173
VITE_BASE_URL=/
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"react-app",
"react-app/jest",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}

26 changes: 13 additions & 13 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: GitHub Pages
name: Deploy WEB3-Glossary-Website

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Also does automated updates on PR
push:
branches:
- main
Expand All @@ -18,12 +15,13 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21"
node-version: '21'

- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -33,12 +31,14 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run build
- name: Install dependencies
run: npm install

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
- name: Build project
run: npm run build

- name: Deploy to GP
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_dir: ./dist # Default build directory for Vite
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
build/
.module-cache
*.log*
*.log*

dist
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^v21.1.0
109 changes: 0 additions & 109 deletions .package-lock.json

This file was deleted.

38 changes: 38 additions & 0 deletions data/sortterms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// This script is used to sort terms.json in alphabetical order.

const fs = require('fs');
const path = require('path');

const filePath = path.join(__dirname, 'terms.json');

// Read the JSON file
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading the file:', err);
return;
}

// Parse the JSON data
let termsData = JSON.parse(data);

// Extract terms object
let terms = termsData[0].terms;

// Sort the terms alphabetically by the term key
let sortedTerms = Object.keys(terms).sort().reduce((acc, key) => {
acc[key] = terms[key];
return acc;
}, {});

// Update the terms data with the sorted terms
termsData[0].terms = sortedTerms;

// Write the sorted JSON back to the file
fs.writeFile(filePath, JSON.stringify(termsData, null, 2), 'utf8', (err) => {
if (err) {
console.error('Error writing the file:', err);
return;
}
console.log('Terms sorted and saved successfully.');
});
});
Loading

0 comments on commit 1c3dc14

Please sign in to comment.