Skip to content

Commit

Permalink
chore: restore commitlint, commitizen, husky, and lint staged
Browse files Browse the repository at this point in the history
  • Loading branch information
MFarabi619 committed Nov 11, 2024
1 parent c38beeb commit 8e2157d
Show file tree
Hide file tree
Showing 29 changed files with 2,041 additions and 139 deletions.
1 change: 1 addition & 0 deletions .cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "path": "@commitlint/cz-commitlint" }
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/home/mfarabi/workspace/cuHacking/2025-backup/.cz.json":"1","/home/mfarabi/workspace/cuHacking/2025-backup/.github/workflows/BUILD.yml":"2","/home/mfarabi/workspace/cuHacking/2025-backup/.github/workflows/TEST_e2e.yml":"3","/home/mfarabi/workspace/cuHacking/2025-backup/README.md":"4","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/playwright.config.ts":"5","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/src/docs.spec.ts":"6","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/mdx-components.tsx":"7","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/next.config.mjs":"8","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/specs/index.spec.tsx":"9","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/[[...slug]]/page.tsx":"10","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/layout.config.tsx":"11","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/layout.tsx":"12","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/source.ts":"13","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/tailwind.config.js":"14","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/app/nx-welcome.tsx":"15","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/test-setup.ts":"16","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tests/routes/_index.spec.tsx":"17","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tsconfig.json":"18","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tsconfig.spec.json":"19","/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/vitest.config.ts":"20","/home/mfarabi/workspace/cuHacking/2025-backup/commitlint.config.ts":"21","/home/mfarabi/workspace/cuHacking/2025-backup/package.json":"22","/home/mfarabi/workspace/cuHacking/2025-backup/release.config.ts":"23","/home/mfarabi/workspace/cuHacking/2025-backup/tsconfig.base.json":"24","/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/eslint.config.js":"25"},{"size":40,"mtime":1731355682275,"results":"26","hashOfConfig":"27"},{"size":1292,"mtime":1731355682275,"results":"28","hashOfConfig":"29"},{"size":2089,"mtime":1731355682275,"results":"30","hashOfConfig":"29"},{"size":4119,"mtime":1731355682275,"results":"31","hashOfConfig":"32"},{"size":1804,"mtime":1731355682275,"results":"33","hashOfConfig":"34"},{"size":15548,"mtime":1731355723799,"results":"35","hashOfConfig":"36"},{"size":753,"mtime":1731355682275,"results":"37","hashOfConfig":"38"},{"size":1342,"mtime":1731355682275,"results":"39","hashOfConfig":"40"},{"size":269,"mtime":1731355682275,"results":"41","hashOfConfig":"36"},{"size":2353,"mtime":1731355682275,"results":"42","hashOfConfig":"38"},{"size":3502,"mtime":1731355682275,"results":"43","hashOfConfig":"34"},{"size":973,"mtime":1731355682275,"results":"44","hashOfConfig":"38"},{"size":1527,"mtime":1731355682275,"results":"45","hashOfConfig":"38"},{"size":960,"mtime":1731355682275,"results":"46","hashOfConfig":"47"},{"size":30706,"mtime":1731355682275,"results":"48","hashOfConfig":"38"},{"size":111,"mtime":1731355682275,"results":"49","hashOfConfig":"38"},{"size":386,"mtime":1731355682275,"results":"50","hashOfConfig":"36"},{"size":739,"mtime":1731355682275,"results":"51","hashOfConfig":"52"},{"size":576,"mtime":1731355682279,"results":"53","hashOfConfig":"52"},{"size":856,"mtime":1731355682279,"results":"54","hashOfConfig":"34"},{"size":6286,"mtime":1731355682279,"results":"55","hashOfConfig":"34"},{"size":3583,"mtime":1731355682279,"results":"56","hashOfConfig":"57"},{"size":141,"mtime":1731355682282,"results":"58","hashOfConfig":"34"},{"size":1306,"mtime":1731355682282,"results":"59","hashOfConfig":"52"},{"size":682,"mtime":1731355682275,"results":"60","hashOfConfig":"47"},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"9jot0g",{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1w9oofy",{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"j7n83z",{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1eowi3n",{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ahkky0",{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"15g5gp0",{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"a00fkg",{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"zvhc17",{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1q2sngz",{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"fyjtbu",{"filePath":"127","messages":"128","suppressedMessages":"129","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","suppressedMessages":"132","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"133","messages":"134","suppressedMessages":"135","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/mfarabi/workspace/cuHacking/2025-backup/.cz.json",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/.github/workflows/BUILD.yml",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/.github/workflows/TEST_e2e.yml",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/README.md",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/playwright.config.ts",[],["136","137"],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/src/docs.spec.ts",[],["138"],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/mdx-components.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/next.config.mjs",[],["139"],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/specs/index.spec.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/[[...slug]]/page.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/layout.config.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/layout.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/src/app/(docs)/source.ts",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs/tailwind.config.js",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/app/nx-welcome.tsx",["140"],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/test-setup.ts",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tests/routes/_index.spec.tsx",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tsconfig.json",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/tsconfig.spec.json",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/website/vitest.config.ts",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/commitlint.config.ts",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/package.json",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/release.config.ts",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/tsconfig.base.json",[],[],"/home/mfarabi/workspace/cuHacking/2025-backup/apps/docs-e2e/eslint.config.js",[],[],{"ruleId":"141","severity":2,"message":"142","line":12,"column":17,"nodeType":"143","messageId":"144","endLine":12,"endColumn":24,"suppressions":"145"},{"ruleId":"141","severity":2,"message":"142","line":36,"column":27,"nodeType":"143","messageId":"144","endLine":36,"endColumn":34,"suppressions":"146"},{"ruleId":"147","severity":2,"message":"148","line":12,"column":11,"nodeType":"143","endLine":12,"endColumn":14,"suppressions":"149"},{"ruleId":"141","severity":2,"message":"142","line":24,"column":19,"nodeType":"143","messageId":"144","endLine":24,"endColumn":26,"suppressions":"150"},{"ruleId":"151","severity":1,"message":"152","line":11,"column":7,"nodeType":"153","messageId":"154","endLine":429,"endColumn":9},"node/prefer-global/process","Unexpected use of the global variable 'process'. Use 'require(\"process\")' instead.","Identifier","preferModule",["155"],["156"],"react-hooks/rules-of-hooks","React Hook \"use\" is called in function \"docsLayoutPage\" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word \"use\".",["157"],["158"],"react-dom/no-dangerously-set-innerhtml","Using 'dangerouslySetInnerHTML' may have security implications.","JSXElement","noDangerouslySetInnerhtml",{"kind":"159","justification":"160"},{"kind":"159","justification":"160"},{"kind":"159","justification":"160"},{"kind":"159","justification":"160"},"directive",""]
14 changes: 7 additions & 7 deletions .github/workflows/BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ jobs:
- name: 🌐 Build Website
run: pnpm nx build website --verbose

- name: 🌀 Build Portal
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
run: pnpm nx build portal --verbose
# - name: 🌀 Build Portal
# env:
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
# AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
# GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
# GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
# run: pnpm nx build portal --verbose

- name: 💰 Profit
run: echo 🐞
28 changes: 14 additions & 14 deletions .github/workflows/TEST_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ jobs:
path: playwright-report/**/*
retention-days: 30

- name: 💀 Run Portal E2E Tests
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
run: pnpm nx run portal-e2e:e2e --reporter=html --verbose
# - name: 💀 Run Portal E2E Tests
# env:
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
# AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
# GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
# GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
# run: pnpm nx run portal-e2e:e2e --reporter=html --verbose

- name: 📄 Upload Portal E2E Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-portal-e2e
path: playwright-report/**/*
retention-days: 30
# - name: 📄 Upload Portal E2E Playwright Report
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: playwright-report-portal-e2e
# path: playwright-report/**/*
# retention-days: 30

- name: 💀 Run Website E2E Tests
run: pnpm nx run website-e2e:e2e --reporter=html --verbose
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx commitlint --edit
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ Built with some of the most cutting-edge and stable open-source technologies, an
Installation instructions, contribution guidelines, and technology stacks are available in the [cuHacking Docs](https://docs.cuhacking.ca).

| [📚 Documentation](https://docs.cuhacking.ca) | [🗓️ Project Board](https://github.com/orgs/cuhacking/projects/4) | [💅 Figma](https://www.figma.com/files/team/1400857924219798056/project/261344209/2025?fuid=1196916890248607098) | [🌟 Design System (WIP)](#) |
| :---------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: |
| :----------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: |
| [![Documentation](https://github.com/user-attachments/assets/a09af068-4187-4d98-9f2d-5312678a5348)](https://docs.cuhacking.ca) | [![Project Board](https://github.com/user-attachments/assets/b10ddf82-4a8e-4892-bc45-ffdb596cd678)](https://github.com/orgs/cuhacking/projects/4) | [![Figma](https://github.com/user-attachments/assets/8c0cedcf-ce27-4a9c-9bf3-eed8ab3af5d6)](https://www.figma.com/files/team/1400857924219798056/project/261344209/2025?fuid=1196916890248607098) | [![Design System](https://github.com/user-attachments/assets/c7ccdb15-f911-4a5e-b0b4-7c9984baa30a)](#) |
51 changes: 20 additions & 31 deletions apps/docs-e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
// TODO: merge with antfu eslint config
// const { FlatCompat } = require('@eslint/eslintrc');
// const playwright = require('eslint-plugin-playwright');
// const baseConfig = require('../../eslint.config.js');

// module.exports = [
// playwright.configs['flat/recommended'],
// ...baseConfig,
// {
// files: ['**/*.ts', '**/*.js'],
// // Override or add rules here
// rules: {},
// },
// ]

import playwright from 'eslint-plugin-playwright'
import baseConfigPromise from '../../eslint.config.js'

export default (async () => {
const baseConfig = await baseConfigPromise

return [
playwright.configs['flat/recommended'],
...baseConfig,
// ...compat.extends("plugin:playwright/recommended"),
// The following configurations are commented out
// ...compat.extends(
// 'plugin:@nx/react-typescript',
// 'next',
// 'next/core-web-vitals'
// ),
// {
// files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// rules: {
// '@next/next/no-html-link-for-pages': ['error', 'apps/portal/pages'],
// },
// },
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {},
// },
// {
// files: ['**/*.js', '**/*.jsx'],
// rules: {},
// },
// ...compat.config({ env: { jest: true } }).map((config) => ({
// ...config,
// files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
// rules: {
// ...config.rules,
// },
// })),
// { ignores: ['.next/**/*'] },
{
files: ['**.ts', '**.js'],
// Override or add rules here
rules: {},
},
]
})()
4 changes: 2 additions & 2 deletions apps/docs-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// TODO: Investigate node global process usage
/* eslint-disable node/prefer-global/process */
import { fileURLToPath } from 'node:url'
import { defineConfig, devices } from '@playwright/test'
import { workspaceRoot } from '@nx/devkit'
import { nxE2EPreset } from '@nx/playwright/preset'

import { workspaceRoot } from '@nx/devkit'
import { defineConfig, devices } from '@playwright/test'

const __filename = fileURLToPath(import.meta.url)

Expand Down
5 changes: 3 additions & 2 deletions apps/docs-e2e/src/docs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { test as base, expect } from '@playwright/test'

import { DocsLayout } from './pom'

import { clickAndGoToPage } from './helpers/click-and-go-to-page'

import { DocsLayout } from './pom'

const test = base.extend<{ docsLayoutPage: DocsLayout }>({
docsLayoutPage: async ({ page }, use) => {
const docsLayoutPage = new DocsLayout(page)
await docsLayoutPage.goto()
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(docsLayoutPage)
},
})
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { MDXComponents } from 'mdx/types'
import defaultComponents from 'fumadocs-ui/mdx'
import type { ReactNode } from 'react'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Callout } from 'fumadocs-ui/components/callout'
import Link from 'fumadocs-core/link'
import { Callout } from 'fumadocs-ui/components/callout'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import defaultComponents from 'fumadocs-ui/mdx'

export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { composePlugins, withNx } from '@nx/next'
import createMDX from 'fumadocs-mdx/config'
import { fileGenerator, remarkDocGen, remarkInstall } from 'fumadocs-docgen'
import createMDX from 'fumadocs-mdx/config'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import rehypeMermaid from 'rehype-mermaid'
import remarkMath from 'remark-math'

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
Expand Down
Loading

0 comments on commit 8e2157d

Please sign in to comment.