Skip to content

Commit

Permalink
Merge pull request #87 from GoSTEAN/help
Browse files Browse the repository at this point in the history
Fix problem with commitlint workflow file #79 #86
  • Loading branch information
0xibs authored Oct 4, 2024
2 parents d59b5bd + 04dd40d commit af41474
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 9 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: CI
name: Client Commitlint CI

CI=false npm run build

on: [push, pull_request]

Expand All @@ -11,11 +13,18 @@ jobs:
fetch-depth: 0
- name: Install required dependencies
run: |
apt update
apt install -y sudo
sudo apt-get update
sudo apt install -y sudo
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
- name: Clear npm cache
run: npm cache clean --force

- name: Update npm
run: npm install -g npm@latest

- name: Print versions
run: |
git --version
Expand All @@ -26,11 +35,10 @@ jobs:
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
npm install --save-dev lint-staged
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
if: github.eventxname == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
22 changes: 22 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
// module.exports = {
// env: { browser: true, es2020: true },
// extends: [
// "eslint:recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:react-hooks/recommended",
// ],
// parser: "@typescript-eslint/parser",
// parserOptions: { ecmaVersion: "latest", sourceType: "module" },
// plugins: ["react-refresh"],
// rules: {
// "react-refresh/only-export-components": "warn",
// "@typescript-eslint/no-inferrable-types": "off",
// "no-mixed-spaces-and-tabs": 0,
// 'prefer-const': 'warn',
// '@typescript-eslint/no-empty-function': 'off',
// "@typescript-eslint/ban-types": "off",
// "@typescript-eslint/no-unused-vars": "warn",
// "@typescript-eslint/no-explicit-any": "warn"
// },
// };

module.exports = {
env: { browser: true, es2020: true },
extends: [
Expand Down
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"dev": "vite",
"build": "tsc && vite build",
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",

"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",

"preview": "vite preview",
"create-components": "npx /Users/os/Documents/code/dojo/dojo.js/packages/core/bin/generateComponents.cjs ../../dojo-starter/manifests/dev/deployment/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0x3fc79ccfd72c1450d2ccb73c5c521a7ec68b6c6af0caf96a0f1c39ce58876c8"
},
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Control = ({
}: {
toggleActiveWindow: (window: string) => void;
}) => {

/* eslint-disable @typescript-eslint/no-unused-vars */
const [windows, setWindows] = useState(
WINDOW_CONFIGS.map((config) => ({ ...config, show: false, zIndex: 0 }))
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Dice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Dice = () => {

// The is the argument for the rollDie function
const randomRollAmount = () => {

return Math.floor(Math.random() * 30 + 15);
};

Expand Down
1 change: 1 addition & 0 deletions client/src/components/OptionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function OptionCard({
active,
onSelect,
option,

}: {
active?: boolean;
onSelect?: () => void;
Expand Down
1 change: 1 addition & 0 deletions client/src/components/RestartGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const RestartGame: React.FC = () => {
</div>
</div>
)}

{restart && (
<RestartModal
message="Are you sure you want to restart the gane?"
Expand Down
2 changes: 2 additions & 0 deletions client/src/context/game-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const GameContext = createContext<{
setGameOptions: (newOption: object) => void;
}>({
gameState: {},

/* eslint-disable @typescript-eslint/no-unused-vars */
setGameData: (game) => undefined,
options: {
Expand All @@ -20,5 +21,6 @@ export const GameContext = createContext<{
winners: [],
gameCondition: [],
},

setGameOptions: (newOption) => undefined,
});
2 changes: 1 addition & 1 deletion client/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export function createSystemCalls(
};

return { createUsername };
}
}
2 changes: 1 addition & 1 deletion client/src/hooks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ export const coloredBlocks: string[] = [
"R6",
];

export const chance: string[] = ["red", "green", "yellow", "blue"];
export const chance: string[] = ["red", "green", "yellow", "blue"];

0 comments on commit af41474

Please sign in to comment.