oh-my-devpod 0.15.7 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  This package contains the complete `oh-my-devpod` runtime bundle and exposes
4
4
  the `omd` command.
5
5
 
6
- Supported host:
6
+ Supported hosts:
7
7
 
8
- - Ubuntu 24.04
9
- - Linux x64
8
+ - Ubuntu 22.04, 24.04, and 26.04
9
+ - Linux x64 (x86_64)
10
10
  - glibc
11
11
  - Node.js 18 or newer
12
12
 
package/lib/platform.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  const fs = require("node:fs");
4
+ const ubuntuVersions = ["22.04", "24.04", "26.04"];
5
+ const supportedUbuntu = "Ubuntu 22.04, 24.04, and 26.04";
4
6
 
5
7
  function parseOsRelease(contents) {
6
8
  const values = {};
@@ -50,7 +52,7 @@ function currentPlatform() {
50
52
  function validatePlatform(info) {
51
53
  if (info.platform !== "linux") {
52
54
  throw new Error(
53
- `unsupported platform ${info.platform}; oh-my-devpod requires Ubuntu 24.04 on Linux x64/glibc`,
55
+ `unsupported platform ${info.platform}; oh-my-devpod requires ${supportedUbuntu} on Linux x64/glibc`,
54
56
  );
55
57
  }
56
58
  if (info.arch !== "x64") {
@@ -66,9 +68,9 @@ function validatePlatform(info) {
66
68
 
67
69
  const id = info.osRelease.ID || "unknown";
68
70
  const version = info.osRelease.VERSION_ID || "unknown";
69
- if (id !== "ubuntu" || version !== "24.04") {
71
+ if (id !== "ubuntu" || !ubuntuVersions.includes(version)) {
70
72
  throw new Error(
71
- `unsupported Linux distribution ${id} ${version}; oh-my-devpod requires Ubuntu 24.04`,
73
+ `unsupported Linux distribution ${id} ${version}; oh-my-devpod requires ${supportedUbuntu}`,
72
74
  );
73
75
  }
74
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-devpod",
3
- "version": "0.15.7",
3
+ "version": "0.16.0",
4
4
  "description": "Ubuntu productivity tool manager with the omd terminal interface",
5
5
  "license": "MIT",
6
6
  "author": "zhangdw156",
package/runtime/VERSION CHANGED
@@ -1 +1 @@
1
- 0.15.7
1
+ 0.16.0
package/runtime/bin/omd CHANGED
Binary file
@@ -3,6 +3,7 @@ set -euo pipefail
3
3
 
4
4
  source_dir="${OHMYDEVPOD_LAZYVIM_SOURCE_DIR:-/opt/vendor/nvim/lazyvim-starter}"
5
5
  overlay_dir="${OHMYDEVPOD_NVM_OVERLAY_DIR:-}"
6
+ plugin_archive="${OHMYDEVPOD_LAZYVIM_PLUGIN_ARCHIVE:-}"
6
7
  config_dir="${OHMYDEVPOD_NVM_CONFIG_DIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/nvim}"
7
8
  data_dir="${OHMYDEVPOD_NVM_DATA_DIR:-${XDG_DATA_HOME:-${HOME}/.local/share}/nvim}"
8
9
  state_dir="${OHMYDEVPOD_NVM_STATE_DIR:-${XDG_STATE_HOME:-${HOME}/.local/state}/nvim}"
@@ -18,6 +19,19 @@ if [[ ! -d "${source_dir}" ]]; then
18
19
  exit 1
19
20
  fi
20
21
 
22
+ if [[ -n "${plugin_archive}" ]]; then
23
+ plugin_dir="$(dirname "${plugin_archive}")"
24
+ [[ "$(basename "${plugin_archive}")" == "plugins.tar.gz" &&
25
+ -f "${plugin_dir}/plugins.lock.json" ]] || {
26
+ echo "Missing or invalid LazyVim plugin bundle" >&2
27
+ exit 1
28
+ }
29
+ (cd "${plugin_dir}" && sha256sum -c SHA256SUMS) || {
30
+ echo "LazyVim plugin archive verification failed" >&2
31
+ exit 1
32
+ }
33
+ fi
34
+
21
35
  if [[ -z "${starter_commit}" && -f "${source_dir}/.oh-my-devpod-source-commit" ]]; then
22
36
  starter_commit="$(<"${source_dir}/.oh-my-devpod-source-commit")"
23
37
  fi
@@ -52,6 +66,11 @@ cp -R "${source_dir}" "${config_dir}"
52
66
  if [[ -n "${overlay_dir}" && -d "${overlay_dir}" ]]; then
53
67
  cp -R "${overlay_dir}/." "${config_dir}"
54
68
  fi
69
+ if [[ -n "${plugin_archive}" ]]; then
70
+ mkdir -p "${config_dir}/.omd-plugins"
71
+ tar -xzf "${plugin_archive}" -C "${config_dir}/.omd-plugins"
72
+ cp "${plugin_dir}/plugins.lock.json" "${config_dir}/.omd-plugins/plugins.lock.json"
73
+ fi
55
74
  rm -rf "${config_dir}/.git"
56
75
  rm -f "${config_dir}/.oh-my-devpod-source-commit"
57
76
 
@@ -28,8 +28,16 @@ real_brew="${prefix}/bin/brew"
28
28
  stable_gateway="${libexec_dir}/brew-gateway"
29
29
  lock_file="${state_dir}/locks/mutation.lock"
30
30
  brew_noninteractive=0
31
+ inventory_snapshot=""
31
32
  declare -a forwarded_env=()
32
33
 
34
+ cleanup() {
35
+ [[ -z "${inventory_snapshot}" ]] || rm -f "${inventory_snapshot}"
36
+ }
37
+ trap cleanup EXIT
38
+ trap 'exit 130' INT
39
+ trap 'exit 143' TERM
40
+
33
41
  fail() {
34
42
  printf 'brew: shared Linuxbrew gateway: %s\n' "$*" >&2
35
43
  exit 1
@@ -291,9 +299,11 @@ run_backend() {
291
299
  validate_inventory_records
292
300
  home="$(service_home "$(service_user)")"
293
301
  prepare_backend_working_directory "${home}"
294
- before="${state_dir}/.inventory-before.$$"
295
302
  if is_inventory_mutation "${1:-}"; then
296
303
  mutates=1
304
+ before="$(mktemp "${inventory_dir}/.inventory-before.XXXXXX")" ||
305
+ fail "cannot create shared inventory snapshot"
306
+ inventory_snapshot="${before}"
297
307
  snapshot_formulae "${before}"
298
308
  fi
299
309
 
@@ -307,6 +317,7 @@ run_backend() {
307
317
  if [[ "${mutates}" == "1" ]]; then
308
318
  reconcile_inventory "${before}"
309
319
  rm -f "${before}"
320
+ inventory_snapshot=""
310
321
  fi
311
322
  return "${status}"
312
323
  }
@@ -0,0 +1,20 @@
1
+ -- The China profile loads pinned plugins shipped with OMD.
2
+ local bundle = vim.fn.stdpath("config") .. "/.omd-plugins"
3
+ vim.opt.rtp:prepend(bundle .. "/lazy.nvim")
4
+ local plugins = vim.json.decode(table.concat(vim.fn.readfile(bundle .. "/plugins.lock.json"), "\n"))
5
+ local spec = {
6
+ { "LazyVim/LazyVim", dir = bundle .. "/LazyVim", import = "lazyvim.plugins" },
7
+ { import = "plugins" },
8
+ }
9
+ for name, plugin in pairs(plugins) do
10
+ spec[#spec + 1] = { plugin.repo, name = name, dir = bundle .. "/" .. name, pin = true, build = false }
11
+ end
12
+ require("lazy").setup({
13
+ spec = spec,
14
+ defaults = { lazy = false, version = false },
15
+ install = { missing = false, colorscheme = { "tokyonight", "habamax" } },
16
+ checker = { enabled = false },
17
+ change_detection = { notify = false },
18
+ rocks = { enabled = false },
19
+ pkg = { enabled = false },
20
+ })
@@ -0,0 +1,23 @@
1
+ -- External tools and parsers can be installed explicitly when needed.
2
+ return {
3
+ { "mason-org/mason.nvim", enabled = false },
4
+ { "mason-org/mason-lspconfig.nvim", enabled = false },
5
+ {
6
+ "nvim-treesitter/nvim-treesitter",
7
+ opts = function(_, opts)
8
+ opts.ensure_installed = {}
9
+ end,
10
+ },
11
+ { "saghen/blink.cmp", opts = { fuzzy = { implementation = "lua" } } },
12
+ {
13
+ "neovim/nvim-lspconfig",
14
+ opts = function(_, opts)
15
+ for _, server in pairs(opts.servers) do
16
+ if type(server) == "table" then
17
+ server.mason = false
18
+ end
19
+ end
20
+ opts.servers.lua_ls = { enabled = vim.fn.executable("lua-language-server") == 1, mason = false }
21
+ end,
22
+ },
23
+ }
@@ -23,12 +23,14 @@ omd_detect_os_release() {
23
23
  # shellcheck disable=SC1090
24
24
  source "${os_release}"
25
25
 
26
- if [[ "${ID}" == "ubuntu" && "${VERSION_ID}" == "24.04" ]]; then
27
- printf 'ubuntu-24.04\n'
28
- return 0
29
- fi
26
+ case "${ID}:${VERSION_ID}" in
27
+ ubuntu:22.04|ubuntu:24.04|ubuntu:26.04)
28
+ printf 'ubuntu-%s\n' "${VERSION_ID}"
29
+ return 0
30
+ ;;
31
+ esac
30
32
 
31
- printf 'Unsupported Linux distribution: ID=%s VERSION_ID=%s. oh-my-devpod supports Ubuntu 24.04 only.\n' \
33
+ printf 'Unsupported Linux distribution: ID=%s VERSION_ID=%s. oh-my-devpod supports Ubuntu 22.04, 24.04, and 26.04.\n' \
32
34
  "${ID:-unknown}" "${VERSION_ID:-unknown}" >&2
33
35
  return 1
34
36
  }
@@ -293,13 +295,13 @@ omd_source_env_is_managed() {
293
295
  }
294
296
 
295
297
  omd_uv_config_is_managed() {
296
- local path="$1" contents
298
+ local path="$1" contents expected
299
+ [[ ! -L "${path}" ]] || return 1
297
300
  [[ ! -e "${path}" ]] && return 0
298
- head -n 1 "${path}" 2>/dev/null |
299
- grep -Fq '# Generated by oh-my-devpod.' &&
300
- return 0
301
301
  contents="$(cat "${path}" 2>/dev/null)" || return 1
302
- [[ "${contents}" == $'[[index]]\nurl = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"\ndefault = true' ]]
302
+ expected=$'[[index]]\nurl = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"\ndefault = true'
303
+ [[ "${contents}" == "${expected}" ||
304
+ "${contents}" == "# Generated by oh-my-devpod. Use omd --source github or gitee to change this profile."$'\n'"${expected}" ]]
303
305
  }
304
306
 
305
307
  omd_validate_source_config_ownership() {
@@ -308,11 +310,6 @@ omd_validate_source_config_ownership() {
308
310
  omd_warn "Refusing to overwrite user-managed source environment: ${config_dir}/env"
309
311
  return 1
310
312
  fi
311
- if [[ "${source}" == "gitee" ]] &&
312
- ! omd_uv_config_is_managed "${config_dir}/uv.toml"; then
313
- omd_warn "Refusing to overwrite user-managed uv configuration: ${config_dir}/uv.toml"
314
- return 1
315
- fi
316
313
  }
317
314
 
318
315
  omd_persist_source() {
@@ -340,7 +337,6 @@ omd_persist_source() {
340
337
  'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' \
341
338
  'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"' \
342
339
  'export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"' \
343
- 'export UV_CONFIG_FILE="${OHMYDEVPOD_CONFIG_DIR}/uv.toml"' \
344
340
  'export PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"' \
345
341
  'export CONDA_CHANNELS="conda-forge"' \
346
342
  'export MAMBA_CHANNEL_ALIAS="https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud"' \
@@ -348,17 +344,9 @@ omd_persist_source() {
348
344
  fi
349
345
  } | omd_atomic_write "${env_file}" || return 1
350
346
 
351
- if [[ "${mirror_profile}" == "cn" ]]; then
352
- cat <<'EOF' | omd_atomic_write "${config_dir}/uv.toml"
353
- # Generated by oh-my-devpod. Use omd --source github or gitee to change this profile.
354
- [[index]]
355
- url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
356
- default = true
357
- EOF
358
- else
359
- if omd_uv_config_is_managed "${config_dir}/uv.toml"; then
360
- rm -f "${config_dir}/uv.toml" || return 1
361
- fi
347
+ # Retire the old explicit override; native uv config keeps project discovery.
348
+ if omd_uv_config_is_managed "${config_dir}/uv.toml"; then
349
+ rm -f "${config_dir}/uv.toml" || return 1
362
350
  fi
363
351
  }
364
352
 
@@ -20,7 +20,7 @@ managed() {
20
20
  }
21
21
 
22
22
  install_or_update() {
23
- local action="$1" repo_root
23
+ local action="$1" repo_root overlay_dir plugin_archive=""
24
24
  shift
25
25
  omd_module_reject_unknown_flags "$@" || return
26
26
  if status && ! managed; then
@@ -32,8 +32,14 @@ install_or_update() {
32
32
  return 0
33
33
  fi
34
34
  repo_root="$(omd_module_repo_root)"
35
+ overlay_dir="${repo_root}/config/nvim"
36
+ if [[ "${OHMYDEVPOD_MIRROR_PROFILE:-upstream}" == "cn" ]]; then
37
+ overlay_dir="${repo_root}/config/nvim-cn"
38
+ plugin_archive="${repo_root}/vendor/nvim/plugins.tar.gz"
39
+ fi
35
40
  OHMYDEVPOD_LAZYVIM_SOURCE_DIR="${repo_root}/vendor/nvim/lazyvim-starter" \
36
- OHMYDEVPOD_NVM_OVERLAY_DIR="${repo_root}/config/nvim" \
41
+ OHMYDEVPOD_NVM_OVERLAY_DIR="${overlay_dir}" \
42
+ OHMYDEVPOD_LAZYVIM_PLUGIN_ARCHIVE="${plugin_archive}" \
37
43
  OHMYDEVPOD_NVM_CONFIG_DIR="${config_dir}" \
38
44
  OHMYDEVPOD_NVM_DATA_DIR="${data_dir}" \
39
45
  OHMYDEVPOD_NVM_STATE_DIR="${state_dir}" \
@@ -0,0 +1 @@
1
+ 830475fc6ccae8ec0833d6d154d9c309b16f997b6713ebda5b4cfe0fdb766f63 plugins.tar.gz
@@ -0,0 +1,122 @@
1
+ {
2
+ "LazyVim": {
3
+ "repo": "LazyVim/LazyVim",
4
+ "commit": "999700997f72227187d49d8b92667183dc7fc809"
5
+ },
6
+ "blink.cmp": {
7
+ "repo": "saghen/blink.cmp",
8
+ "commit": "78336bc89ee5365633bcf754d93df01678b5c08f"
9
+ },
10
+ "bufferline.nvim": {
11
+ "repo": "akinsho/bufferline.nvim",
12
+ "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3"
13
+ },
14
+ "catppuccin": {
15
+ "repo": "catppuccin/nvim",
16
+ "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35"
17
+ },
18
+ "conform.nvim": {
19
+ "repo": "stevearc/conform.nvim",
20
+ "commit": "016802de402556da54c36bd7359b441266b01cdd"
21
+ },
22
+ "flash.nvim": {
23
+ "repo": "folke/flash.nvim",
24
+ "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a"
25
+ },
26
+ "friendly-snippets": {
27
+ "repo": "rafamadriz/friendly-snippets",
28
+ "commit": "b4d01b0fdf3c9a549961c2f9ffe8dc09be166219"
29
+ },
30
+ "gitsigns.nvim": {
31
+ "repo": "lewis6991/gitsigns.nvim",
32
+ "commit": "f2421c550618d257048afa650413d9e542ddbe67"
33
+ },
34
+ "grug-far.nvim": {
35
+ "repo": "MagicDuck/grug-far.nvim",
36
+ "commit": "11595bf747edc270bce2069d1020502ad4ae56cf"
37
+ },
38
+ "lazy.nvim": {
39
+ "repo": "folke/lazy.nvim",
40
+ "commit": "85c7ff3711b730b4030d03144f6db6375044ae82"
41
+ },
42
+ "lazydev.nvim": {
43
+ "repo": "folke/lazydev.nvim",
44
+ "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d"
45
+ },
46
+ "lualine.nvim": {
47
+ "repo": "nvim-lualine/lualine.nvim",
48
+ "commit": "221ce6b2d999187044529f49da6554a92f740a96"
49
+ },
50
+ "mini.ai": {
51
+ "repo": "nvim-mini/mini.ai",
52
+ "commit": "cb02c5444613475b7edf0c8dc98264c1c857aa6e"
53
+ },
54
+ "mini.icons": {
55
+ "repo": "nvim-mini/mini.icons",
56
+ "commit": "98faae31e9be1cc054ae63485e58ceb185efcad0"
57
+ },
58
+ "mini.pairs": {
59
+ "repo": "nvim-mini/mini.pairs",
60
+ "commit": "b1c5a726921b7a8c9321e9a7a208aa0571de5810"
61
+ },
62
+ "noice.nvim": {
63
+ "repo": "folke/noice.nvim",
64
+ "commit": "7bfd942445fb63089b59f97ca487d605e715f155"
65
+ },
66
+ "nui.nvim": {
67
+ "repo": "MunifTanjim/nui.nvim",
68
+ "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97"
69
+ },
70
+ "nvim-lint": {
71
+ "repo": "mfussenegger/nvim-lint",
72
+ "commit": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e"
73
+ },
74
+ "nvim-lspconfig": {
75
+ "repo": "neovim/nvim-lspconfig",
76
+ "commit": "ac9d2f7c4757db6320cab6697fe73e5e8adb2457"
77
+ },
78
+ "nvim-treesitter": {
79
+ "repo": "nvim-treesitter/nvim-treesitter",
80
+ "commit": "7caec274fd19c12b55902a5b795100d21531391f"
81
+ },
82
+ "nvim-treesitter-textobjects": {
83
+ "repo": "nvim-treesitter/nvim-treesitter-textobjects",
84
+ "commit": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187"
85
+ },
86
+ "nvim-ts-autotag": {
87
+ "repo": "windwp/nvim-ts-autotag",
88
+ "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275"
89
+ },
90
+ "persistence.nvim": {
91
+ "repo": "folke/persistence.nvim",
92
+ "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c"
93
+ },
94
+ "plenary.nvim": {
95
+ "repo": "nvim-lua/plenary.nvim",
96
+ "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b"
97
+ },
98
+ "snacks.nvim": {
99
+ "repo": "folke/snacks.nvim",
100
+ "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2"
101
+ },
102
+ "todo-comments.nvim": {
103
+ "repo": "folke/todo-comments.nvim",
104
+ "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668"
105
+ },
106
+ "tokyonight.nvim": {
107
+ "repo": "folke/tokyonight.nvim",
108
+ "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6"
109
+ },
110
+ "trouble.nvim": {
111
+ "repo": "folke/trouble.nvim",
112
+ "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a"
113
+ },
114
+ "ts-comments.nvim": {
115
+ "repo": "folke/ts-comments.nvim",
116
+ "commit": "a59d6092213447450191122c9346f309161504cb"
117
+ },
118
+ "which-key.nvim": {
119
+ "repo": "folke/which-key.nvim",
120
+ "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a"
121
+ }
122
+ }