1 Commits

Author SHA1 Message Date
bc281b6180 chore(deps): update dependency @cloudflare/vite-plugin to v1.16.1
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Failing after 1m50s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-12-18 02:52:08 +08:00
11 changed files with 662 additions and 912 deletions

View File

@@ -1,31 +1,65 @@
{
"image": "ghcr.io/yanhao98/h-devcontainer:main",
"runArgs": [
"--hostname=devcontainer-host",
"--name=${localWorkspaceFolderBasename}-devcontainer"
],
"forwardPorts": [4730, 4731, 5901],
"runArgs": ["--name=${localWorkspaceFolderBasename}-devcontainer"],
"forwardPorts": [4730, 4731], // vscode://settings/remote.localPortHost -> 默认只监听 localhost
"portsAttributes": {
"4730": { "label": "开发服务器端口", "onAutoForward": "notify" },
"4731": { "label": "预览服务器端口", "onAutoForward": "notify" }
},
"remoteEnv": {
"ANTHROPIC_AUTH_TOKEN": "${localEnv:ANTHROPIC_AUTH_TOKEN}",
"ANTHROPIC_BASE_URL": "${localEnv:ANTHROPIC_BASE_URL}",
"GEMINI_API_KEY": "${localEnv:GEMINI_API_KEY}",
"GOOGLE_GEMINI_BASE_URL": "${localEnv:GOOGLE_GEMINI_BASE_URL}"
},
"containerEnv": {
"NODE_OPTIONS": "--max-old-space-size=4096",
"TZ": "${localEnv:TZ:Asia/Shanghai}"
},
"customizations": {
"vscode": {
"extensions": ["prettier.prettier-vscode", "vue.volar"],
"extensions": [
// AI
"github.copilot-chat",
"anthropic.claude-code",
"google.gemini-cli-vscode-ide-companion",
"vicanent.gcmp",
// >>>>>
// "eamodio.gitlens",
"tu6ge.naive-ui-intelligence",
"gruntfuggly.todo-tree",
"lokalise.i18n-ally",
"vitest.explorer",
"antfu.unocss",
"vue.volar",
// <<<<<
// 代码质量 / 格式化 / Lint
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"oxc.oxc-vscode",
"esbenp.prettier-vscode"
],
"settings": {
// "tasks": { "version": "2.0.0", "tasks": [] },
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes a lightweight Fluxbox based desktop that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS Code terminal will open on the desktop automatically."
}
]
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"chat.extensionUnification.enabled": true,
"chat.tools.terminal.autoApprove": {
"/.*/": true,
"git push": false
},
// * 尽管使用了“/.*/”,但有些还是会失败,因为有几个错误的默认值:
// * https://github.com/microsoft/vscode/issues/266651#issuecomment-3292581459
"chat.tools.terminal.ignoreDefaultAutoApproveRules": true,
"tasks": { "version": "2.0.0", "tasks": [] },
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"mounts": [
// 不挂载还可能会遇到:`Cannot run macOS (Mach-O) executable in Docker: Exec format error`
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
"source=${localWorkspaceFolder}/.devcontainer/lifecycle-scripts.d,target=/usr/local/etc/lifecycle-scripts.d,type=bind,consistency=delegated"
],
@@ -35,5 +69,7 @@
"updateContentCommand": "/usr/local/bin/run-lifecycle-scripts.sh updateContentCommand",
"postCreateCommand": "/usr/local/bin/run-lifecycle-scripts.sh postCreateCommand",
"postStartCommand": "/usr/local/bin/run-lifecycle-scripts.sh postStartCommand",
"postAttachCommand": "/usr/local/bin/run-lifecycle-scripts.sh postAttachCommand"
"postAttachCommand": "/usr/local/bin/run-lifecycle-scripts.sh postAttachCommand",
"waitFor": "updateContentCommand",
"remoteUser": "usr_vscode"
}

View File

@@ -0,0 +1,13 @@
#!/bin/zsh -eu
# 打印带有颜色的欢迎信息
echo -e "\033[1;32m↘ 容器首次创建!\033[0m"
# 修复权限问题(比如 node_modules 目录)
sudo chown -R $(whoami):$(whoami) /workspaces || true
# 调用内置命令 (这些命令在 _build-context/builtin-scripts 目录中的脚本中定义)
h-setup-locale
h-setup-zsh
h-setup-bun-bin
h-setup-pnpm-bin

View File

@@ -0,0 +1,13 @@
#!/bin/bash -eu
# 容器内容更新时的消息和依赖安装
echo '↘️ 容器内容已更新!'
# 安装依赖
if command -v pnpm >/dev/null 2>&1; then
# 跳过: The modules directory at "/workspaces/h-devcontainers/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ·
time pnpm install --config.confirmModulesPurge=false
else
echo '❌错误: pnpm 未安装'
exit 0
fi

View File

@@ -1,14 +0,0 @@
#!/bin/zsh -eu
h-setup-zh-locale
h-setup-bun-bin
h-setup-pnpm-bin
h-setup-chromium
h-setup-desktop-lite
h-install-node-modules
echo "-----------------------------"
echo "开发容器已启动并配置完成!"
echo "-----------------------------"

View File

@@ -5,7 +5,7 @@
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"oxc.oxc-vscode",
"prettier.prettier-vscode",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint",
"lokalise.i18n-ally"
]

10
.vscode/settings.json vendored
View File

@@ -32,18 +32,18 @@
"scss.lint.unknownAtRules": "ignore",
"css.lint.unknownAtRules": "ignore",
"less.lint.unknownAtRules": "ignore",
"editor.defaultFormatter": "prettier.prettier-vscode",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// ============================================================

View File

@@ -1,4 +1,4 @@
{
"extends": "@tsconfig/node24/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"include": ["./**/*"]
}

View File

@@ -57,7 +57,7 @@
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@formkit/auto-animate": "^0.9.0",
"@pinia/colada": "^0.21.0",
"@pinia/colada": "^0.18.0",
"@primeuix/themes": "^2.0.0",
"@sa/materials": "workspace:*",
"@unhead/vue": "^2.0.19",
@@ -93,7 +93,7 @@
"@stylelint-types/stylelint-order": "^7.0.0",
"@stylelint-types/stylelint-scss": "^6.11.0",
"@stylistic/eslint-plugin": "^5.6.1",
"@tsconfig/node24": "^24.0.0",
"@tsconfig/node22": "^22.0.5",
"@types/html-minifier-terser": "^7.0.2",
"@types/jsdom": "^27.0.0",
"@types/lodash-es": "^4.17.12",
@@ -112,7 +112,7 @@
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsonc": "^2.21.0",
"eslint-plugin-oxlint": "~1.32.0",
"eslint-plugin-perfectionist": "^5.0.0",
"eslint-plugin-perfectionist": "^4.15.1",
"eslint-plugin-playwright": "^2.3.0",
"eslint-plugin-vue": "~10.6.0",
"happy-dom": "^20.0.10",
@@ -125,7 +125,7 @@
"nprogress": "^0.2.0",
"oxlint": "~1.29.0",
"postcss-html": "^1.8.0",
"prettier": "3.8.0",
"prettier": "3.7.4",
"rollup": "^4.53.3",
"sass-embedded": "^1.93.3",
"sharp": "^0.34.5",
@@ -134,7 +134,7 @@
"stylelint-config-standard": "^39.0.1",
"stylelint-config-standard-scss": "^16.0.0",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-define-config": "^17.0.0",
"stylelint-define-config": "^16.24.0",
"svgo": "^4.0.0",
"tinyglobby": "^0.2.15",
"type-fest": "^5.2.0",

1446
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node24/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",