Skip to content

Commit

Permalink
feat: add word stats with counts and acquainted percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle1an committed Jan 20, 2025
1 parent 4368f7e commit d6e8dc5
Show file tree
Hide file tree
Showing 78 changed files with 3,877 additions and 3,788 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ pnpm-debug.log*
# Editor directories and files
.fleet
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
settings.json
launch.json

.turbo

Expand Down
73 changes: 73 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"cSpell.words": [
"Auths",
"bigserial",
"callees",
"chartjs",
"clsx",
"cmdk",
"fkey",
"foxact",
"hookform",
"hookz",
"iconify",
"immer",
"lucide",
"nolyfill",
"nums",
"ofetch",
"opensubtitles",
"overscroll",
"Retimer",
"shadcn",
"sonner",
"Squircle",
"subvocab",
"tanstack",
"taze",
"themoviedb",
"tmdb",
"unplugin",
"valtio",
"vaul",
"VITE",
"zustand"
],
"i18n-ally.localesPaths": ["ui/src/i18n"],

// Enable the ESlint flat config support
"eslint.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{
"rule": "*",
"severity": "warn"
},
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "html", "markdown", "json", "jsonc", "yaml", "toml", "astro"],

"css.customData": [".vscode/tailwind.json"]
}
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
}
]
},
{
"name": "@apply",
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
}
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
}
]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SubVocab transforms your preparation for watching movies or reading books in English. Just input any text, such as subtitles, articles, or books, and SubVocab will efficiently categorize words into familiar and new groups, enhancing both your understanding and enjoyment.

<img width="1422" alt="Screenshot" src="https://github.com/user-attachments/assets/1945d43c-e3b3-4715-83d4-19b216e69246" />
<img width="1422" alt="Screenshot" src="https://github.com/user-attachments/assets/6e1cf65b-b65b-4294-96a3-3a32077a709f" />

[Visualization of this repo](https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=kyle1an%2FSubVocab)

Expand Down
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"type": "module",
"version": "0.0.0",
"private": true,
"packageManager": "[email protected].3",
"packageManager": "[email protected].4",
"scripts": {
"dev": "tsx watch --env-file=.env app",
"dev": "tsx watch --trace-deprecation --env-file=.env app",
"introspect": "drizzle-kit introspect",
"build": "tsc && node --run copy-files",
"copy-files": "cp -R public dist/backend",
Expand All @@ -14,12 +14,12 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@trpc/server": "11.0.0-rc.566",
"@trpc/server": "11.0.0-rc.700",
"cookie": "^1.0.2",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"debug": "^4.4.0",
"drizzle-orm": "^0.38.3",
"drizzle-orm": "^0.38.4",
"express": "^5.0.1",
"http-errors": "^2.0.0",
"http-proxy-middleware": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils/db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Database } from '@subvocab/ui/database.types.js'
import type { Database } from '@ui/database.types.js'

import { createClient } from '@supabase/supabase-js'
import { drizzle } from 'drizzle-orm/postgres-js'
Expand Down
8 changes: 4 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default antfu(
},
stylistic.configs.customize({
arrowParens: true,
braceStyle: '1tbs',
braceStyle: 'stroustrup',
quoteProps: 'as-needed',
}),
{
Expand All @@ -19,16 +19,16 @@ export default antfu(
'no-extra-semi': 'off',
'@stylistic/switch-colon-spacing': 'warn',
'@stylistic/quotes': [1, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'@stylistic/brace-style': ['error', '1tbs'],
'unused-imports/no-unused-vars': 'off',
'prefer-arrow-callback': 'off',
curly: ['error', 'multi-or-nest', 'consistent'],
},
},
{
...packageJson,
rules: {
'package-json/sort-collections': [
'error',
'warn',
[
'dependencies',
'devDependencies',
Expand All @@ -41,7 +41,7 @@ export default antfu(
name: 'root/perfectionist',
rules: {
'perfectionist/sort-imports': [
'error',
'warn',
{
type: 'natural',
internalPattern: ['^@/.+'],
Expand Down
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.3.0",
"private": true,
"packageManager": "[email protected].3",
"packageManager": "[email protected].4",
"scripts": {
"backend": "pnpm --filter @sub-vocab/backend",
"ui": "pnpm --filter @sub-vocab/ui",
Expand All @@ -13,24 +13,24 @@
"lint:fix": "pnpm --recursive run lint:fix"
},
"dependencies": {
"@supabase/supabase-js": "^2.47.12",
"@supabase/supabase-js": "^2.48.0",
"date-fns": "^4.1.0",
"type-fest": "^4.32.0",
"zod": "3.23.8"
},
"devDependencies": {
"@antfu/eslint-config": "^3.13.0",
"@stylistic/eslint-plugin": "^2.12.1",
"@antfu/eslint-config": "^3.14.0",
"@stylistic/eslint-plugin": "^2.13.0",
"@t3-oss/env-core": "^0.11.1",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.10.5",
"eslint": "^9.17.0",
"eslint-plugin-package-json": "^0.19.0",
"@types/node": "^22.10.7",
"eslint": "^9.18.0",
"eslint-plugin-package-json": "^0.20.1",
"jsonc-eslint-parser": "^2.4.0",
"openapi-typescript": "^7.5.2",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"prettier": "^3.4.2",
"taze": "^18.1.0",
"taze": "^18.2.0",
"typescript": "5.7.2"
},
"pnpm": {
Expand All @@ -40,7 +40,11 @@
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.41",
"safer-buffer": "npm:@nolyfill/safer-buffer@^1.0.41",
"side-channel": "npm:@nolyfill/side-channel@^1.0.29"
"side-channel": "npm:@nolyfill/side-channel@^1.0.29",
"whatwg-url": "^14.1.0"
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
},
"resolutions": {
Expand Down
46 changes: 46 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js
index 6513e81d80d5250ea249ea833f819ece67897c7e..486d4c896d65a3bb7cf63307af68facb3ddb886b 100644
--- a/lib/http-proxy/common.js
+++ b/lib/http-proxy/common.js
@@ -1,6 +1,5 @@
var common = exports,
url = require('url'),
- extend = require('util')._extend,
required = require('requires-port');

var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i,
@@ -40,10 +39,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
);

outgoing.method = options.method || req.method;
- outgoing.headers = extend({}, req.headers);
+ outgoing.headers = Object.assign({}, req.headers);

if (options.headers){
- extend(outgoing.headers, options.headers);
+ Object.assign(outgoing.headers, options.headers);
}

if (options.auth) {
diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js
index 977a4b3622b9eaac27689f06347ea4c5173a96cd..88b2d0fcfa03c3aafa47c7e6d38e64412c45a7cc 100644
--- a/lib/http-proxy/index.js
+++ b/lib/http-proxy/index.js
@@ -1,5 +1,4 @@
var httpProxy = module.exports,
- extend = require('util')._extend,
parse_url = require('url').parse,
EE3 = require('eventemitter3'),
http = require('http'),
@@ -47,9 +46,9 @@ function createRightProxy(type) {
args[cntr] !== res
) {
//Copy global options
- requestOptions = extend({}, options);
+ requestOptions = Object.assign({}, options);
//Overwrite with request options
- extend(requestOptions, args[cntr]);
+ Object.assign(requestOptions, args[cntr]);

cntr--;
}
Loading

0 comments on commit d6e8dc5

Please sign in to comment.