Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.

Releases: clearcms/clear-legacy

@clearcms/index@0.2.3

Choose a tag to compare

@github-actions github-actions released this 07 May 04:23
a0fa1bd

Patch Changes

  • Updated dependencies [68f91de]:
    • @clearcms/db@0.1.2

@clearcms/db@0.1.2

Choose a tag to compare

@github-actions github-actions released this 07 May 04:23
a0fa1bd

Patch Changes

  • 68f91de Thanks @slavasolutions! - Fix @clearcms/db to ship a compiled dist/ instead of raw .ts
    sources. Closes #87 (Node 22+ admin requests 500 with
    ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING) and #89 (the dev
    script NODE_OPTIONS workaround that the missing dist forced).

    What changed:

    • packages/db/tsconfig.build.json — new file, mirrors
      packages/spec/tsconfig.build.json (noEmit: false,
      declaration, declarationMap, sourceMap,
      rewriteRelativeImportExtensions, excludes test files).
    • packages/db/package.json:
      • main / types./dist/index.js / ./dist/index.d.ts.
      • exports — each entry (., ./schema, ./client,
        ./migrate) is a {types, default} conditional pointing at
        the corresponding compiled file. ./migrations keeps pointing
        at the bare directory (drizzle SQL files, not compiled).
      • scripts.buildtsc -p tsconfig.build.json. Picked up by
        the monorepo's pnpm -r build automatically.
      • files — replaces src with dist. Raw .ts no longer ships
        in the published tarball; consumers get only the compiled JS +
        types + the migrations directory.

    pnpm --filter @clearcms/db build produces 4 modules × 4 artifacts
    (.js, .js.map, .d.ts, .d.ts.map) under dist/. Typecheck
    clean.

    Audit of other @clearcms/* packages confirms no other shipped-version
    package is in the same state: mcp and index already compile to
    dist/ and ship correctly; design is a CSS/SVG/CJS asset bundle
    (intentionally not TS-compiled); spec / storage / sdk / core
    known good.

@clearcms/create@0.4.0

Choose a tag to compare

@github-actions github-actions released this 07 May 04:23
a0fa1bd

Minor Changes

  • 505a71a Thanks @slavasolutions! - Fix scaffolded projects so a fresh npx @clearcms/create actually works.

    Bundles four bugs surfaced by adopter testers on v0.4.0:

    • #86 — admin pin out-of-range. @clearcms/create@0.3.0 substituted
      __CLEAR_VERSION__ to ^0.3.0, but no @clearcms/admin@0.3.x was
      ever published to npm (v0.3 was skipped via the v0.4 fat train). Stock
      pnpm install failed with ERR_PNPM_NO_MATCHING_VERSION. This minor
      bump lifts @clearcms/create to the 0.4.x line, so the
      __CLEAR_VERSION__ substitution emits ^0.4.0 — which resolves to
      @clearcms/admin@0.4.1 and onward.
    • #90 — pnpm 10 silent build-script skip. Added
      pnpm.onlyBuiltDependencies: ["esbuild", "sharp"] to the scaffold's
      package.json. Without this, pnpm 10 prints
      Run "pnpm approve-builds" and skips sharp's native binding —
      silently degrading admin's image-transform path to JS. Pre-approving
      these two specifically keeps the scaffold strict (no arbitrary
      postinstall scripts) but unblocks the two builds we need.
    • #92pnpm typecheck failed against REST backend.
      pnpm typecheck ran astro check without CLEAR_BACKEND=fs, so the
      loaders defaulted to REST and tried to fetch /api/v1/pages while
      the admin wasn't running. Mirrored pnpm build's cross-env prefix.
    • #93 — scaffold templates failed their own typecheck. Two distinct
      TS errors:
      1. src/layouts/Base.astro accessed item.kind and item.href on a
        NavNode discriminated union without proper narrowing. Switched
        to 'kind' in item for narrowing + defensive 'href' in child
        for nested children.
      2. src/pages/preview.astro passed description={description} where
        description could be undefined. Astro 6's
        exactOptionalPropertyTypes: true rejects explicit-undefined for
        optional props. Switched to a conditional spread:
        {...(description !== undefined ? { description } : {})}.

    After this lands, a stock npx @clearcms/create my-site && cd my-site && pnpm install && pnpm dev
    boots admin + site cleanly on a fresh machine, and pnpm typecheck returns 0 errors.

@clearcms/admin@0.4.2

Choose a tag to compare

@github-actions github-actions released this 07 May 04:23
a0fa1bd

Patch Changes

  • 3821bc7 Thanks @slavasolutions! - Stop publishing test files in the @clearcms/admin npm tarball (closes #88).

    The files field in apps/admin/package.json listed src whole, so
    every .test.ts/.test.tsx, __tests__/, and __snapshots__/ under
    src/ shipped to npm. The test files import vitest, which is a
    devDependency — Vite's dependency scanner walks the published tree on
    admin boot, fails to resolve vitest, and prints:

    [vite] (!) Failed to run dependency scan ... vitest ... Are they installed?
    

    Non-fatal but noisy on every cold start.

    Adopter testers hit it on PreviewPanel.test.tsx and
    pages/api/admin/schemas/key.test.ts on different runs — the leak isn't
    file-specific, it's the whole src/ umbrella.

    This change adds explicit negation patterns to files:

    "!**/*.test.ts", "!**/*.test.tsx",
    "!**/*.spec.ts", "!**/*.spec.tsx",
    "!**/__tests__/**",
    "!**/__snapshots__/**",
    "!src/test/**"

    Verified with npm pack --dry-run — the tarball no longer contains any
    .test.*, .spec.*, __tests__/, or __snapshots__/ entries.

  • Updated dependencies [68f91de]:

    • @clearcms/db@0.1.2
    • @clearcms/index@0.2.3

@clearcms/admin@0.4.1

Choose a tag to compare

@github-actions github-actions released this 07 May 03:14
d84dcaa

Patch Changes

  • #84 2d6eb06 Thanks @slavasolutions! - Add update-available reminders to clear-admin.

    Adopters now learn about new versions of @clearcms/admin via two
    complementary surfaces:

    Passive notifier — every clear-admin <command> invocation kicks off
    an async, non-blocking check against the npm registry. The result caches
    at ~/.cache/clear-admin/update-check.json (24h TTL). On the next
    invocation, if a newer version is published, a one-line banner prints to
    stderr at process exit:

      Update available  0.4.1 → 0.5.0
      Run `npm i -g @clearcms/admin` to upgrade. Set NO_UPDATE_NOTIFIER=1 to silence.
    

    The check never blocks, never errors, never delays output. Failures
    (offline, registry 5xx, timeout) are silent. Skipped when
    NO_UPDATE_NOTIFIER=1 or CI env vars are set.

    Doctor checkclear-admin doctor now includes an admin-update
    check that reports current vs latest @clearcms/admin. Reads the cache
    file when fresh (24h); otherwise does a synchronous registry fetch with
    a 1.5s timeout. WARN tier when behind, INFO when current or registry
    unreachable. Skipped in CI / test environments / with NO_UPDATE_NOTIFIER.

    No new dependencies. Hand-rolled — built-in fetch + Node fs only.

  • #82 6de9035 Thanks @slavasolutions! - Fix Windows clear-admin start spawning astro with ENOENT (#81).

    apps/admin/bin/clear-admin.js's dev-mode path resolved
    node_modules/.bin/astro and called spawn() without shell: true. On
    Windows, pnpm/npm put shell wrappers at .bin/astro.cmd and .bin/astro.ps1,
    not a bare .bin/astro — Node's child_process.spawn cannot resolve the
    .cmd extension implicitly and threw ENOENT. POSIX silently handled it
    because the bare wrapper was directly executable.

    Now picks astro.cmd on process.platform === 'win32' and bare astro
    elsewhere. No shell, no quoting concerns. Adopters running pnpm dev
    on a Windows fresh clone of a @clearcms/create scaffold can boot the
    admin alongside the site.

  • #83 cbdc2ce Thanks @slavasolutions! - Fix Windows SQLite teardown EBUSY in admin tests (#56).

    Test suites that exercised real libSQL (pages-reindex, schemas [key] API,
    preview [token] API) and the backup/restore CLI tests failed on Windows
    fresh clones with EBUSY: resource busy or locked, unlink ...\clear.db. Two
    compounding causes:

    1. The cached libSQL singleton in apps/admin/src/lib/db.ts is opened lazily
      when a route is imported. Tests closed their own setup-time client but
      never the route-side cached client, so the file handle persisted past
      afterAll.
    2. POSIX silently allows unlink-while-open. Windows doesn't, and the OS
      sometimes needs a brief retry window even after close() returns.

    This change adds:

    • A new closeDb() export from apps/admin/src/lib/db.ts that closes the
      cached client and clears the singleton. Tests call it in afterAll before
      removing tempdirs.
    • A new safeRm(path) test helper in apps/admin/src/test/teardown.ts that
      retries rm with backoff on EBUSY (5 retries, linear 50ms backoff).

    Wired into the affected suites: pages-reindex.test.ts, schemas/[key].test.ts,
    preview/[token].test.ts, backup.test.ts, restore.test.ts.

    Linux/macOS unaffected — safeRm falls through to a single rm call when
    no EBUSY occurs.

@clearcms/storage@0.2.2

Choose a tag to compare

@slavasolutions slavasolutions released this 06 May 21:57
925a7c3

Patch Changes

  • c7b4590 Thanks @slavasolutions! - Late-2026-05-04 release batch:

    • admin — pages preview wiring (PreviewPanel in PagePageEditor, type='page' branch in /api/v1/preview); page-scoped data editor (Data tab + pageData.save action + REST extension); schemaEditor subsystem default-on; security: drop Astro's strict same-origin POST guard for single-operator network access.
    • spec — page-data meta-schema + clear:widget + clear:width extension keywords; widthFor()/widthSpan() resolvers.
    • storage — page-scoped data.json read/write/delete helpers + layout-schema loader.
    • sdkcms.page(slug).data returns parsed page-scoped data across all 4 backends (fs/REST/R2/S3).
    • create — scaffolder ships /preview.astro route and example layout schema in theme-examples/home.schema.json.

    Note: this batch was published manually before Changesets was wired up. The next release runs through the standard CI flow.

  • 590abd8 Thanks @slavasolutions! - Schema-first editor (Task 16, ADR-0020). Inverts the editor model so a schema-driven form is the canvas. TipTap moves from "always-on body" to a widget: "richtext" field type only present when the schema declares it. Two modes — form (default, 12-col grid) and article (full-canvas TipTap, opt-in for long-form prose like blog posts).

    • adminSchemaForm + 10 widgets (text, textarea, richtext, number, url, date, image, select, array, object). PageItemEditor and PagePageEditor refactored to render SchemaForm instead of a hardcoded Body tab. Empty-state CTA when a page has no layout schema. Bucket migration 0004 lifts existing page bodies into data.json (with backup) and synthesizes default schemas for posts (article mode) + pages (default layout). Schema-editor UI gets editor-mode toggle + article-mode invariant validation.
    • speceditor: "form" | "article" keyword on collection + layout schemas. widget lifted to first-class top-level (alongside legacy clear:widget). New width: "full" | "half" | "third" keyword for grid layout (defaults: text/number/url/date/select → half; textarea/richtext/array/object/image → full). Helpers: validateArticleSchema, editorModeFor, titleFor, widthFor, widthSpan.
    • sdkcms.collection(<type>).get(<slug>).data.<field> and cms.pages.get(<slug>).data.<field> shape locked across all 4 backends. Schema-shape regression tests.
    • storage — page-data fs helpers stable.
    • create — scaffolder ships an example article-mode posts.json and a form-mode home.schema.json. README + docs/integrations/astro.md document the schema-first model.

@clearcms/spec@0.3.1

Choose a tag to compare

@slavasolutions slavasolutions released this 06 May 21:57
925a7c3

Patch Changes

  • #19 bebbdc1 Thanks @slavasolutions! - clear-admin backup and clear-admin restore — first-class operator commands.

    • admin — new clear-admin backup [--out=<dir>] [--slug=<s>] writes a tarball
      containing the bucket directory, clear.db, and a manifest.json
      describing every file with sha256 + bytes + captured package versions.
      Default output dir: $CLEAR_BACKUP_DIR or ~/clear/_backups/<slug>/.
    • admin — new clear-admin restore <tarball> [<target-dir>] [--force]
      extracts a backup, verifies every file's sha256 against the manifest,
      refuses to overwrite a non-empty target unless --force is passed, and
      prints concrete next steps on success.
    • admin — the in-monorepo pnpm backup / pnpm restore scripts now
      delegate to the same modules so they produce v1 manifests too.
    • spec — new @clearcms/spec/backup-manifest export with the
      BackupManifestSchema Zod validator (closed-shape, version-gated).
      JSON Schema artifact at dist/schemas/backup-manifest.json.

    closes #13

  • #35 fde9eab Thanks @slavasolutions! - Schema-aware clear-admin import <dir>.

    • adminclear-admin import <dir> now reads the target collection's
      schema first and maps each markdown file's frontmatter onto the
      declared fields. The body lands in the schema's first kind: "richtext" field by default. Two new escape hatches:
      • Per-file override clear:bodyField: <name> in frontmatter routes
        the body into the named field instead.
      • --no-synthesize errors out (with a documented message) when the
        schema has no richtext field and no override is set, instead of
        auto-appending a body field.
    • admin — unknown frontmatter keys are now logged as warnings (per
      file) and dropped from the imported item, instead of leaking into
      data as untyped values. Keys in the reserved clear: namespace are
      skipped silently.
    • admin — when synthesis fires, the importer appends a single
      body: { kind: "richtext" } entry to
      bucket/schema/fields/<collection>.json and runs syncBucketToDb so
      the DB index matches the new shape.
    • admin--help and inline import usage list the new flags.
    • spec — new BODY_FIELD_FRONTMATTER_KEY = 'clear:bodyField' and
      RESERVED_FRONTMATTER_PREFIX = 'clear:' constants exported from
      @clearcms/spec so adopter tooling can match the importer's contract
      without copying the strings.

    Re-import is still one-way (overwrite, not merge); two-way sync remains
    out of scope for v0.x.

    closes #34

@clearcms/sdk@0.3.1

Choose a tag to compare

@slavasolutions slavasolutions released this 06 May 21:57
925a7c3

Patch Changes

@clearcms/mcp@0.1.2

Choose a tag to compare

@github-actions github-actions released this 06 May 21:37
7959bf5

Patch Changes

  • Updated dependencies []:
    • @clearcms/sdk@0.3.1

@clearcms/index@0.2.2

Choose a tag to compare

@slavasolutions slavasolutions released this 06 May 21:57
925a7c3

Patch Changes