-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from TaskRatchet/return-from-monorepo
update deps
- Loading branch information
Showing
31 changed files
with
1,321 additions
and
2,182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ignores: ['@types/node', '@types/react-dom'] | ||
ignores: ["@types/node", "@types/react-dom", "eslint-config-prettier", "eslint-plugin-react-hooks"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,12 @@ jobs: | |
pull-requests: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: Strip content hashes from stats files | ||
run: | | ||
sed -i -E 's/index\.[0-9a-zA-Z_-]{8,}\./index./g' ./head-stats/stats.json | ||
sed -i -E 's/\.[0-9a-zA-Z_-]{8,}\.chunk\././g' ./head-stats/stats.json | ||
sed -i -E 's/index\.[0-9a-zA-Z_-]{8,}\./index./g' ./base-stats/stats.json | ||
sed -i -E 's/\.[0-9a-zA-Z_-]{8,}\.chunk\././g' ./base-stats/stats.json | ||
- uses: twk3/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ build | |
dist | ||
node_modules | ||
pnpm-lock.yaml | ||
stats.html | ||
stats.html | ||
.depcheckrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,30 @@ | ||
import { TextField } from '@mui/material'; | ||
import dayjs from 'dayjs'; | ||
import React from 'react'; | ||
import customParseFormat from 'dayjs/plugin/customParseFormat'; | ||
|
||
function makePicker({ | ||
formatValue, | ||
parseValue, | ||
}: { | ||
formatValue: (value: Date) => string; | ||
parseValue: (value: string) => Date; | ||
}) { | ||
dayjs.extend(customParseFormat); | ||
|
||
function makePicker(format: string) { | ||
return function MockPicker(p: any) { | ||
const [value, setValue] = React.useState(formatValue(p.value)); | ||
return p.renderInput({ | ||
label: p.label, | ||
value, | ||
onChange: (e: any) => { | ||
setValue(e.target.value); | ||
p.onChange({ | ||
$d: parseValue(e.target.value), | ||
}); | ||
}, | ||
...p.InputProps, | ||
}); | ||
const [value, setValue] = React.useState(p.value.format(format)); | ||
return ( | ||
<TextField | ||
{...{ | ||
label: p.label, | ||
value, | ||
onChange: (e: any) => { | ||
setValue(e.target.value); | ||
p.onChange(dayjs(e.target.value, format)); | ||
}, | ||
...p.slotProps.textField, | ||
}} | ||
/> | ||
); | ||
}; | ||
} | ||
|
||
const DatePicker = makePicker({ | ||
formatValue: (value: Date) => { | ||
// MM/DD/YYYY | ||
return value.toLocaleDateString('en-US', { | ||
year: 'numeric', | ||
month: '2-digit', | ||
day: '2-digit', | ||
}); | ||
}, | ||
parseValue: (value: string) => { | ||
const [month, day, year] = value.split('/').map(Number); | ||
return new Date(year, month - 1, day); | ||
}, | ||
}); | ||
|
||
const TimePicker = makePicker({ | ||
formatValue: (value: Date) => { | ||
// hh:mm A | ||
return value.toLocaleTimeString('en-US', { | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
hour12: true, | ||
}); | ||
}, | ||
parseValue: (value: string) => { | ||
// hh:mm A | ||
// example: "12:00 AM" | ||
const ampm = value.slice(-2); | ||
const [hour, minute] = value.slice(0, -2).split(':').map(Number); | ||
const hours = ampm === 'AM' ? hour : hour + 12; | ||
return new Date(0, 0, 0, hours, minute); | ||
}, | ||
}); | ||
const DatePicker = makePicker('MM/DD/YYYY'); | ||
const TimePicker = makePicker('hh:mm A'); | ||
|
||
export { DatePicker, TimePicker }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; | ||
import react from 'eslint-plugin-react'; | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin'; | ||
import regex from 'eslint-plugin-regex'; | ||
import lodash from 'eslint-plugin-lodash'; | ||
import globals from 'globals'; | ||
import tsParser from '@typescript-eslint/parser'; | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import js from '@eslint/js'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import testingLibrary from 'eslint-plugin-testing-library'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['public', 'src/serviceWorker.js', '**/eslint.config.mjs', 'dist'], | ||
}, | ||
...fixupConfigRules( | ||
compat.extends( | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'prettier', | ||
), | ||
), | ||
{ | ||
plugins: { | ||
react: fixupPluginRules(react), | ||
'@typescript-eslint': fixupPluginRules(typescriptEslint), | ||
regex, | ||
lodash, | ||
'testing-library': fixupPluginRules({ | ||
rules: testingLibrary.rules, | ||
}), | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
|
||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
|
||
project: './tsconfig.json', | ||
}, | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
|
||
rules: { | ||
'lodash/import-scope': 'error', | ||
|
||
'regex/required': [ | ||
'error', | ||
[ | ||
{ | ||
regex: 'describe.+from.+vitest', | ||
message: 'Import `describe` explicitly.', | ||
|
||
files: { | ||
inspect: '\\.(test|spec)\\.tsx?$', | ||
}, | ||
}, | ||
{ | ||
regex: 'it.+from.+vitest', | ||
message: 'Import `it` explicitly.', | ||
|
||
files: { | ||
inspect: '\\.(test|spec)\\.tsx?$', | ||
}, | ||
}, | ||
{ | ||
regex: 'expect.+from.+vitest', | ||
message: 'Import `expect` explicitly.', | ||
|
||
files: { | ||
inspect: '\\.(test|spec)\\.tsx?$', | ||
}, | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
'**/*.spec.ts', | ||
'**/*.spec.tsx', | ||
'**/__mocks__/**/*', | ||
'**/__tests__/**/*', | ||
'**/global-setup.ts', | ||
'src/lib/test/**/*', | ||
], | ||
|
||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.