From 8408360342e4bf2ad746611b8aab6cdcf5bc3c3c Mon Sep 17 00:00:00 2001 From: wener Date: Sun, 3 Dec 2023 13:13:53 +0800 Subject: [PATCH] update; strategy -> mgmt --- notes/ai/ai-awesome.md | 11 + notes/ai/gpt/gpt-awesome.md | 2 + notes/ai/service/openai/chatgpt-awesome.md | 5 + .../stable-diffusion-awesome.md | 4 + notes/culture/game/game-awesome.md | 2 + notes/db/relational/mysql/mysql-perf.md | 9 + notes/dev/dev-faq.md | 49 +++- notes/dev/dict.md | 69 +++++- notes/hardware/peripheral/keyboard.md | 35 +++ notes/mgmt/README.md | 79 +++++++ notes/{strategy => }/mgmt/mgmt-faq.md | 3 +- notes/{strategy => }/mgmt/pm-awesome.md | 0 notes/{strategy => }/mgmt/pmp/README.md | 0 notes/{strategy => }/mgmt/pmp/pmbok-5th.md | 0 .../{strategy => }/mgmt/pmp/pmbok-summary.md | 0 notes/{strategy => }/mgmt/pmp/pmbok.md | 0 notes/{strategy => }/mgmt/pmp/pmp-glossary.md | 0 .../mgmt/pmp/project-charter.md | 0 .../mgmt/pmp/project-management-plan.md | 0 notes/{ => mgmt}/strategy/README.md | 0 notes/{strategy => }/mgmt/tech/cto.md | 0 notes/os/linux/init/systemd.md | 2 +- notes/platform/README.md | 2 + notes/platform/apple/apple-faq.md | 11 + notes/platform/platform-awesome.md | 5 + notes/platform/volcengine.md | 8 + notes/service/README.md | 3 + notes/service/api/api-awesome.md | 5 +- notes/service/api/api-design.md | 43 ++++ notes/service/erp/erp-glossary.md | 80 +++++++ notes/service/file/nextcloud/nextcloud-faq.md | 4 + notes/service/im/im-awesome.md | 3 + notes/service/media/image-awesome.md | 7 +- .../observability/logging/logging-format.md | 172 ++++++++++++++ notes/service/office/collabora.md | 3 + notes/service/realtime/README.md | 7 + notes/service/service-awesome.md | 10 + notes/service/service-faq.md | 6 + ...06\347\276\244\346\220\255\345\273\272.md" | 211 ------------------ notes/strategy/mgmt/README.md | 7 - notes/web/dev/biome.md | 72 ++++++ notes/web/dev/hono.md | 21 +- notes/web/favicon.md | 11 + notes/web/framework/nextjs/README.md | 13 +- notes/web/framework/nextjs/nextjs-conf.md | 8 + notes/web/framework/nextjs/nextjs-faq.md | 21 +- notes/web/framework/nextjs/nextjs-internal.md | 6 +- notes/web/react/react-awesome.md | 2 +- notes/web/script/js/js-awesome.md | 4 + notes/web/script/js/js-version.md | 11 +- notes/web/style/daisy.md | 31 +++ 51 files changed, 813 insertions(+), 244 deletions(-) create mode 100644 notes/db/relational/mysql/mysql-perf.md create mode 100644 notes/mgmt/README.md rename notes/{strategy => }/mgmt/mgmt-faq.md (99%) rename notes/{strategy => }/mgmt/pm-awesome.md (100%) rename notes/{strategy => }/mgmt/pmp/README.md (100%) rename notes/{strategy => }/mgmt/pmp/pmbok-5th.md (100%) rename notes/{strategy => }/mgmt/pmp/pmbok-summary.md (100%) rename notes/{strategy => }/mgmt/pmp/pmbok.md (100%) rename notes/{strategy => }/mgmt/pmp/pmp-glossary.md (100%) rename notes/{strategy => }/mgmt/pmp/project-charter.md (100%) rename notes/{strategy => }/mgmt/pmp/project-management-plan.md (100%) rename notes/{ => mgmt}/strategy/README.md (100%) rename notes/{strategy => }/mgmt/tech/cto.md (100%) create mode 100644 notes/platform/apple/apple-faq.md create mode 100644 notes/platform/volcengine.md create mode 100644 notes/service/observability/logging/logging-format.md create mode 100644 notes/service/realtime/README.md delete mode 100755 "notes/setup/Apache+mod_jk+tomcat\351\233\206\347\276\244\346\220\255\345\273\272.md" delete mode 100644 notes/strategy/mgmt/README.md create mode 100644 notes/web/dev/biome.md create mode 100644 notes/web/framework/nextjs/nextjs-conf.md diff --git a/notes/ai/ai-awesome.md b/notes/ai/ai-awesome.md index 3110cb78369..3592f6c8a5e 100644 --- a/notes/ai/ai-awesome.md +++ b/notes/ai/ai-awesome.md @@ -27,12 +27,19 @@ tags: - [万能道歉信](https://open-gpt.app/app/clf28gwkx0002l108tvysyb9i) - design/image/ppt - dalle + - https://dalle.party/ + - https://news.ycombinator.com/item?id=38432486 - https://designer.microsoft.com/ - https://pixian.ai/ - Remove Image Backgrounds - https://quickqr.art/ - QR Code Art - https://ideogram.ai/ + - https://github.com/diff-usion/Awesome-Diffusion-Models +- SVG/vector + - https://logodiffusion.com/ + - https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio + --- @@ -128,6 +135,10 @@ tags: - https://makereal.tldraw.com/ - https://github.com/tldraw/make-real - https://www.tldraw.com/ +- [excalidraw/excalidraw](https://github.com/excalidraw/excalidraw) + - text -> diagram +- [OthersideAI/self-operating-computer](https://github.com/OthersideAI/self-operating-computer) + - text -> 电脑自动操作 - https://github.com/Azure/gen-cv/tree/main/avatar/interactive - https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-speech-announces-public-preview-of-text-to-speech/ba-p/3981448 diff --git a/notes/ai/gpt/gpt-awesome.md b/notes/ai/gpt/gpt-awesome.md index 7de6c23d41f..300956e19b1 100644 --- a/notes/ai/gpt/gpt-awesome.md +++ b/notes/ai/gpt/gpt-awesome.md @@ -22,6 +22,8 @@ tags: - OpenAI - https://gptstore.ai/ - https://quail.ink/goldengrape/p/how-to-build-a-patent-gpt +- https://nihalsid.github.io/mesh-gpt/ + - https://news.ycombinator.com/item?id=38448653 ### Reading diff --git a/notes/ai/service/openai/chatgpt-awesome.md b/notes/ai/service/openai/chatgpt-awesome.md index 3aa853ef18b..217335a7fb2 100644 --- a/notes/ai/service/openai/chatgpt-awesome.md +++ b/notes/ai/service/openai/chatgpt-awesome.md @@ -32,6 +32,7 @@ tags: - llama-cpp-python - FastChat + ## WebUI - [Niek/chatgpt-web](https://github.com/Niek/chatgpt-web) @@ -93,3 +94,7 @@ docker run --rm -it \ 1. 流式逐字输出 - 体感更好 1. 一次性输出 - 可能等很久 + +## Reading + +- https://www.youtube.com/watch?v=flXrLGPY3SU diff --git a/notes/ai/stable-diffusion/stable-diffusion-awesome.md b/notes/ai/stable-diffusion/stable-diffusion-awesome.md index 3193f18dd30..c0f2f90029b 100644 --- a/notes/ai/stable-diffusion/stable-diffusion-awesome.md +++ b/notes/ai/stable-diffusion/stable-diffusion-awesome.md @@ -7,10 +7,14 @@ tags: # Stable Diffusion Awesome - [apple/ml-stable-diffusion](https://github.com/apple/ml-stable-diffusion) +- https://github.com/CompVis/latent-diffusion - https://latent-consistency-models.github.io/ - https://www.fal.ai/models/latent-consistency-sd - https://github.com/fal-ai - https://huggingface.co/spaces/fal-ai/realtime-stable-diffusion +- https://stability.ai/news/stability-ai-sdxl-turbo +- [lllyasviel/Fooocus](https://github.com/lllyasviel/Fooocus) +- [Waifu Diffusion 1.3 Release Notes](https://gist.github.com/harubaru/f727cedacae336d1f7877c4bbe2196e1) - [Acly/krita-ai-diffusion](https://github.com/Acly/krita-ai-diffusion) - ComfyUI 作为后端 - https://news.ycombinator.com/item?id=38342670 diff --git a/notes/culture/game/game-awesome.md b/notes/culture/game/game-awesome.md index c11e083f7f6..69d11005114 100644 --- a/notes/culture/game/game-awesome.md +++ b/notes/culture/game/game-awesome.md @@ -39,6 +39,8 @@ https://www.game-game.com.ua/ | Roguelite | - https://store.epicgames.com/en-US/free-games +- [Mzying2001/CefFlashBrowser](https://github.com/Mzying2001/CefFlashBrowser) + - Flash浏览器, Windows ## Nitendo Switch diff --git a/notes/db/relational/mysql/mysql-perf.md b/notes/db/relational/mysql/mysql-perf.md new file mode 100644 index 00000000000..60983907c46 --- /dev/null +++ b/notes/db/relational/mysql/mysql-perf.md @@ -0,0 +1,9 @@ +--- +title: MySQL 性能 +--- + +# MySQL 性能 + +- https://help.aliyun.com/zh/rds/apsaradb-rds-for-mysql/limits +- https://aws.amazon.com/cn/blogs/database/best-practices-for-configuring-parameters-for-amazon-rds-for-mysql-part-1-parameters-related-to-performance/ +- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_BestPractices.html diff --git a/notes/dev/dev-faq.md b/notes/dev/dev-faq.md index 8eb945c0a2b..44355f0c466 100644 --- a/notes/dev/dev-faq.md +++ b/notes/dev/dev-faq.md @@ -10,6 +10,36 @@ tags: - https://www.martinfowler.com/ - https://web.stanford.edu/~ouster/cgi-bin/decisions.php +## profile + +- 面向生命周期 + - 开发、测试、预发布、生产、性能测试 + - dev/test/staging/prod/perf + - local/development/staging/production/testing + - dev/test/staging/prod + - development/test/stage/produciton + - 预发布 - staging/pre/next + - 性能测试 - performance/perf +- 面向环境 + - region + - zone + +--- + +- APP_ENV + - larval - local, production, testing + - https://github.com/laravel/framework/blob/5.8/src/Illuminate/Foundation/Application.php +- NODE_ENV - production, development, test + - https://github.com/kerimdzhanov/dotenv-flow +- SPRING_PROFILES_ACTIVE,spring.profiles.active +- [.NET](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments) + - DOTNET_ENVIRONMENT + - ASPNETCORE_ENVIRONMENT +- NEXT_PUBLIC_VERCEL_ENV, [VERCEL_ENV](https://vercel.com/docs/projects/environment-variables/system-environment-variables) + - production, preview, development +- https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/ + - APP_DOMAIN, APP_URL, APP_ID + ## Roles - 管理岗 @@ -244,7 +274,7 @@ go clean -modcache mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false --fail-at-end gradle clean -ls ~/.nvm/versions/node/v{12,14,16}* -d 2>/dev/null | xargs -n1 basename +ls ~/.nvm/versions/node/v{12,14,16}* -d 2> /dev/null | xargs -n1 basename # for s in $( ls ~/.nvm/versions/node/v{12,14,16}* -d 2>/dev/null | xargs -n1 basename );do echo nvm uninstall $s; done rm -rf ~/.nvm/versions/node/v{12,14,16}* @@ -306,10 +336,10 @@ pip cache purge - 1048576 - Excel 行限制 -- 16,384 +- 16384 - Excel 列限制 -## 关于服务重启导致服务中断问题的说明 +## 关于 K8S 服务重启导致服务中断问题的说明 - 部署使用 startProbe 等到 health 才切换,避免新版本出现问题导致服务启动失败,旧版本服务下线问题 - Java 通常较慢,启动可能 1m 左右 @@ -388,3 +418,16 @@ pip cache purge - data is code - Code=Engine, Data=Fuel - Data 定义了逻辑规则 = Code + +## schema vs validator + +- Schema-First - 模式优先 + - 数据类型定义 + - 通常和类型能一一对应 + - 可以用来做验证,还可以用来生成代码 + - e.g. typebox, typia, jsonschema, ajv +- Validate-First - 验证优先 + - 业务逻辑定义 + - 通常包含额外的处理逻辑 - 功能更多,能自定义处理 + - 通常能生成 Schema - 但是会丢失一些信息且不一定准确 + - e.g. zod diff --git a/notes/dev/dict.md b/notes/dev/dict.md index fe4606e1e61..b21065a59bc 100644 --- a/notes/dev/dict.md +++ b/notes/dev/dict.md @@ -2,6 +2,7 @@ title: 开发用词字典 tags: - Glossary + - FAQ --- # 开发用词字典 @@ -24,6 +25,17 @@ tags: - 尽量使用常见的词汇 - 对于相同含义的词汇跟进场景选用 +:::tip + +- 熟悉和使用 专业术语、行话、Glossary + - 能够更好的沟通 + - 更改更精确的表达含义 + - 本身附带了 “行业” 属性 + - 本身附带了上下文信息 +- 需要注意团队内达成一致 + +::: + ## 俚语 - [bruh](https://www.urbandictionary.com/define.php?term=Bruh) @@ -67,7 +79,7 @@ tags: | introduction | 推荐, 被动, 位于关系被动方
例如: 别人介绍你给我, 由别人产生联系 | | last name | 姓 | | surname | 姓 | -| first anme | 名 | +| first name | 名 | ## 技术词汇 {#tech} @@ -512,18 +524,20 @@ tags: ## business unit vs division vs deparment - 组织架构三层关系 -- business unit - 业务单元 - 例如 出版署 - - 位于某个地点 - - 相对独立的业务单元,可跨组织 +- business unit - 事业部/业务单元 - 例如 出版署 - 侧重独立的业务目标和运营 + - 有自己的目标、战略和运营计划,专注于特定的产品线或市场领域 + - 可能拥有自己的营销、财务、研发等职能部门,相对独立地运作,并针对特定的产品线或市场 - 有自主的管理和利润中心 - 独立业务定位目标 - 按业务目标考核 + - 相对独立的业务单元,可跨组织 + - 位于某个地点 - division - 分部 - 例如 市场分部、消费者分部 - 位于某个地点的某些办公室或者区域 - deparment - 部门 - 例如 编辑部、较对部 - 位于公司某个区域 - - 组织内职能单位 + - 组织内**职能**单位 - 侧重一个领域的职能作用 - 受组织层级管理 - 为组织整体目标服务 @@ -941,6 +955,7 @@ tags: - label - 标签 + - 倾向于正式或预定义的分类 - 可以是 KV 结构 - GitHub 的 Issuse 标签使用的 Label - Gitlab 的 Issuse 标签使用的 Label @@ -951,6 +966,7 @@ tags: - Docker 元数据使用 Label - tag - 标签、标记 + - 表示一种**非正式**的、用户定义的分类方法 - 通常是一串字符串 - Stackoverflow 的问题使用的 Tag @@ -1099,6 +1115,47 @@ tags: - Street Address: - 街道信息 - Physical Address: - 区分电子地址(如电子邮件)和物理地址 +## parse vs resolve vs normalize + +- parse - 解析 - 抽象与结构化 + - 文本 -> 信息/结构化 +- resolve - 确定/解决/解析 - 决策与确定性 + - 处理不确定性、冲突、多重可能性 +- normalize - 标准化/规范化 - 标准化与一致性 + - 数据标准化、数据清洗、统一格式 + +## sort vs order + +- sort + - 排序 - 操作 + - 通常是对一组数据进行排序 + - 例如:sortBy +- order + - 有序 - 定义、规则 + - 通常有序的含义更强 + - 例如:order by + - 可以是多个 OrderRule + +## value vs values vs options vs items vs enums vs data + +- value + - 通常单个值 + - 或者指代 “值” 这个概念 - 因此也可能是数组 +- values + - 多个值 +- options + - 选项 + - 面向界面 +- items + - 项 + - 面向数据 +- enums + - 枚举 + - 面向代码结构定义 +- data + - 数据 + - 没有单数双数概念 + ## 参考 - primary @@ -1114,6 +1171,8 @@ tags: --- +- https://unbug.github.io/codelf/ + - 起名专用 - https://www.dictionary.com/browse/employee?s=t - 查含义和词源 - etymonline.com diff --git a/notes/hardware/peripheral/keyboard.md b/notes/hardware/peripheral/keyboard.md index a5a8f88ed85..fb92b34fdec 100644 --- a/notes/hardware/peripheral/keyboard.md +++ b/notes/hardware/peripheral/keyboard.md @@ -19,6 +19,35 @@ title: 键盘 - WASD CODE MX - Keychron Q2 - Raspberry Pi 400 +- 轴体 + - CHERRY + - TTC +- 键帽 + - ABS - 丙烯腈-丁二烯-苯乙烯 + - 易于成型和染色 + - 质感较光滑,手感较柔软 + - 重量较轻 + - **优势** 便宜、颜色多(易于染色)、光滑手感 + - **缺点** 耐磨性差、不耐用 + - PBT - 聚对苯二甲酸丁二酯 + - 更硬、更密集的塑料材料 + - 质感较粗糙,手感较坚实 + - 耐高温,不易变形 + - **优势** 耐磨性好、耐用、手感更好 + - **缺点** 价格高、颜色少(不易染色) + +:::caution Keychron 问题 + +- 用一段时间后按键不灵 - 可以考虑重置(fn+J+Z 四秒),可以考虑换轴体 + - 目前我 F1、F2、1、2、Q、W、A、S、Z、Option、Command 有点问题 (202311) - 感觉不像是轴体问题 + - Command 粘滞 +- 无线续航时间短 + - 几乎等于没用 +- 无线模式下按键延迟 +- 无线模式自动休眠 +- Command X 没对齐 + +::: :::tip 选型考量 @@ -88,3 +117,9 @@ title: 键盘 | MX Black/黑轴 | - 键程 触发行程 初始压力 触发压力 分段压力 分段行程 触底压力 + +## Keychron 快捷键 + +- Fn + 1-3 - 切换设备 +- fn + J + Z 四秒 - 恢复出厂设置 +- fn + S + O 四秒 - 关闭自动睡眠 diff --git a/notes/mgmt/README.md b/notes/mgmt/README.md new file mode 100644 index 00000000000..f4cf5ce529d --- /dev/null +++ b/notes/mgmt/README.md @@ -0,0 +1,79 @@ +--- +title: 管理 +--- + +# 管理学 + +- 工商管理 - 企业管理学 - 组织管理 + - 战略 + - 财务 + - 市场营销 + - 人力资源 + - 运营 + - 组织行为 + - 国际商务 +- 方向 + - 会计 + - 实体 + - 治理 + - 法规 + - 职务 + - 经济 + - 金融 + - 管理 + - 组织 + - 贸易 + +--- + +- https://www.praxisframework.org/ + +# FAQ + +## 战略管理 vs 运营管理 + +- 战略管理 - Strategic Management - 长期目标、方向、框架ß + - 选择市场 + - 选择产品 + - 选择技术 + - 选择竞争对手 + - 选择合作伙伴 + - 选择组织结构 + - 选择管理风格 + - 选择企业文化 + - 市场定位 + - 产品发展策略 + - 技术创新 + - 竞争策略 + - 战略联盟 + - 组织发展 + - 领导和文化 +- 运营管理 - Operational/Operations Management - 日常执行和效率 + - 资源优化 + - 流程改进 + - 供应链管理 + - 提高效率控制成本 + - 保证产品质量 + - 保证交付期 + - 保证服务质量 + + +## 接龙 + +- Chain Sign-up - 串联报名 +- Sequential Registration - 顺序登记 +- 一种常见于办公环境火社交团体的组织方式 +- 用于 + - 收集信息、意见用于 集体决策 +- 场景 + - 点餐、活动报名、意见收集 +- 工具 + - 微信群 + - Slack + - Google Sheet + - Doole + - Google Form/SurveyMonkey + +--- + +- 类似于 emoji reaction diff --git a/notes/strategy/mgmt/mgmt-faq.md b/notes/mgmt/mgmt-faq.md similarity index 99% rename from notes/strategy/mgmt/mgmt-faq.md rename to notes/mgmt/mgmt-faq.md index 7f0b10aeac9..c106fdee3ad 100644 --- a/notes/strategy/mgmt/mgmt-faq.md +++ b/notes/mgmt/mgmt-faq.md @@ -1,10 +1,9 @@ --- -title: FAQ tags: - FAQ --- -# Mgmt FAQ +# 管理相关常见问题 - 管理的主要职责是沟通、协调 - 管理就像一个系数 diff --git a/notes/strategy/mgmt/pm-awesome.md b/notes/mgmt/pm-awesome.md similarity index 100% rename from notes/strategy/mgmt/pm-awesome.md rename to notes/mgmt/pm-awesome.md diff --git a/notes/strategy/mgmt/pmp/README.md b/notes/mgmt/pmp/README.md similarity index 100% rename from notes/strategy/mgmt/pmp/README.md rename to notes/mgmt/pmp/README.md diff --git a/notes/strategy/mgmt/pmp/pmbok-5th.md b/notes/mgmt/pmp/pmbok-5th.md similarity index 100% rename from notes/strategy/mgmt/pmp/pmbok-5th.md rename to notes/mgmt/pmp/pmbok-5th.md diff --git a/notes/strategy/mgmt/pmp/pmbok-summary.md b/notes/mgmt/pmp/pmbok-summary.md similarity index 100% rename from notes/strategy/mgmt/pmp/pmbok-summary.md rename to notes/mgmt/pmp/pmbok-summary.md diff --git a/notes/strategy/mgmt/pmp/pmbok.md b/notes/mgmt/pmp/pmbok.md similarity index 100% rename from notes/strategy/mgmt/pmp/pmbok.md rename to notes/mgmt/pmp/pmbok.md diff --git a/notes/strategy/mgmt/pmp/pmp-glossary.md b/notes/mgmt/pmp/pmp-glossary.md similarity index 100% rename from notes/strategy/mgmt/pmp/pmp-glossary.md rename to notes/mgmt/pmp/pmp-glossary.md diff --git a/notes/strategy/mgmt/pmp/project-charter.md b/notes/mgmt/pmp/project-charter.md similarity index 100% rename from notes/strategy/mgmt/pmp/project-charter.md rename to notes/mgmt/pmp/project-charter.md diff --git a/notes/strategy/mgmt/pmp/project-management-plan.md b/notes/mgmt/pmp/project-management-plan.md similarity index 100% rename from notes/strategy/mgmt/pmp/project-management-plan.md rename to notes/mgmt/pmp/project-management-plan.md diff --git a/notes/strategy/README.md b/notes/mgmt/strategy/README.md similarity index 100% rename from notes/strategy/README.md rename to notes/mgmt/strategy/README.md diff --git a/notes/strategy/mgmt/tech/cto.md b/notes/mgmt/tech/cto.md similarity index 100% rename from notes/strategy/mgmt/tech/cto.md rename to notes/mgmt/tech/cto.md diff --git a/notes/os/linux/init/systemd.md b/notes/os/linux/init/systemd.md index fe8a2428faa..6938b3a45d4 100644 --- a/notes/os/linux/init/systemd.md +++ b/notes/os/linux/init/systemd.md @@ -1,5 +1,5 @@ --- -id: systemd +title: Systemd --- # Systemd diff --git a/notes/platform/README.md b/notes/platform/README.md index deade3cddc9..e6e3129bad6 100644 --- a/notes/platform/README.md +++ b/notes/platform/README.md @@ -7,6 +7,8 @@ title: 平台 - 云平台 - 系统平台 - 应用平台 +- [Awesome](./platform-awesome.md) +- [FAQ](./platform-faq.md) ## Status diff --git a/notes/platform/apple/apple-faq.md b/notes/platform/apple/apple-faq.md new file mode 100644 index 00000000000..d011b870590 --- /dev/null +++ b/notes/platform/apple/apple-faq.md @@ -0,0 +1,11 @@ +--- +tags: +- FAQ +--- + +# Appale FAQ + + +## Gift Card + +- https://www.apple.com/shop/gift-cards diff --git a/notes/platform/platform-awesome.md b/notes/platform/platform-awesome.md index ecaa59ce28a..edda666db05 100644 --- a/notes/platform/platform-awesome.md +++ b/notes/platform/platform-awesome.md @@ -118,3 +118,8 @@ tags: - 存储=热存储+冷存储+时序存储 - 流量=读+写+索引+时序索引+外网读取 - https://help.aliyun.com/document_detail/259690.html + +## Proxy/VPN + +- [NordVPN](./nordvpn.md) +- ExpressVPN diff --git a/notes/platform/volcengine.md b/notes/platform/volcengine.md new file mode 100644 index 00000000000..b5df929c49a --- /dev/null +++ b/notes/platform/volcengine.md @@ -0,0 +1,8 @@ +--- +title: 火山引擎 +--- + +# 火山引擎 + +- VE - Volcengine +- https://www.volcengine.com/ diff --git a/notes/service/README.md b/notes/service/README.md index 4e26ff006f7..3e5aa446612 100644 --- a/notes/service/README.md +++ b/notes/service/README.md @@ -3,3 +3,6 @@ title: 服务 --- # 服务 + +- [Awesome](./service-awesome.md) +- [FAQ](./service-faq.md) diff --git a/notes/service/api/api-awesome.md b/notes/service/api/api-awesome.md index cec25db26fe..cea436d5cf7 100644 --- a/notes/service/api/api-awesome.md +++ b/notes/service/api/api-awesome.md @@ -191,7 +191,10 @@ tags: - [finagle] - Apache-2.0, Scala - by Twitter -- tRPC +- [tRPC](https://github.com/trpc/trpc) +- [trpc-group/trpc-go](https://github.com/trpc-group/trpc-go) + - 不是 JS 的 tRPC,是腾讯的 RPC +- [Tencent/flare](https://github.com/Tencent/flare) ## Serialization diff --git a/notes/service/api/api-design.md b/notes/service/api/api-design.md index d5abf60d471..13187363f3b 100644 --- a/notes/service/api/api-design.md +++ b/notes/service/api/api-design.md @@ -352,3 +352,46 @@ message BatchCreateUsersResponse { ``` - https://github.com/ent/contrib/blob/1faab982b6648b7704a6cf41ff65d9cb7811a2be/entproto/internal/todo/ent/proto/entpb/entpb.proto + +## 翻页参数 {#pagination} + +- 最终是需要 limit+offset +- 允许用户提供各种输入 + - cursor 不在这个范围内 + +```ts +export function normalizePagination(page: { + pageSize?: number; + pageIndex?: number; + pageNumber?: number; + limit?: number; + offset?: number; +}) { + let { pageSize = 20, pageNumber = 1, pageIndex = pageNumber - 1, limit, offset } = page; + return { + limit: limit || pageSize, + offset: offset ?? pageIndex * pageSize, + }; +} +``` + +## 游标翻页 {#cursor} + +- cursor+limit +- 基本信息 + - id/timestamp + - direction - 方向 + - 默认 `>` - 往后取 +- 可以考虑额外的信息 + - 例如排序字段 + +```ts +interface Cursor { + id: string; + direction: 'asc' | 'desc'; +} +``` + +``` +where id ${direction === 'asc' ? '>' : '<'} ${id} +``` diff --git a/notes/service/erp/erp-glossary.md b/notes/service/erp/erp-glossary.md index 260f2664cde..762928e6c7d 100644 --- a/notes/service/erp/erp-glossary.md +++ b/notes/service/erp/erp-glossary.md @@ -336,3 +336,83 @@ tags: - Prosci ADKAR模型 - Kotter的8步变革过程 + +## Outsourcing Services + +外包服务(Outsourcing Services) + +- 定义:企业将其一部分业务流程或服务需求外包给专业服务公司来处理。 +- 应用:在财务服务领域,可能包括会计处理、税务咨询、薪资管理、审计服务等。 +- 目的:帮助客户企业降低成本、提高效率和专注于其核心业务。 + +--- + +- **质量控制**:确保提供的服务质量符合客户的期望。 +- **客户沟通**:与客户保持良好的沟通,确保服务满足他们的需求和标准。 +- **合规性和保密性**:特别是在财务领域,确保所有服务符合行业规范并严格保密。 + +## OEM + +## BPO + +- 业务流程外包 - Bussiness Process Outsourcing +- 定义:BPO是指企业将某些非核心的业务流程外包给第三方服务提供商。 +- 应用:涉及多种业务流程,包括财务、人力资源、客户服务等。 +- 特点:提供商专注于特定的服务领域,能够提供专业化、效率化的服务。 + +## Status + +- 类似枚举 +- 建议记录对应的 state +- 建议记录可能的下一个状态 status + +```json +{ + "OrderState": [ + { + "value": "Active", + "label": "活跃" + }, + { + "value": "Completed", + "label": "已完成" + }, + { + "value": "Cancelled", + "label": "已取消" + } + ], + "OrderStatus": [ + { + "value": "Pending", + "label": "待处理", + "state": "Active", + "next": ["Processing", "Cancelled"] + }, + { + "value": "Processing", + "label": "处理中", + "state": "Active", + "next": ["Shipped", "Cancelled"] + }, + { + "value": "Shipped", + "label": "已发货", + "state": "Active", + "next": ["Delivered"] + }, + { + "value": "Delivered", + "label": "已交付", + "state": "Completed", + "next": [] + }, + { + "value": "Cancelled", + "label": "已取消", + "state": "Cancelled", + "next": [] + } + ] +} +``` diff --git a/notes/service/file/nextcloud/nextcloud-faq.md b/notes/service/file/nextcloud/nextcloud-faq.md index 2a1dea4b96a..693f91b6207 100644 --- a/notes/service/file/nextcloud/nextcloud-faq.md +++ b/notes/service/file/nextcloud/nextcloud-faq.md @@ -28,6 +28,10 @@ cd /var/www/html ./occ config:system:set simpleSignUpLink.shown --value=false --type=boolean ``` +## 注意 proxy 配置 + +- 如果出现 office 打不开,也可能是开了 proxy 导致无法连接 + ## nextcloud put 413 发生未知错误 diff --git a/notes/service/im/im-awesome.md b/notes/service/im/im-awesome.md index 4250a63fc55..814f9020444 100644 --- a/notes/service/im/im-awesome.md +++ b/notes/service/im/im-awesome.md @@ -36,6 +36,9 @@ tags: - [wildfirechat/im-server](https://github.com/wildfirechat/im-server) - Java - MQTT +- Customer Chat + - [papercups-io/papercups](https://github.com/papercups-io/papercups) + - elixir ## Server diff --git a/notes/service/media/image-awesome.md b/notes/service/media/image-awesome.md index abfc3f60150..26d94cbac8b 100644 --- a/notes/service/media/image-awesome.md +++ b/notes/service/media/image-awesome.md @@ -43,8 +43,11 @@ tags: - ~75% ```bash -curl -LO https://github.com/shssoichiro/oxipng/releases/download/v8.0.0/oxipng-8.0.0-x86_64-apple-darwin.tar.gz -tar zxvf oxipng-8.0.0-x86_64-apple-darwin.tar.gz +brew install oxipng # install by macOS brew + +# install by download binary +curl -LO https://github.com/shssoichiro/oxipng/releases/download/v9.0.0/oxipng-9.0.0-x86_64-apple-darwin.tar.gz +tar zxvf oxipng-9.0.0-x86_64-apple-darwin.tar.gz oxipng -o max -i 0 --strip safe *.png ``` diff --git a/notes/service/observability/logging/logging-format.md b/notes/service/observability/logging/logging-format.md new file mode 100644 index 00000000000..df222998ec6 --- /dev/null +++ b/notes/service/observability/logging/logging-format.md @@ -0,0 +1,172 @@ +--- +title: Logging Format +--- + +# 日志格式 + +:::tip 学习和梳理现有的日志格式 + +- 用于参考设计 - 输出“友好”的日志 +- 用于确定需要在日志里包含什么内容 +- 用于解析日志 + +::: + +- Apache Log +- Common Log - CLF - Common Log Format https://httpd.apache.org/docs/current/logs.html#common + - NCSA Common Log Format +- CEF - Common Event Format +- glog - Google Logging Library +- [klog](https://github.com/kubernetes/klog) - Kubernetes Log +- syslog + - authorization + - /var/log/auth.log - Debian + - /var/log/secure - RHEL +- logfmt + - https://brandur.org/logfmt + - https://pkg.go.dev/github.com/kr/logfmt#section-documentation +- nginx log - nginx access log +- ruby hash - `{"key" => "value"}` +- Graylog Extended Log Format - GELF + - https://graylog.org/features/gelf/ +- Windows Event Log - https://docs.microsoft.com/en-us/windows/win32/wes/windows-event-log +- IIS Log File Format - https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525807(v=vs.90) + - Timestamp + - Client IP + - Server IP + - URI-Stem + - HTTP Status Code + - Bytes Sent + - Bytes Received + - Time Taken + - Version +- ODBC +- W3C Extended Log File Format +- NestJS - https://github.com/nestjs/nest/blob/master/packages/common/services/console-logger.service.ts + +``` +[Nest] 4262 - 2023/12/03 00:20:23 DEBUG [InstanceLoader] MikroOrmModule dependencies initialized +0ms +[Nest] %PID - %Timestamp %Level [%Context] %Message %TimeDiff +``` + +## 结构化 {#structured} + +### APISIX + +- https://apisix.apache.org/docs/apisix/plugins/elasticsearch-logger/ + +```json +{ + "apisix_latency": 0, + "route_id": "1", + "server": { + "version": "2.15.0", + "hostname": "apisix" + }, + "request": { + "size": 102, + "uri": "/elasticsearch.do?q=hello", + "querystring": { + "q": "hello" + }, + "headers": { + "user-agent": "curl/7.29.0", + "host": "127.0.0.1:9080", + "accept": "*/*" + }, + "url": "http://127.0.0.1:9080/elasticsearch.do?q=hello", + "method": "GET" + }, + "service_id": "", + "latency": 0, + "upstream": "127.0.0.1:1980", + "upstream_latency": 1, + "client_ip": "127.0.0.1", + "start_time": 1661170929107, + "response": { + "size": 192, + "headers": { + "date": "Mon, 22 Aug 2022 12:22:09 GMT", + "server": "APISIX/2.15.0", + "content-type": "text/plain; charset=utf-8", + "connection": "close", + "transfer-encoding": "chunked" + }, + "status": 200 + } +} +``` + +## 参考 {#reference} + +- syntax + - re2 + - kv + - CSV + - JSON + - grok - https://github.com/daschl/grok/tree/master/patterns + - xml + - timestamp +- https://vector.dev/docs/reference/vrl/functions/#parse_syslog + - vrl `parse_*` +- https://graylog.org/post/log-formats-a-complete-guide/ +- https://www.crowdstrike.com/cybersecurity-101/observability/log-file-formats/ + +## UserAgent + +- 浏览器 UserAgen 包含相当多的信息,格式也可以作为参考 +- 如果使用相同的格式,解析工具可以复用 +- 嵌入式 WebView 的时候通常也包含自己的信息 + - 例如: 微信、企业微信 等 + +``` +Mozilla Firefox 1.0.1 Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.6) Gecko/20050223 Firefox/1.0.1 +``` + +```json +{ + "browser": { + "family": "Internet Explorer", + "version": "7.66" + }, + "device": { + "category": "pc" + }, + "os": { + "family": "Windows XP", + "version": "NT 5.1" + } +} +``` + +**进一步解析** + +``` +Opera/9.80 (J2ME/MIDP; Opera Mini/4.3.24214; iPhone; CPU iPhone OS 4_2_1 like Mac OS X; AppleWebKit/24.783; U; en) Presto/2.5.25 Version/10.54 +``` + +```json +{ + "browser": { + "family": "Opera Mini", + "major": "4", + "minor": "3", + "patch": "24214", + "version": "10.54" + }, + "device": { + "brand": "Apple", + "category": "smartphone", + "family": "iPhone", + "model": "iPhone" + }, + "os": { + "family": "iOS", + "major": "4", + "minor": "2", + "patch": "1", + "patch_minor": null, + "version": "4.2.1" + } +} +``` diff --git a/notes/service/office/collabora.md b/notes/service/office/collabora.md index 1bdadb81257..640f70bb10b 100644 --- a/notes/service/office/collabora.md +++ b/notes/service/office/collabora.md @@ -50,6 +50,9 @@ docker cp collabora:/etc/loolwsd/loolwsd.xml loolwsd.xml ## coolmount: Operation not permitted +- cap_add: MKNOD +- cap_add: SYS_ADMIN + ## Explore The New Version - 将 /usr/share/coolwsd/browser/dist/welcome 挂载为空目录 diff --git a/notes/service/realtime/README.md b/notes/service/realtime/README.md new file mode 100644 index 00000000000..50f0eb5ee70 --- /dev/null +++ b/notes/service/realtime/README.md @@ -0,0 +1,7 @@ +--- +title: Realtime +--- + +# Reatime + +- [Awesome](./realtime-awesome.md) diff --git a/notes/service/service-awesome.md b/notes/service/service-awesome.md index 543912d9489..5193a8bffda 100644 --- a/notes/service/service-awesome.md +++ b/notes/service/service-awesome.md @@ -381,6 +381,16 @@ tags: - [maplibre](https://github.com/maplibre) - serverless/event driven - [triggerdotdev/trigger.dev](https://github.com/triggerdotdev/trigger.dev) +- IPTV/Radio + - [YueChan/Live](https://github.com/YueChan/Live) +- PM + - Jira + - [makeplane/plane](https://github.com/makeplane/plane) + - AGPLv3, Python, Typescript + - [zentao](./forge/zentao.md) + - Kanban + - Trello + - Linear ## Avatar diff --git a/notes/service/service-faq.md b/notes/service/service-faq.md index 36fef5c3e59..97f7f9f15de 100644 --- a/notes/service/service-faq.md +++ b/notes/service/service-faq.md @@ -16,4 +16,10 @@ tags: - Serverless - 侧重代码、runtime、ingress、webhook - 事件驱动应用 + - 可能运行 job, cron task, event handler, webhook, delay task, long running server - 特点:按需部署、按时长计费、无状态、无运维、可视化和监控 + +--- + +- https://serverlessworkflow.io/ + - [serverlessworkflow/specification](https://github.com/serverlessworkflow/specification) diff --git "a/notes/setup/Apache+mod_jk+tomcat\351\233\206\347\276\244\346\220\255\345\273\272.md" "b/notes/setup/Apache+mod_jk+tomcat\351\233\206\347\276\244\346\220\255\345\273\272.md" deleted file mode 100755 index 9da3ebfafab..00000000000 --- "a/notes/setup/Apache+mod_jk+tomcat\351\233\206\347\276\244\346\220\255\345\273\272.md" +++ /dev/null @@ -1,211 +0,0 @@ - -[toc] - -计划方案 -------- - -### 环境 - -* 四台主机: cloud01,cloud02,cloud03,cloud04 -* OS: CentOS 6.5 -* Tomcat安装位置: `/opt/tomcat` - -### 集群方案 - -* cloud02 cloud03 cloud04 为 tomcat 节点 -* cloud01 上的 apache 做负载均衡 -* 端口均使用标准端口, 因为是部署在不同的机器上 - -安装 Apache ---------- -``` -yum install httpd -# 完成后 需要在 /etc/httpd/conf/httpd.conf 中添加一句 -# ServerName localhost -``` - -如果想要使用 `apachectl status` 命令 需要 elinks `yum install elinks -y` 和 mod_status, 一般 mode_status 是默认加载的,但是还要一点配置. - -在 httpd.conf 中添加如下配置 -``` -ExtendedStatus on - - # Allow server status reports generated by mod_status, - # with the URL of http://servername/server-status - # Change the ".example.com" to match your domain to enable. - # - - SetHandler server-status - Order deny,allow - Allow from all - - -``` -如果配置后还有 /server/status 错误, 参考[这里](http://www.mydigitallife.info/request-url-server-status-or-404-page-not-found-apache-error/) - - -编译/配置 mod_jk --------------- - -### 编译 mod_jk -``` -# 使用的时候最新版本为 1.2.40 -# 可以查看其他版本 http://www.apache.org/dist/tomcat/tomcat-connectors/jk/ -# 这里有点扯淡的是 1.2.40的脚本都是 dos 格式的, 需要先 dos2unix -# 所以我直接换了个版本 使用的 1.2.39 的, 代码格没问题 - -wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.39-src.zip -unzip tomcat-connectors*.zip -cd tomcat-connectors* -cd native -yum install -y httpd-devel -./configure --with-apxs=/usr/sbin/apxs -make -make install -``` - -### 配置 mod_jk.conf -新建 `/etc/httpd/conf/mod_jk.conf`, 写入如下内容 -``` -# 加载mod_jk Module -# /usr/lib64/httpd/modules/mod_jk.so -LoadModule jk_module modules/mod_jk.so - -# 指定workers.properties文件路径 -JkWorkersFile conf/workers.properties - -# 指定那些请求交给tomcat处理 -# "controller"为在workers.propertise里指定的负载分配控制器名 -JkMount /* controller -``` - -### 配置 workers.properties -新建 `/etc/httpd/conf/workers.properties`, 写入如下内容 -``` -#server -worker.list = controller -#========cloud03======== -#ajp13端口号,在tomcat下server.xml配置,默认 8009 -worker.cloud03.port=8009 - -#tomcat的主机地址,如不为本机,请填写ip地址 -worker.cloud03.host=cloud03 - -#协议类型 -worker.cloud03.type=ajp13 - -# server的加权比重,值越高,分得的请求越多。 -# lbfactor是负载平衡因数(Load Balance Factor) -worker.cloud03.lbfactor=1 - -#========cloud02======== -worker.cloud02.port=8009 -worker.cloud02.host=cloud02 -worker.cloud02.type=ajp13 -worker.cloud02.lbfactor=1 - -#========cloud04======== -worker.cloud04.port=8009 -worker.cloud04.host=cloud04 -worker.cloud04.type=ajp13 -worker.cloud04.lbfactor=1 - -#========controller,负载均衡控制器======== -#负载均衡控制器类型,lbfactor是负载平衡因数(Load Balance Factor) -worker.controller.type=lb - -#指定分担请求的tomcat列表 -worker.controller.balanced_workers=cloud03,cloud02,cloud04 - -# 粘性session(默认是打开的) -# 当该属性值=true(或1)时,代表session是粘性的, -# 即同一session在集群中的同一个节点上处理, -# session不跨越节点。在集群环境中,一般将该值设置为false -worker.controller.sticky_session=false - -# 设置用于负载均衡的server的session可否共享 -worker.controller.sticky_session_force=1 -``` - -### 修改 httpd.conf -修改`/etc/httpd/conf/httpd.conf`,在最后添加: -``` -Include conf/mod_jk.conf -``` - -配置 tomcat ----------- -安装 tomcat 只需要下载解压就可以了, 没什么特殊的.以下的配置都是在 `server.xml` 中进行的. 该配置文件在 tomcat 安装目录中 conf 目录下. - -搜索 Engine 节点, 添加 `jvmRoute` 属性为之前 `worker.properties` 配置的名字.因为我在配置 `worker.propertis` 时都是使用的主机名,所以 `cloud02` 修改后就是 -``` - -``` -cloud03, cloud04 也这样修改. - -然后在 `` 前, 加入如下内容. -``` - - - - - - - - - - - - - - - - - - - - - - -``` - -启动集群 -------- - -``` -# 在 cloud01 中操作 -ssh cloud01 -# 启动 apache 需要 root 权限 -sudo apachectl restart -# 启动所有节点 -# 注意: 下面 tomcat 的路径需要根据个人的安装来修改 -for i in $(echo 02 03 04); -do - ssh "cloud$i" /opt/tomcat/bin/startup.sh; -done; - -# 查看运行状态, 确保有 BootStrap 进程 -for i in $(echo 02 03 04); do echo ====$i====;ssh "cloud$i" jps; done; -``` - -集群配置完成后可以通过刷新 http://cloud01/manager/status 这个页面, 观察 IP address 来判断是否成功. - -其他 ----- -有的 tomcat 配置提到 ``, 该类在 tomcat8 中已经移除了.参看[这里](http://tomcat.apache.org/tomcat-8.0-doc/changelog.html#Tomcat_8.0.0_(markt)/Cluster). - diff --git a/notes/strategy/mgmt/README.md b/notes/strategy/mgmt/README.md deleted file mode 100644 index ee30a6aee0b..00000000000 --- a/notes/strategy/mgmt/README.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: 管理 ---- - -# 管理 - -- https://www.praxisframework.org/ diff --git a/notes/web/dev/biome.md b/notes/web/dev/biome.md new file mode 100644 index 00000000000..b7878512d79 --- /dev/null +++ b/notes/web/dev/biome.md @@ -0,0 +1,72 @@ +--- +title: biome +--- + +# biome + +- [biomejs/biome](https://github.com/biomejs/biome) + - MIT, Rust + - linter, formatter + - roma -> biome +- 参考 + - https://biomejs.dev/blog/biome-wins-prettier-challenge/ + +:::tip + +- lint 单个规则 https://github.com/biomejs/biome/issues/58 + +::: + +```bash +brew install biome # by macOS Brew +pnpm add -Dw @biomejs/biome # add to Project + +# check=lint+format +npx biome check ./src # 如果安装了 @biomejs/biome + +npx biome start # daemon +time npx biome check ./src --use-server # 一般项目 user 快 0.2s + +# 如果没安装 @biomejs/biome +npx @biomejs/biome check ./src +npx @biomejs/biome check ./src --apply +``` + +**biome.json** + +```json +{ + "javascript": { + "parser": { + "unsafeParameterDecoratorsEnabled": true + } + }, + "formatter": { + "enabled": false + }, + "organizeImports": { + "enabled": false + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noExplicitAny": "off", + "noShadowRestrictedNames": "off", + "noAssignInExpressions": "off" + }, + "style": { + "useConst": "off", + "noNonNullAssertion": "warn", + "noUnusedTemplateLiteral": "off", + "noParameterAssign": "off" + }, + "complexity": { + "noBannedTypes": "off", + "noStaticOnlyClass": "off" + } + } + } +} +``` diff --git a/notes/web/dev/hono.md b/notes/web/dev/hono.md index 1ac4c5a3724..19b1504796f 100644 --- a/notes/web/dev/hono.md +++ b/notes/web/dev/hono.md @@ -22,7 +22,7 @@ title: Hono - https://ultrajs.dev/ React ```bash -npm add hono @hono/node-server @hono/zod-openapi +npm add hono @hono/node-server @hono/zod-openapi @hono/trpc-server ``` ```ts @@ -32,11 +32,30 @@ import { Hono } from 'hono'; const app = new Hono(); app.get('/', (c) => c.text('Hono meets Node.js')); +// for NodeJS serve(app, (info) => { console.log(`Listening on http://localhost:${info.port}`); // Listening on http://localhost:3000 }); ``` +```ts +// for tRPC + +import { trpcServer } from '@hono/trpc-server'; +import { appRouter } from './router'; + +const app = new Hono(); + +app.use( + '/trpc/*', + trpcServer({ + router: appRouter, + }), +); + + +``` + ## html 1. 配置 tsconfig diff --git a/notes/web/favicon.md b/notes/web/favicon.md index 0446a4f58ae..3590f32459f 100644 --- a/notes/web/favicon.md +++ b/notes/web/favicon.md @@ -24,6 +24,17 @@ title: favicon ``` +```bash +#convert favicon.svg -resize 64 favicon.png +convert favicon.svg -define icon:auto-resize=64,48,32,16 favicon.ico + +brew install librsvg +rsvg-convert -h 128 -w 128 --keep-aspect-ratio --background-color=none favicon.svg > favicon.png +cp favicon.png in.png +convert in.png -gravity center -background transparent -extent 128x128 favicon.png +oxipng -o max -i 0 --strip safe *.png +``` + ## dark 1. svg style 控制 diff --git a/notes/web/framework/nextjs/README.md b/notes/web/framework/nextjs/README.md index 328604e01fc..4dda49ea709 100644 --- a/notes/web/framework/nextjs/README.md +++ b/notes/web/framework/nextjs/README.md @@ -4,6 +4,17 @@ title: NextJS # NextJS +:::caution + +- NextJS 的构建相当复杂 - lambda、server action、pages、app + - dev 能运行,build 后可能又无法运行 +- 不要用于后端太重的场景 + - 构建会遇到各种问题 + - 前后端 Refresh 的频度不一样 - 后端 refresh 时慢 + +::: + + - [vercel/next.js](https://github.com/vercel/next.js) - 页面自定义 - [默认特殊页面内容](https://github.com/zeit/next.js/tree/master/packages/next/pages) @@ -58,7 +69,7 @@ title: NextJS - 无法按页面切分 CSS - 最终会生成单个 css 文件 - 只有 `_app` 可以导入全局 css -- 单一 HTML 入口 - 不像 vite 支持多入口 +- ~~单一 HTML 入口 - 不像 vite 支持多入口~~ - rewrites 会在 build 时生成 router-manifest, 因此 start 时配置的变量 **无法** 产生影响 - ESM 使用还有问题 - 目前 main 最好还是指向 cjs diff --git a/notes/web/framework/nextjs/nextjs-conf.md b/notes/web/framework/nextjs/nextjs-conf.md new file mode 100644 index 00000000000..d579d325a84 --- /dev/null +++ b/notes/web/framework/nextjs/nextjs-conf.md @@ -0,0 +1,8 @@ +--- +tags: Configuration +--- + +# NextJS Conf + +- optimizePackageImports + - @mui/icons-material, @mui/material, date-fns, lodash, lodash-es, react-bootstrap, @headlessui/react, @heroicons/react, lucide-react diff --git a/notes/web/framework/nextjs/nextjs-faq.md b/notes/web/framework/nextjs/nextjs-faq.md index b87796c646b..72e7a930b5a 100644 --- a/notes/web/framework/nextjs/nextjs-faq.md +++ b/notes/web/framework/nextjs/nextjs-faq.md @@ -507,7 +507,7 @@ NextJS ssr 不支持 React.lazy NODE_OPTIONS=--experimental-specifier-resolution=node ``` -## process.env.NEXT_PHASE +## process.env.NEXT_PHASE ```bash export const PHASE_EXPORT = 'phase-export' @@ -521,3 +521,22 @@ export const PHASE_INFO = 'phase-info' - https://github.com/vercel/next.js/blob/2de45693a9207c040dcc0f1a1d1a4f44431170e2/packages/next/src/shared/lib/constants.ts#L23-L28 ## Failed to find Server Action. This request might be from an older or newer deployment. + +## await isn't allowed in non-async function + +- NextJS 14, Server Action + +``` +await __webpack_async_dependencies__ +``` + +- https://github.com/vercel/next.js/discussions/57535 + +```js +const config = { + experimental: { + // https://github.com/vercel/next.js/discussions/57535 + esmExternals: false, + }, +}; +``` diff --git a/notes/web/framework/nextjs/nextjs-internal.md b/notes/web/framework/nextjs/nextjs-internal.md index 2badc934125..be3432ffb2c 100644 --- a/notes/web/framework/nextjs/nextjs-internal.md +++ b/notes/web/framework/nextjs/nextjs-internal.md @@ -61,13 +61,13 @@ start({dir}, port, args['--hostname']) - 使用自定义 server 则不需要 next start ```js -const {createServer} = require('http'); -const {parse} = require('url'); +const { createServer } = require('http'); +const { parse } = require('url'); const next = require('next'); const port = parseInt(process.env.PORT, 10) || 3000; const dev = process.env.NODE_ENV !== 'production'; -const app = next({dev}); +const app = next({ dev }); const handle = app.getRequestHandler(); app.prepare().then(() => { diff --git a/notes/web/react/react-awesome.md b/notes/web/react/react-awesome.md index b07f74c2738..70e31f3be5f 100644 --- a/notes/web/react/react-awesome.md +++ b/notes/web/react/react-awesome.md @@ -544,7 +544,7 @@ npm add date-fns lodash-es react-fast-compare - Inside - 例如 useState, jotai, recoil - 面向 React - 组件、上下文、Tree -- Outside - 例如 zustand, voltio +- Outside - 例如 zustand, voltio/mobx - 面向 数据/状态 - 函数、全局、跨组件 - 优势 - 框架无关 diff --git a/notes/web/script/js/js-awesome.md b/notes/web/script/js/js-awesome.md index b8bfcbe4111..e2fb9825001 100644 --- a/notes/web/script/js/js-awesome.md +++ b/notes/web/script/js/js-awesome.md @@ -928,6 +928,10 @@ go install github.com/cryogenicplanet/depp@latest # .depp/config.json depp init depp + +npx -y publint + +npx -y @biomejs/biome check ./src ``` ## Reading diff --git a/notes/web/script/js/js-version.md b/notes/web/script/js/js-version.md index 44bce7ce4d9..f436052c28b 100644 --- a/notes/web/script/js/js-version.md +++ b/notes/web/script/js/js-version.md @@ -75,11 +75,12 @@ tags: ::: -| syntax | Chrome | Name | -| ------ | -------- | ----------------------------- | -| `?.` | Chrome80 | Optional chaining | -| `??` | Chrome80 | Nullish coalescing operator | -| `??=` | Chrome85 | Nullish coalescing assignment | +| syntax | Chrome | Name | +| ------- | -------- | ----------------------------- | +| `?.` | Chrome80 | Optional chaining | +| `??` | Chrome80 | Nullish coalescing operator | +| `??=` | Chrome85 | Nullish coalescing assignment | +| `#name` | Chrome74 | Private class fields | - es5 和 es6 是一个分界线 - 2018 年所有浏览器支持 es6 diff --git a/notes/web/style/daisy.md b/notes/web/style/daisy.md index 1264700d6e6..daaf7164e96 100644 --- a/notes/web/style/daisy.md +++ b/notes/web/style/daisy.md @@ -52,3 +52,34 @@ title: daisy - --rounded-box: 1rem; - --rounded-btn: .5rem; - --rounded-badge: 1.9rem; + +# Version + +- https://daisyui.com/docs/changelog/ + +## DaisyUI v4 + +- 颜色类型调整 hsl -> oklch + - `hsl(var(--p))` -> `oklch(var(--p))` + - Chrome/Edge 111+, Safari 15.4+, Firefox 113+ +- 颜色调整 + - 移除 `*-focus` - 之前只用于 button + - `bg-[color-mix(in_oklab,oklch(var(--p)),black)]` + - darker 使用 `color-mix` +- 默认支持 rlt + - `` + - https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values +- 组件调整 + - tab 的 item 不需要重复 `tab` + - tabs 使用 flex -> grid + - button + - 不默认大写 +- 新组件 + - timeline + - skeleton + - diff + - theme-controller +- 新主题 + - Dim + - Nord + - Sunset