Skip to content

Commit

Permalink
Initial Commit.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: bd4a3caef8e73a6adca9cd1cbf197d6e0c20eda9
  • Loading branch information
nkzw-bot authored and cpojer committed May 12, 2024
0 parents commit 4db9562
Show file tree
Hide file tree
Showing 792 changed files with 105,164 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
const { join } = require('node:path');
const { existsSync, readFileSync } = require('node:fs');

module.exports = {
extends: ['@nkzw', 'plugin:@deities/strict'],
ignorePatterns: [
'artemis/prisma/pothos-types.ts',
'dist/',
'electron/out/',
'hera/i18n/CampaignMap.tsx',
],
overrides: [
{
files: ['**/__generated__/**/*.ts'],
rules: {
'unicorn/no-abusive-eslint-disable': 0,
},
},
{
files: ['scripts/fixtures/**/*.tsx'],
rules: {
'unicorn/numeric-separators-style': 0,
},
},
{
files: ['i18n/**/*.cjs', 'hera/i18n/**/EntityMap.tsx'],
rules: {
'sort-keys-fix/sort-keys-fix': 0,
},
},
{
files: [
'{codegen,infra,scripts,tests}/**/*.tsx',
'artemis/{prisma,scripts}/**/*.tsx',
'artemis/artemis.tsx',
],
rules: {
'no-console': 0,
},
},
{
files: ['artemis/discord/**/*.tsx'],
rules: {
'no-console': [2, { allow: ['error'] }],
},
},
],
plugins: ['@deities'],
rules: {
'@typescript-eslint/no-restricted-imports': [
2,
{
paths: [
{
allowTypeImports: true,
message: `Use 'react-relay/hooks' instead.`,
name: 'react-relay',
},
{
message: `Use 'athena-prisma-client' instead.`,
name: '@prisma/client',
},
],
},
],
'import/no-extraneous-dependencies': [
2,
{
devDependencies: [
'./{ares,artemis,deimos,offline}/vite.config.ts',
'./{ares,artemis}/scripts/**/*.{js,cjs,tsx}',
'./ares/ares.tsx',
'./artemis/prisma/seed.tsx',
'./codegen/**',
'./docs/vocs.config.tsx',
'./electron/**',
'./infra/**',
'./scripts/**',
'./tests/**',
'./vitest.config.ts',
'**/__tests__/**',
],
packageDir: [__dirname].concat(
existsSync(join(__dirname, './electron')) ? ['./electron'] : [],
readFileSync('./pnpm-workspace.yaml', 'utf8')
.split('\n')
.slice(1)
.map((n) =>
join(
__dirname,
n
.replaceAll(/\s*-\s+/g, '')
.replaceAll("'", '')
.replaceAll('\r', ''),
),
),
),
},
],
'import/no-unresolved': [
2,
{ ignore: ['athena-crisis:*', 'glob', 'virtual:*'] },
],
'no-extra-parens': 0,
'no-restricted-globals': [2, 'alert', 'confirm'],
},
};
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: test

on:
push:
branches:
- '**'
pull_request:
branches:
- main

jobs:
action:
timeout-minutes: 20
permissions:
contents: read
deployments: write
strategy:
matrix:
node-version: [22]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Use Git Bash
if: matrix.os == 'windows-latest'
run: npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 9.*
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-

- name: Cache Playwright Browsers
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Run setup
run: pnpm install && pnpm dev:setup

- name: Setup Playwright
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpx playwright install --with-deps chromium

- name: Run tests
if: matrix.os != 'windows-latest'
run: pnpm test:ci

- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: pnpm vitest:run-ci
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.eslintcache
.pnpm-debug.log
**/node_modules/
/dist/
/node_modules/
/package-lock.json
/yarn.lock
ares/.enum_manifest.json
ares/.src_manifest.json
ares/**/__generated__
ares/src/generated/*
ares/vite.config.ts.timestamp-*
artemis/prisma/pothos-types.ts
coverage
docs/vocs.config.tsx.timestamp-*
electron/demo
electron/log-output
electron/offline
electron/out
halting-problem-failure.json
source_strings.json
tests/testSetup
tsconfig.tsbuildinfo

# Codegen
apollo/EncodedActions.tsx
apollo/FormatActions.tsx
apollo/Routes.tsx
artemis/graphql/schemaImportMap.tsx
hera/i18n/CampaignMap.tsx
hera/i18n/EntityMap.tsx
hermes/CampaignMapName.tsx
i18n/Entities.cjs
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto-install-peers=false
resolution-mode=highest
strict-peer-dependencies=false
33 changes: 33 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ares/.enum_manifest.json
ares/.src_manifest.json
ares/**/__generated__
ares/scripts/translateStorepage.js
ares/src/generated/
ares/translations/
artemis/graphql/schema.graphql
artemis/prisma/migrations/
artemis/prisma/pothos-types.ts
coverage
dist/
electron/out/
git-hooks/
halting-problem-failure.json
patches/
pnpm-lock.yaml
source_strings.json
ui/music
ui/sounds
vite.config.ts.timestamp*

# Codegen
apollo/EncodedActions.tsx
apollo/FormatActions.tsx
apollo/Routes.tsx
artemis/graphql/schemaImportMap.tsx
hera/i18n/CampaignMap.tsx
hera/i18n/EntityMap.tsx
hermes/CampaignMapName.tsx
i18n/Entities.cjs

# Codegen but checked-in
hera/render/Images.tsx
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"styled-components.vscode-styled-components",
"sysoev.vscode-open-in-github",
"usernamehw.errorlens",
"wix.vscode-import-cost"
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.reportStyleChecksAsWarnings": false
}
8 changes: 8 additions & 0 deletions @types/vitest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
interface CustomMatchers<R = unknown> {
toMatchImageSnapshot(): R;
}

declare namespace Vi {
interface Assertion extends CustomMatchers {}
interface AsymmetricMatchersContaining extends CustomMatchers {}
}
Loading

0 comments on commit 4db9562

Please sign in to comment.