mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: start of monorepo
This commit is contained in:
1 parent
14f39d71ac
commit
73c7bdf0c0
260 files changed
+1236
-1235
No files matched your search
+13
-37
@@ -1,9 +1,12 @@
|
||||
{
|
||||
"name": "blitzkit",
|
||||
"private": true,
|
||||
"version": "1.22.6",
|
||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||
"main": "src/server.ts",
|
||||
"type": "module",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build:assets": "bun scripts/buildAssets/index.ts",
|
||||
"build:averages": "bun scripts/averages",
|
||||
@@ -27,17 +30,11 @@
|
||||
"discoverids": "scripts/discoverIds.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@gltf-transform/core": "^3.10.1",
|
||||
"@nivo/bar": "^0.87.0",
|
||||
"@octokit/plugin-throttling": "^8.2.0",
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@prisma/client": "^5.19.1",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"_dependencies": {
|
||||
"@radix-ui/colors": "^3.0.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/themes": "^3.1.3",
|
||||
"@react-three/drei": "^9.111.5",
|
||||
"@react-three/fiber": "^8.17.6",
|
||||
"@resvg/resvg-js": "^2.6.2",
|
||||
"@types/three": "^0.160.0",
|
||||
"@vanilla-extract/css": "^1.15.5",
|
||||
@@ -53,59 +50,38 @@
|
||||
"false": "^0.0.4",
|
||||
"fuzzysort": "^2.0.4",
|
||||
"googleapis": "^134.0.0",
|
||||
"immer": "^10.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"markdown-escape": "^2.0.0",
|
||||
"markdown-to-jsx": "^7.5.0",
|
||||
"next": "^14.2.7",
|
||||
"parse-dds": "^1.2.1",
|
||||
"pickleparser": "^0.2.1",
|
||||
"postprocessing": "^6.36.0",
|
||||
"progress": "^2.0.3",
|
||||
"protobufjs": "^7.4.0",
|
||||
"react": "^18.3.1",
|
||||
"react-device-detect": "^2.2.3",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-fuzzysort": "^1.0.1",
|
||||
"react-promise-suspense": "^0.3.4",
|
||||
"satori": "^0.10.14",
|
||||
"sharp": "^0.33.5",
|
||||
"three": "0.159.0",
|
||||
"three-stdlib": "^2.32.2",
|
||||
"urlon": "^3.1.0",
|
||||
"yaml": "^2.5.0",
|
||||
"zustand": "^4.5.5"
|
||||
"yaml": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"_devDependencies": {
|
||||
"@total-typescript/ts-reset": "^0.5.1",
|
||||
"@types/adm-zip": "^0.5.5",
|
||||
"@types/bun": "^1.1.8",
|
||||
"@types/bun": "latest",
|
||||
"@types/decompress": "^4.2.7",
|
||||
"@types/escape-html": "^1.0.4",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/lz4": "^0.6.4",
|
||||
"@types/lz4js": "^0.2.1",
|
||||
"@types/markdown-escape": "^1.1.3",
|
||||
"@types/node": "^20.16.3",
|
||||
"@types/parse-dds": "^1.0.3",
|
||||
"@types/pngjs": "^6.0.5",
|
||||
"@types/progress": "^2.0.7",
|
||||
"@types/react": "^18.3.5",
|
||||
"@vanilla-extract/next-plugin": "^2.4.5",
|
||||
"compare-versions": "^6.1.1",
|
||||
"crc": "^4.3.2",
|
||||
"fast-xml-parser": "^4.4.1",
|
||||
"knip": "^3.13.2",
|
||||
"prettier": "^3.3.3",
|
||||
"prisma": "^5.19.1",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"packageManager": "[email protected]",
|
||||
"trustedDependencies": [
|
||||
"protobufjs"
|
||||
]
|
||||
"prisma": "^5.19.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@blitzkit/core",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"dependencies": {
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
"@prisma/client": "^5.19.1",
|
||||
"@octokit/plugin-throttling": "^8.2.0",
|
||||
"lz4js": "^0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/lz4js": "^0.2.1"
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Region } from '../../constants/regions';
|
||||
|
||||
export const MIN_IDS: Record<Region, number> = {
|
||||
export const MIN_REGION_IDS: Record<Region, number> = {
|
||||
asia: 20e8,
|
||||
com: 10e8,
|
||||
eu: 5e8,
|
||||
};
|
||||
|
||||
export const MAX_IDS: Record<Region, number> = {
|
||||
export const MAX_REGION_IDS: Record<Region, number> = {
|
||||
asia: 31e8 - 1,
|
||||
com: MIN_IDS.asia - 1,
|
||||
eu: MIN_IDS.com - 1,
|
||||
com: MIN_REGION_IDS.asia - 1,
|
||||
eu: MIN_REGION_IDS.com - 1,
|
||||
};
|
||||
|
||||
export function idToRegion(id: number): Region {
|
||||
@@ -0,0 +1 @@
|
||||
export * from './idToRegion';
|
||||
File renamed without changes.
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { asset } from './asset';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
import { asset } from '../../../../src/core/blitzkit/asset';
|
||||
import { fetchCdonLz4 } from '../../../../src/core/blitzkit/fetchCdonLz4';
|
||||
|
||||
interface GameMode {
|
||||
name: string;
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './assertSecret';
|
||||
export * from './gameDefinitions';
|
||||
export * from './superCompress';
|
||||
export * from './superDecompress';
|
||||
@@ -1,5 +1,5 @@
|
||||
import { compress } from 'lz4js';
|
||||
import { CdonWriteStream } from '../streams/cdon';
|
||||
import { CdonWriteStream } from '../../../../src/core/streams/cdon';
|
||||
|
||||
export function superCompress(object: any) {
|
||||
const write = new CdonWriteStream().cdon(object);
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { decompress } from 'lz4js';
|
||||
import { CdonReadStream } from '../streams/cdon';
|
||||
import { CdonReadStream } from '../../../../src/core/streams/cdon';
|
||||
|
||||
export function superDecompress<Type>(buffer: ArrayBuffer) {
|
||||
const decompressed = decompress(new Uint8Array(buffer)).buffer as ArrayBuffer;
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
export * from './imgur';
|
||||
@@ -0,0 +1,5 @@
|
||||
export * from './blitz';
|
||||
export * from './blitzkit';
|
||||
export * from './imgur';
|
||||
export * from './patreon';
|
||||
export * from './zustand';
|
||||
@@ -0,0 +1 @@
|
||||
export * from './patreonLoginUrl';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { assertSecret } from './secret';
|
||||
import { assertSecret } from '../blitzkit/assertSecret';
|
||||
|
||||
export function patreonLoginUrl() {
|
||||
const params = new URLSearchParams({
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
export * from './createNextSafeStore';
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@blitzkit/scripts",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@gltf-transform/core": "^3.10.1",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.17.7"
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -1,5 +1,4 @@
|
||||
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
|
||||
import { readdirSync, writeFileSync } from 'fs';
|
||||
|
||||
const withVanillaExtract = createVanillaExtractPlugin({ tests: /\.css$/ });
|
||||
|
||||
@@ -18,16 +17,16 @@ const nextConfig = {
|
||||
},
|
||||
);
|
||||
|
||||
if (isServer) {
|
||||
writeFileSync(
|
||||
'public/assets/versions.json',
|
||||
JSON.stringify(
|
||||
readdirSync('docs/changelogs').map((file) =>
|
||||
file.replace('.md', ''),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
// if (isServer) {
|
||||
// writeFileSync(
|
||||
// 'public/assets/versions.json',
|
||||
// JSON.stringify(
|
||||
// readdirSync('docs/changelogs').map((file) =>
|
||||
// file.replace('.md', ''),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
return config;
|
||||
},
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@blitzkit/website",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "next dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/themes": "^3.1.3",
|
||||
"@blitzkit/core": "workspace:*",
|
||||
"@nivo/bar": "^0.87.0",
|
||||
"three": "0.159.0",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^14.2.7",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@react-three/drei": "^9.111.5",
|
||||
"@react-three/fiber": "^8.17.6",
|
||||
"react": "^18.3.1",
|
||||
"react-device-detect": "^2.2.3",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-fuzzysort": "^1.0.1",
|
||||
"immer": "^10.1.1",
|
||||
"zustand": "^4.5.5",
|
||||
"react-promise-suspense": "^0.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@vanilla-extract/next-plugin": "^2.4.5",
|
||||
"@types/react": "^18.3.5"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -3,8 +3,7 @@
|
||||
import { Button, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||
import { idToRegion } from '../../core/blitz/idToRegion';
|
||||
import { idToRegion } from '@blitzkit/core';
|
||||
import * as App from '../../stores/app';
|
||||
import { CURRENT_POLICIES_AGREEMENT_INDEX } from '../../stores/app/constants';
|
||||
import { PatreonAuthResponse } from '../auth/[provider]/page';
|
||||
@@ -78,7 +77,7 @@ export function Checks() {
|
||||
fetch(
|
||||
`https://api.worldoftanks.${idToRegion(
|
||||
wargaming.id,
|
||||
)}/wot/auth/prolongate/?application_id=${WARGAMING_APPLICATION_ID}&access_token=${
|
||||
)}/wot/auth/prolongate/?application_id=${assertSecret(process.env.WARGAMING_APPLICATION_ID)}&access_token=${
|
||||
wargaming.token
|
||||
}`,
|
||||
)
|
||||
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { imgur } from '@blitzkit/core';
|
||||
import { Code, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { imgur } from '../../../core/blitzkit/imgur';
|
||||
import { BRANCH_NAMES } from './constants';
|
||||
|
||||
export function Hero() {
|
||||
File renamed without changes.
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { assertSecret, patreonLoginUrl } from '@blitzkit/core';
|
||||
import { ArrowRightIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
Badge,
|
||||
@@ -11,10 +12,8 @@ import {
|
||||
Text,
|
||||
} from '@radix-ui/themes';
|
||||
import { useLayoutEffect, useState } from 'react';
|
||||
import { patreonLoginUrl } from '../../core/blitzkit/patreonLoginUrl';
|
||||
import { assertSecret } from '../../core/blitzkit/secret';
|
||||
import { PatreonIcon } from '../../components/PatreonIcon';
|
||||
import { useAdExempt } from '../../hooks/useAdExempt';
|
||||
import { PatreonIcon } from '../../icons/Patreon';
|
||||
import * as App from '../../stores/app';
|
||||
|
||||
export function Plugs() {
|
||||
@@ -1,3 +1,4 @@
|
||||
import { assertSecret, imgur, ImgurSize } from '@blitzkit/core';
|
||||
import { CaretRightIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
Box,
|
||||
@@ -10,8 +11,6 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { Link } from '../../components/Link';
|
||||
import { Tool } from '../../constants/tools';
|
||||
import { ImgurSize, imgur } from '../../core/blitzkit/imgur';
|
||||
import { assertSecret } from '../../core/blitzkit/secret';
|
||||
|
||||
type ToolCardProps = FlexProps & {
|
||||
tool: Tool;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,38 +2,27 @@
|
||||
|
||||
import { Flex, Theme } from '@radix-ui/themes';
|
||||
import '@radix-ui/themes/styles.css';
|
||||
import { config } from 'dotenv';
|
||||
import { Roboto_Flex } from 'next/font/google';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
import { Footer } from '../components/Footer';
|
||||
import Navbar from '../components/Navbar';
|
||||
import { Navbar } from '../components/Navbar';
|
||||
import { Party3 } from '../components/Party3';
|
||||
import * as App from '../stores/app';
|
||||
import { Checks } from './components/Checks';
|
||||
import { BRANCH_NAMES } from './components/Hero/constants';
|
||||
import { PageLoader } from './components/PageLoader';
|
||||
import './layout.css';
|
||||
|
||||
config();
|
||||
|
||||
interface RootLayoutProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
const robotoFlex = Roboto_Flex({
|
||||
subsets: ['latin'],
|
||||
display: 'swap',
|
||||
variable: '--font-roboto-flex',
|
||||
});
|
||||
|
||||
export default function RootLayout({ children }: RootLayoutProps) {
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const hideNav = false;
|
||||
const isRoot = pathname === '/';
|
||||
const isBranchNamed =
|
||||
process.env.NEXT_PUBLIC_ASSET_BRANCH &&
|
||||
BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH];
|
||||
|
||||
return (
|
||||
<App.Provider>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,11 +1,10 @@
|
||||
'use client';
|
||||
|
||||
import { imgur, ImgurSize } from '@blitzkit/core';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { ReactNode } from 'react';
|
||||
import { TOOLS } from '../../constants/tools';
|
||||
import { ImgurSize, imgur } from '../../core/blitzkit/imgur';
|
||||
import { theme } from '../../stitches.config';
|
||||
|
||||
interface ToolsLayoutProps {
|
||||
children: ReactNode;
|
||||
@@ -45,7 +44,7 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
<div
|
||||
style={{
|
||||
height: 128,
|
||||
boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
|
||||
boxShadow: `inset 0 -192px 128px -128px red`,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
@@ -57,7 +56,10 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
backgroundImage: `url(${imgur(tool!.image, { format: 'jpeg', size: ImgurSize.HugeThumbnail })})`,
|
||||
backgroundImage: `url(${imgur(tool!.image, {
|
||||
format: 'jpeg',
|
||||
size: ImgurSize.HugeThumbnail,
|
||||
})})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
width: '100%',
|
||||
@@ -75,7 +77,7 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
style={{
|
||||
textDecoration: 'none',
|
||||
fontWeight: 900,
|
||||
color: theme.colors.textHighContrast,
|
||||
color: 'red',
|
||||
fontSize: 32,
|
||||
letterSpacing: -1,
|
||||
}}
|
||||
@@ -84,7 +86,7 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
</Link>
|
||||
<span
|
||||
style={{
|
||||
color: theme.colors.textLowContrast,
|
||||
color: 'red',
|
||||
fontSize: 16,
|
||||
}}
|
||||
>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 260 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user