Skip to content

Refactor: artifact model, theme packs, configs cleanup#8

Merged
Nynxz merged 9 commits into
mainfrom
core-artifcact-model
Apr 30, 2026
Merged

Refactor: artifact model, theme packs, configs cleanup#8
Nynxz merged 9 commits into
mainfrom
core-artifcact-model

Conversation

@Nynxz
Copy link
Copy Markdown
Member

@Nynxz Nynxz commented Apr 30, 2026

...

Nynxz added 9 commits January 8, 2026 14:28
Improve artifact fetch reliability by centralizing base URL resolution and
forcing proxy fallback when artifact URLs are missing, malformed, or cross-host.
Also switch base URL precedence to prefer config over env for consistent
runtime behavior.

Update UI roots/portals to always include the `embeddr` class (alongside
`embeddr-theme-root`) so theme pack CSS selectors apply correctly across
sidebar, dialogs, and portal content.fix: harden artifact loading and apply theme pack classes

Improve artifact fetch reliability by centralizing base URL resolution and
forcing proxy fallback when artifact URLs are missing, malformed, or cross-host.
Also switch base URL precedence to prefer config over env for consistent
runtime behavior.

Update UI roots/portals to always include the `embeddr` class (alongside
`embeddr-theme-root`) so theme pack CSS selectors apply correctly across
sidebar, dialogs, and portal content.
Bring the comfyui plugin in line with the rest of the embeddr release
repos (react-ui / zen-shell / client-typescript template). No
behavioural changes for end-users — js/main.js bundle still builds
identically.

Configs:
- eslint.config.js: extend tanstack-config base with three pragmatic
  overrides (react-hooks/exhaustive-deps off pending v7 compat;
  @typescript-eslint/no-unnecessary-condition off — too noisy for code
  parsing untyped JSON / ComfyUI globals; @typescript-eslint/ban-ts-
  comment off — every @ts-ignore here is a legitimate ComfyUI-globals
  suppression and requiring per-line descriptions just adds noise)
- Add self-contained prettier.config.cjs (no parent-dir reference)
- Add .prettierignore (js, .venv, lockfiles, .github)

Dependencies:
- Drop unused @vitejs/plugin-vue and vite-plugin-vue-devtools (this is
  a React project, not Vue — leftover from a template)
- Add eslint, prettier, typescript, @types/node as direct devDeps
- Switch @embeddr/* deps from `workspace:` protocol to plain version
  ranges (^0.2.0-alpha.3 / ^0.2.0-alpha.2). workspace: only resolves
  inside a workspace; CI clones this repo standalone. Local dev still
  auto-links via pnpm link-workspace-packages.
- Delete redundant package-lock.json (pnpm is the source of truth)
- Regenerate standalone pnpm-lock.yaml against current npm versions
  (was stuck at @embeddr/react-ui@0.1.4)

Vite:
- Drop the brittle `@embeddr/client-typescript → ../client-typescript/src`
  alias from vite.config.mts. Resolution now goes through node_modules
  like every other dependency, which works in dev (auto-link) and CI
  (npm) without depending on parent-dir layout.

Workflows:
- ci.yml + release.yml: bump pnpm 9 → 10.26.2, Node 20 → "latest",
  pnpm/action-setup v2 → v3, add cache: "pnpm", switch install to
  --frozen-lockfile for reproducibility, add lint step (soft-fail).
- release.yml: drop `submodules: true` from checkout (no submodules).
- ci.yml: also trigger on push to main (was dev-only).

Source fixes from lint pass:
- Real bug fix in ZenShell.tsx: invert `if (cancelled) return` inside
  `finally` block to `if (!cancelled) { ... }` — return-in-finally
  swallows exceptions thrown in the try/catch.
- Remove dangling `// eslint-disable-line react-hooks/exhaustive-deps`
  in SettingsForm.tsx (rule already disabled at config level).
- Format pass: prettier --write across all sources at consistent
  printWidth: 100, tabWidth: 2.
- Misc auto-fixed: TypeAction[] → Array<TypeAction>, sort-imports,
  consistent-type-specifier-style.

Lint state: 0 errors, 20 warnings (no-shadow, async-stubs — all
non-blocking, leave for a future tidy-up pass).
Set up the Python tooling that was missing — the ts side already had
eslint+prettier, the python side had nothing.

Tooling:
- pyproject.toml [tool.ruff]: target py310, line-length 100, lint rules
  E/W/F/I/B/UP/SIM/C4/RUF, ignore E501 (formatter handles wrapping),
  B008 (function-call default is a common ComfyUI node pattern), and
  SIM108 (ternary often less readable). Per-file-ignore N801/N802/
  N803/N806 in nodes/ — ComfyUI's own naming convention.
- Add ruff>=0.7.0 to dev dependency-group (PEP 735, uv-managed)
- Bump requires-python 3.8 → 3.10 (codebase already uses PEP 604
  union syntax `str | None`)
- Declare requests as a runtime dep (was used but not listed)

Source fixes from ruff pass:
- 8x bare `except:` → `except Exception:` (avoid catching
  KeyboardInterrupt / SystemExit unintentionally)
- 4x mutable class default `_cache = {}` → `_cache: ClassVar[dict] = {}`
  (RUF012; the cache is intentionally class-level for sharing across
  ComfyUI executions of the same node, ClassVar makes the intent explicit)
- 1x em-dash → hyphen in docstring
- ~17 misc auto-fixes: list concatenation → spread, contextlib.suppress
  for try/except/pass, unused vars renamed with `_` prefix
- ruff format pass across 20 files (consistent quotes, indentation)

CI:
- ci.yml: split into two jobs — `frontend` (existing pnpm lint+build)
  and `python` (new: uv sync + ruff check + ruff format --check)
- release.yml: insert ruff check before the frontend build step so
  releases can't ship Python lint failures
Trim stale / unused files now that the configs are settled.

Removed:
- example.config.json — stale; runtime config is set via the sidebar
  SettingsForm UI which writes to config.json directly. The template
  file isn't referenced anywhere.
- __pycache__/, .ruff_cache/ — tooling artifacts that shouldn't be in
  the working tree (already in .gitignore).

Fixed:
- MANIFEST.in: was referencing a non-existent LICENSE.txt; corrected
  to LICENSE (matches the actual file). Kept — `comfy node publish`
  builds a Python sdist for the registry, which needs MANIFEST.in to
  pull in the compiled `js/` bundle (it isn't auto-included as it's
  not a Python package).
- components.json: shadcn config pointed at src/globals.css which
  doesn't exist; the actual file is ui/globals.css. `pnpm dlx shadcn
  add <component>` now works.
- tsconfig.json: drop typeRoots ["src/types", ...] referencing a
  non-existent dir; add include ["ui"], moduleResolution: "bundler",
  skipLibCheck, esModuleInterop, isolatedModules — fills in the gaps
  that were causing tsserver to lose track of the project.
- Auto-fixed 5 @typescript-eslint/no-unnecessary-type-assertion
  surfaced once tsconfig was sane (typed-aware lint kicked in).

.gitignore: rewrote with explicit categories — Python artifacts (incl.
.ruff_cache/.pytest_cache/.venv), local user state (config.json/.env),
release artifacts (comfyui-embeddr/, *.zip). Drops stale `node.zip`
and `*_cache` glob in favour of explicit names.

Kept: uv.lock (needed for reproducible CI install via `uv sync`).
@Nynxz Nynxz merged commit 2d8ab04 into main Apr 30, 2026
2 checks passed
@Nynxz Nynxz deleted the core-artifcact-model branch April 30, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant