???? ?? ??: Polyrepo? Monorepo
???? ??? ???? ? ?? ?? ??? ??? ????.
- Polyrepo: ???? ??? ??? ???? ??????. ?? ??? ?? ?????. ?? ?? ?? ??? ???? ??? ?????? ???? ???? ????.
- Monorepo: ?? ???? ??? ??? ???? ?? ??????. ????? ?? ???? ???? ?? ?? ??? ???? ?? ??????? ???? ?????. ?? ?? ?? ??? ??? ????, ???? ?? ?? ??? ????? ????, CI/CD ?????? ??? ??? ??? ? ????.
Monorepo? Yandex? ?? ?? ??? ?? ???? ?????. Monorepo? ?? ??? ?? ????? ?? ??? ???? ? ??? ???. Monorepo ? ?? ??? ?? ??? ??? ??? http://m.miracleart.cn/link/b01ccf4f29b57b0b1bdb9407050db28d? ?????. ? ????? PNPM? ???? Monorepo? ???? ??? ???? ??? ? ????.
PNPM? ?? ??? ???? ?? ????? ?? ???? ?????.
????
?? ? ??? ? Monorepo ????? ????. ???? PNPM ???:
pnpm init
?? ?? ??? ??? ???? pnpm-workspace.yaml
??? ????.
// pnpm-workspace.yaml packages: - 'packages/**' - 'apps/**'
/packages
???? ?? ?????? ?? /apps
???? ??????(?: ?? ??? React Native ??? ?????? ? API ??? ???? ?? ??? ?? ?? ?? ?? ?????? ???? ? ??????)? ????.
? ????? Telegram ?? ??? ?? ?????. ?? ?? ??? GitHub? ????: http://m.miracleart.cn/link/8164ca2fe04767628ac1c6813e8a0867. ?????? /apps/publish-bot
??? ??? ? ? ?? ??? ?????.
pnpm install
???? ?? ???
/packages
??? telegram-utils
??? ??? ??? PNPM ? TypeScript? ??????.
pnpm init && pnpm add -D typescript && pnpm tsc --init
? ???? ?? ???(???, ???, ??)? ???? ??? ???? ??? ?????. Telegraf ???? ???? ???:
pnpm add telegraf
?? ????? /src
????? ???? ???. ?? ???? ???? ??? ?? ??? ???? ?? ????. ???? ???? ??? /texts
??? ??? ??? ??? ????.
// packages/telegram-utils/src/texts/combineTexts.ts import { Message } from 'telegraf/types'; import { FmtString, join } from 'telegraf/format'; type GroupedMessages = { photos: Array<Message.PhotoMessage>; videos: Array<Message.VideoMessage>; text: Array<Message.TextMessage>; }; export const combineTexts = ({ photos, videos, text }: GroupedMessages) => { const photoTexts = photos .map(photo => photo.caption ? new FmtString(photo.caption, photo.caption_entities) : undefined) .filter((t): t is Required<FmtString> => t !== undefined); const videoTexts = videos .map(video => video.caption ? new FmtString(video.caption, video.caption_entities) : undefined) .filter((t): t is Required<FmtString> => t !== undefined); const allTexts = []; if (text.length) allTexts.push(join(text.map(t => new FmtString(t.text, t.entities))), '\n'); if (photoTexts.length) allTexts.push(join(photoTexts, '\n')); if (videoTexts.length) allTexts.push(join(videoTexts, '\n')); return join(allTexts, '\n'); };
?? ??:
- ? ??? ??, ???, ??? ? ???? ???? ???? ?????.
- ??? ???? ?? ? ?? ???? ???? FMT ???? ????? ???. ?? ???? ????
undefined
? ????? ???. ??? ??? ???? ???? ?? ?? ???? ??? ? ???? ?????.
??? ?? ?? ?? ???: /texts
pnpm init
??? package.json
??? ???? ??? ?? ????? ?????. exports
// pnpm-workspace.yaml packages: - 'packages/**' - 'apps/**'???????? Monorepo ???? ????? ?? ???? ???
? ?????. @monorepo
???? package.json
??? ??? ????: telegram-utils
pnpm install?? ???? ??:
pnpm init && pnpm add -D typescript && pnpm tsc --init??
??: package.json
pnpm add telegrafTypeScript ???? ??: ?? ???? ????? ?? ??? ???? ??? ??? ?????. ?? ???? ????? ???? ??? ?????.
??? /src
? ???? ???? rootDir
? outDir
? ?????. ????? /dist
: tsconfig.json
// packages/telegram-utils/src/texts/combineTexts.ts import { Message } from 'telegraf/types'; import { FmtString, join } from 'telegraf/format'; type GroupedMessages = { photos: Array<Message.PhotoMessage>; videos: Array<Message.VideoMessage>; text: Array<Message.TextMessage>; }; export const combineTexts = ({ photos, videos, text }: GroupedMessages) => { const photoTexts = photos .map(photo => photo.caption ? new FmtString(photo.caption, photo.caption_entities) : undefined) .filter((t): t is Required<FmtString> => t !== undefined); const videoTexts = videos .map(video => video.caption ? new FmtString(video.caption, video.caption_entities) : undefined) .filter((t): t is Required<FmtString> => t !== undefined); const allTexts = []; if (text.length) allTexts.push(join(text.map(t => new FmtString(t.text, t.entities))), '\n'); if (photoTexts.length) allTexts.push(join(photoTexts, '\n')); if (videoTexts.length) allTexts.push(join(videoTexts, '\n')); return join(allTexts, '\n'); };
??
?? ??? /apps/publish-bot
???? ?? ??? ?????. ??? ??? ??? ??? ??? @monorepo/telegram-utils
? ???? ??? ?????. workspace:*
// packages/telegram-utils/src/texts/index.ts export * from './combineTexts';??? ??:
// packages/telegram-utils/package.json "exports": { "./texts": { "import": "./src/texts/index.ts", "require": "./dist/texts/index.js" } }? ??? ??
?? ????: preview
// packages/telegram-utils/package.json "name": "@monorepo/telegram-utils"????
: /apps/publish-bot/tsconfig.json
// packages/telegram-utils/package.json "scripts": { "build": "tsc -p tsconfig.json" }?????? ??? ???? ?? ?? ???? ???? ???.
// packages/telegram-utils/package.json { "name": "@monorepo/telegram-utils", "version": "1.0.0", "main": "index.js", "scripts": { "build": "tsc -p tsconfig.json" }, "keywords": [], "license": "ISC", "exports": { "./texts": { "import": "./src/texts/index.ts", "require": "./dist/texts/index.js" } }, "devDependencies": { "typescript": "^5.7.3" }, "dependencies": { "telegraf": "^4.16.3" } }
??
?? ??? ?? ?? ?? ?????/???? ???? Monorepo? ????. ?? ?? ??? ??? ??? ???? ?? ???????? ??? ???? ? ????.Unsplash?? Gabriel Heinzer? ?? ???
? ??? PNPM? ???? Monorepo?? ???? ?? ? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











JavaScript?? ??? ??? ?? ? ? ?? ??? ???????. 1. ?? ??? ??? ???? ?? ??? ????. ISO ?? ???? ???? ???? ???? ?? ????. 2. ?? ??? ?? ???? ??? ?? ???? ??? ? ??? ? ?? 0?? ????? ?? ??????. 3. ?? ?? ???? ???? ???? ?? ?????? ??? ? ????. 4. Luxon? ?? ???? ???? ?????? ???? ?? ????. ??? ?? ???? ????? ???? ??? ????? ?? ? ????.

TAGGSATTHEBOTTOMOFABLOGPOSTORWEBPAGESERVESPRACTICALPURSEO, USEREXPERIENCE, andDESIGN.1.ITHELPSWITHEOBYOWNSESPORENGENSTOESTOCESKESKERKESKERKERKERDER-RELEVANTTAGSWITHOUTHINGTEMAINCONTENT.2.ITIMPROVESEREXPERKEEPINGTOPONTEFOCUSOFOFOFOCUSOFOFOFOCUCUSONTHEATECLL

??? ?? ? ??? DOM?? ??? ??? ? ?????. ??? ?? ????? ?? ??????, ??? ?? ???? ?? ????????. 1. ??? ??? addeventListener? usecapture ?? ??? true? ???? ?????. 2. ??? ??? ?? ???? usecapture? ???? ????? ?????. 3. ??? ??? ??? ??? ???? ? ??? ? ????. 4. ??? ?? ?? ?? ??? ?? ??? ??????? ??? ???? ?????. 5. ??? ?? ?? ?? ??? ?? ???? ?? ???? ? ??? ? ????. ? ? ??? ???? ???? JavaScript? ??? ??? ??? ????? ???? ???? ??? ??????.

JavaScript ?? ????? ??????? ??? ?? ??? ??? ????? ?? ??? ????. ????? ??? ?????. 1. ?? ?? (CodesPlitting) ??, ?? ??? React.lazy ()? ?? ?? ?? ?? ??? ????? ??? ???? ? ?? ????? ??? ?? ??? ???????. 2. ???? ?? ?? (???)? ????, ES6 ?? ????? ???? "Dead Code"? ???? ?? ? ????? ?? ??? ??? ? ???????. 3. ?? ??? ???? ???? GZIP/BROTLI ? TERSER? JS? ???? ??? ????? ???? ?? ???? ??? ? ? ??????. 4. ??? ???? ???? day.js ? fetch? ?? ?? ?????? ??????.

ES ??? CommonJS? ?? ???? ?? ?? ? ?? ???????. 1. Commonjs? ????????? Node.js ?? ? ??? ?????. 2.ES ??? ???????? ????? ?? ???? ??? ?????. 3. ??, ES ??? ?? ??/????? ???? ??? ??? ?????? CommonJS? Quiew/Module.exports? ???? ???? ???? ?? ? ? ????. 4. Commonjs? Express? ?? ???? Node.js ? ?????? ?? ???? ?? ???? ?? ES ??? ?? ??? ?? ??? ?? ? Node.jsv14? ?????. 5. ?? ? ? ??? ?? ??? ??? ? ????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

VAR, Let ? Const? ???? ??, ?? ? ?? ?????. 1.var? ?? ??????? ?? ???? ?? ? ??? ?????. 2. let? ?? ?? ????? ?? ?? ???? ?? ? ??? ???? ????. 3. ???? ?? ?? ???? ?? ??????? ? ?? ? ? ??? ?? ??? ?? ?? ??? ? ????. ?? const? ???? ??? ??? ? LET? ???? VAR? ???? ????.
