Skip to content

v0.0.2-alpha.81

Pre-release
Pre-release

Choose a tag to compare

@mobeenabdullah mobeenabdullah released this 24 Nov 01:45
· 566 commits to dev since this release
8bf4796

Released 22 packages at 0.0.2-alpha.81 in lockstep. Every package below ships at this version.

What's changed

Patch Changes

  • #5119 48e70fb Thanks @aqib-rx! - A blank migration's -- Parent: and -- Merges: lines are read in its header only, above -- UP, by migrate:check, nextly migrate and migrate:create alike; a line among its statements places nothing. A dialect's variant (<name>.mysql.sql) is read with its migration: migrate:check pairs it with that migration's snapshot instead of reporting it MISSING_SNAPSHOT, and the history check no longer counts a variant of a blank migration as a second branch.

  • #5118 4c87b4f Thanks @mobeenabdullah! - A collection can declare that its entries are private files, with a files option (experimental): the accepted types, the largest size, and how a download is answered. It gains the fields each file needs (filename, mimeType, size, sha256, storageKey, fileStatus, rejectReason, uploadedByKind, uploadedById), which no caller can write through a checked path, and the storage key is never returned to one. The option is refused beside drafts, versions, localization, a public address or a read rule of true, and the Public role is granted nothing on such a collection at boot. Uploading and downloading the files come in a later release.

  • #5120 971fc22 Thanks @aqib-rx! - A code-first collection or Single can no longer give a field that stores no column of its own (a component, a many-to-many relationship or a virtual field) the exact name title or slug. defineCollection and defineSingle add their own text title and slug beside such a field, and the two shared one document key, so a write could be lost. Such a configuration is now refused when it loads, naming the field: rename it, or declare title or slug as a text field to replace Nextly's own. A name in another letter case (Slug) and a field inside a group or repeater are accepted as before.

  • #5151 c640cb6 Thanks @aqib-rx! - nextly db:sync --demote and --promote now hold the schema lock on a database where no run has made the lock's table yet: they make the lock's tables first, as a development start or nextly db:sync does (nextly_schema_lock, and beside it the earlier nextly_field_group_lock and, on PostgreSQL, nextly_migrate_lock, which they may also bring up to date), so a sync started at the same time waits for them instead of writing the same collection's registry record in between. Where the database refuses the role those tables, they go on as before and say so in one warning; any other failure stops them as it did.

  • #5122 3ab74e2 Thanks @aqib-rx! - A collection nextly db:sync --demote handed to the Schema Builder now follows the Builder's definition while its entry is still in nextly.config.ts: db:sync, a configuration reload under next dev and nextly migrate ignore that entry (and warn once to remove it). The demote keeps the stored timestamps setting of a record it replaces, and refuses a collection a plugin contributes (DEMOTE_PLUGIN_COLLECTION).

  • #5149 d6c29b4 Thanks @aqib-rx! - Every reader of the migrations folder now reads a dialect's variant (0003_seed.mysql.sql) together with its migration, as the runner does.

    • A migration states that it is blank, and its place in the history, once. A variant that states nothing follows its base file, so nextly migrate:check passes a hand-written variant beside a migrate:create --blank file. A blank mark that only a variant carries marks the whole migration.
    • A -- Parent: line stated only in a variant now places the migration in the history.
    • When a base file and a variant state different places, nextly migrate, nextly migrate:create, nextly migrate:check and a Schema Builder save refuse, naming both files. This is the new MIGRATION_PLACE_STATED_TWICE code.
    • Settling a Builder save that was left part-way names a later blank migration once, by its own name, and no longer reads a variant of a migration that has a snapshot as a blank migration of its own.
    • nextly migrate:check's statement check judges a variant against its migration's snapshot, so the next file's DESTRUCTIVE warnings are judged against the right schema.
  • #5001 84f880d Thanks @faisal-rx! - A development schema push on SQLite now runs in one transaction: a statement that fails takes back every statement of the push before it, so the database is left exactly as it was and the save keeps no migration file. Foreign-key enforcement is still switched off for the whole push, before the transaction opens. A push that finds nothing to change opens no transaction.

  • #5125 57df632 Thanks @faisal-rx! - A Schema Builder save that changes the type of a field inside a named group or a repeater judges each value the field holds, as it judges a field kept on the row. Nothing converts a value held inside JSON, so a value is kept only where the new field reads it as it is stored. Where a value cannot be read as the new type, or would first have to be rewritten into its form (the text "1" under a number field), the save is refused before anything changes, naming the field by its path (such as details.price) and the rows by their keys with a count, never by their values. The schema dialog, the collection update and nextly migrate give the same judgement in the same words. The code-first reload under next dev and nextly db:sync now judge the same way, in the same words, the type changes their own rule never saw: a field inside a group's or a repeater's JSON, and a field whose column keeps its type. The reload holds the entity back and nextly db:sync refuses, naming the field by its path. Before, the save went through and left those values in the group's or the repeater's stored JSON under a type that cannot read them.

  • #5114 6d69dd4 Thanks @faisal-rx! - A field moved into or out of a group in a code-first config keeps its values: nextly migrate:create asks about each field that looks moved (or, with no terminal, carries every one with --accept-moves) and writes statements that copy its values to the new place, and back in the DOWN. A working draft holding the field at its old place stops the migration before it changes anything. Under next dev, such a change is held back, naming the field, rather than deleting its values or leaving them where nothing reads them.

  • #5153 07150eb Thanks @aqib-rx! - A collection nextly db:sync --demote handed to the Schema Builder is now ignored by every pass that reads nextly.config.ts while its entry is still there: its localized setting no longer creates or restores a translations table, and a pair of fields added to it no longer stops a start. A reload records a plugin's collection as the plugin's, and the demote's note names the columns the Schema Builder's rules change at the next sync and says its compound indexes go then.

  • #5154 dc0518a Thanks @aqib-rx! - On SQLite, the registry write of nextly db:sync --demote and --promote waits for a database another connection holds, as every other schema command's write does: it takes the schema lock first, retries within NEXTLY_LOCK_TIMEOUT / NEXTLY_LOCK_TIMEOUT_TOTAL, and then stops with NEXTLY_TABLE_BUSY, rather than ending at once with SQLite's own "database is locked" while it checked for the lock's table. On PostgreSQL and MySQL nothing changes: where the lock's table is there, they still create nothing.

  • #5167 c75373a Thanks @nextly-agent! - A Nextly shut down in development stops watching its configuration. Before, the watcher kept running after shutdown(), so a later save, or removing the folder that held the config, reloaded the configuration into whatever Nextly started next in the same process.

  • #5138 7956714 Thanks @nextly-agent! - The page builder's Add panel reads the places a block may go once per page and selection, rather than again on every redraw, such as each letter typed into its search.

  • #5142 c3bc894 Thanks @faisal-rx! - A saved field can be moved into and out of a named group in the Schema Builder, by drag, by key or with Move to…, and the save keeps every entry's value: the Builder sends each move with its preview and its save, and the review lists it as moved with its values kept, with what the move does not carry. A field moved and renamed or retyped in one save is refused before it is sent, and a move into or out of repeating rows is still refused. A move the save refuses is marked at its field, with the reason: on its row, in the error count beside Save, and at the top of its settings. A field kept per language (text-like fields are, by default) does not move into a group yet.

  • #5016 c7b482d Thanks @faisal-rx! - A block in a written email can be shown only when a variable has a value, is yes or is no (@experimental): choose Show only when in the block's menu. The block carries its condition as a label that can be removed. The variables offered there, and for a link, include every declared path, nested fields too.

    A saved written email can be converted to code from the workbench's menu. The dialog says the change can't be undone, shows the HTML and Liquid the email becomes, and waits until unsaved edits are saved; the server writes the code from the saved blocks, keeping every variable, condition and list as Liquid. For this, the draft preview of a written email now also returns source: { html, text }, its compiled code before any data.

    allowedUrl, the check a save applies to a written email's link and image addresses, is exported from nextly/api/email-template-preview-types, so an editor can check an address with the same rule.

    In a written email's plain-text body, a link across a bold word, a chip or a line break now gives its address once, after the whole phrase, instead of after each part of it.

    A chip inside a list with no items is marked as showing nothing, whatever it holds. A chip that stands for an image address counts only a complete address.

  • #5029 0b8d26a Thanks @faisal-rx! - On MySQL, a Schema Builder save that deletes a field's values now holds its collection from its count of those values until its migration is over, as a collection delete does, so a value written while the save runs is either counted (and the save refused for the new count) or written after the field is gone; before, an entry write that was under way when the save counted could be dropped uncounted. The admin's Schema Builder now sends the counts its review showed with the save, so its deletions are counted and held this way; a count that changed since the review refuses the save, naming the new count. An entry write to a collection now waits while another change of that collection holds it, a hold that waits past 30 seconds is refused before anything changes, and a write that waited while its collection was deleted, or deleted and made again under its slug, is refused rather than written into what took its place. A collection delete or entry write that meets a schema change in progress now answers COLLECTION_BEING_CHANGED (409) instead of CONFLICT, so a caller can tell the refusal is safe to try again. The hold also costs fewer statements: the database's name is read once per connection pool, and its named locks are taken in one statement and released in one. A hold that fails part way releases every lock it may have taken. A save refused after part of it applied, which MySQL can meet once an earlier statement has committed, now answers NEXTLY_MIGRATION_PARTIALLY_APPLIED rather than the refusal's own code, and says it stopped part way; a refusal it names is under data.refused, not data.errors.

  • #5113 007359a Thanks @aqib-rx! - Every nextly command prints its first line as soon as it starts, before its own code loads, which takes seconds. A command that uses a database names it there (Database: SQLite ./data.db (development; DATABASE_URL from .env)); one that does not prints a short line saying what it is starting, such as Reading the configuration.... Both go to standard error, so --json output stays one document, and --quiet keeps them back. How long a command takes in all is unchanged.

  • #5162 6380ba4 Thanks @mobeenabdullah! - Two saves of entries in the same collection on MySQL no longer deadlock when each records something in the entry's history. One of them used to be rolled back and run again. A history write now takes its collection's registry row with a shared lock rather than an exclusive one, which still keeps it in order with deleting the collection.

  • #5140 eb1f125 Thanks @mobeenabdullah! - An accounts invitation email can greet the person by name and say when its link stops working. Its template now receives name, expiresAt (ISO 8601, UTC), expiresAtText (such as "30 November 2026, 5:00 PM") and timeZone, and the default template uses them. The time is written in the new timeZone option of accounts() (an IANA name such as Asia/Karachi), UTC when it is not set. Inviting the same address again sends the new link's expiry.

  • #5161 4f38335 Thanks @mobeenabdullah! - Two first changes to the site's languages made at the same moment both apply on MySQL, instead of one failing with a database deadlock.

  • #5139 436bd23 Thanks @mobeenabdullah! - A production start that does not run migrations at start publishes the cache tag expiry ledger as soon as it has checked the database is set up, before it reads the schema, the field-group storage names and the plugins' install states. A stored page, the admin's included, waits for the ledger before it is served, so it no longer waits for those reads: on a database 100 ms away the admin page's first byte came about 1.3 s after the server's first answer, and now about 0.55 s. A start that runs migrations at start still publishes it after them, as they record their own expiries.

  • #5143 69d88d5 Thanks @muzzamil-rx! - On a site with more than one language, a collection list shows each document's languages as labelled chips (live, changes, out of date, draft, missing), with a key above the table, in place of the language dots. Each chip names its language by code and its state in words, and opens the document in that language. The list filters by "Missing in " and "Out of date in " (the _translated filter's missing and stale states, kept in the address as ?pf=nextly.language:<state>.<code> like the other list filters), and replaces "Translated in". Where the title is translated, a "Titles in" control shows titles in a chosen language, read in that language alone with no fallback: a row with no title there keeps its default-language title, marked as such, and each title carries its language's lang and dir. The chips and the filter are offered only to a reader who may read every language's state; a site with one language shows none of it.

  • #5042 a9eb6df Thanks @faisal-rx! - nextly migrate settles a Builder save left part-way before its run, as a development start does, and judges a save made outside development by its files: complete files run, and a save stopped before its definition was written has its own unapplied files withdrawn. A file the database has applied is never removed. What cannot be settled refuses the run before its first file. A production start that runs migrations settles nothing: it refuses while a save is left part-way, removing no file and leaving ui-schema.json as it is. migrate:check, migrate:create and db:sync refuse while such a save stands, and every refusal names nextly migrate as a way to settle it.

  • #5134 9f766a0 Thanks @mobeenabdullah! - Private files can be downloaded (experimental). GET /admin/api/files/:slug/:id/download reads the file's entry as the caller, by the collection's access rules, and answers a file they may not read, a missing one and one not yet confirmed with the same 404; a ready file is streamed as an attachment, or answered with a 303 to a link that lasts a minute, and no cache may keep either. Every download writes an audit row of kind file.downloaded. Server code opens files with nextly.files.download, which refuses a call naming no caller unless it says overrideAccess: true. Two confirms of one upload that overlap now keep one copy of the file. A response's own Content-Security-Policy and Referrer-Policy are no longer replaced by the site's defaults. New guide: Private Files.

  • #5126 3700351 Thanks @mobeenabdullah! - Private files can be uploaded (experimental). POST /admin/api/files/:slug/uploads checks the caller may create in the collection, judges the file's name, type and size against its files option, and answers a link that lasts five minutes for sending the bytes straight to storage; POST /admin/api/files/:slug/uploads/:id/complete reads the stored bytes back and accepts them only when their size and content match what was claimed, deleting them otherwise. Staff, API keys (by their own scope) and signed-in people of the kinds a collection lists in the new files.principals are judged by the collection's access rules alike. Uploads never confirmed are rejected and their bytes deleted once the collection's wait has passed, by a job the job runner runs. An app whose private collection has no storage that keeps files private now refuses to start.

  • #5115 07b83be Thanks @mobeenabdullah! - Storage can now hold a collection's private files, which no public address ever serves (experimental groundwork; collections opt in in a later release). A collection marked private is never written to the local disk: with no storage plugin that can keep files private, it is refused rather than served from /uploads, and upload(), public URLs, client uploads and signed downloads are refused for it. @nextlyhq/storage-s3 stores private files under keys that name no file, never cached, with short upload and download links, and needs no publicUrl for them, on Cloudflare R2 too. A public upload on R2 with no publicUrl is now refused before the file is stored, rather than after.

  • #5164 63c1f82 Thanks @nextly-agent! - A production start finds the collections a demote handed to the Schema Builder in the registry rows it has already read, rather than reading the registry again. That second read was one more wait on the database before the start resolved.

  • #5133 b831526 Thanks @mobeenabdullah! - nextly migrate, and a start, no longer tell a database that an earlier release migrated but never started that its visitors lost reads. Since 0.0.2-alpha.75 nextly migrate makes the preset roles, so a database it migrated, with no start since, read as one seeded by a release from before the Public role, and was told "Before this upgrade they could read these" of collections and Singles with no read rule, which its visitors could not read before the upgrade either. A database whose preset roles' grants a release recorded (preset_grants_release, written only by nextly migrate from 0.0.2-alpha.75 on) is now recorded as not due the notice. A database seeded by a release from before the Public role is still told once. Only the notice's own record changes: no role, permission or grant is touched.

  • #5131 7276d00 Thanks @mobeenabdullah! - An accounts email's one-time link or code is no longer stored in the jobs table. The queued job holds only a reference, and the link is rebuilt when the email is sent, so a copy of the database (a backup, a leaked credential) no longer holds a live reset or invitation link, before or after sending, and a failed send's error never names one. Core's email service also blanks a secret-carrying template's link and code out of a provider's failure before logging it. An email whose link was replaced, used or expired before it went is not sent. For plugin authors, ctx.security.secrets mints now return a ref, and reveal({ ref }) derives the token or code again while it is live (experimental).

  • #5136 6faa3de Thanks @mobeenabdullah! - A document's readability in each language, which a document's history, review state and workflow notices ask, is judged from a read of the document alone, with its relationships left as ids. The verdict is the read's report of the row it loaded, which no related row changes; each language's probe no longer reads every related entry and file, which made opening an entry for editing read its relations once per configured language.

  • #5044 b593704 Thanks @hasnat-rx! - The SEO plugin no longer calls a structured data detail missing when it is mapped to one of the dates every entry holds by itself. SEO › Content types and an entry's SEO tab now judge a mapping to createdAt, updatedAt or firstPublishedAt as the page's structured data does, and the Content types screen offers Created and First published as sources for the date published and a video's upload date. A mapping into the plugin's own SEO group is no longer flagged either. A page not saved yet says when such a date will be set. plugin-sdk adds entryDateFieldNames (experimental), naming those dates from core's own declaration.

  • #5127 daedff9 Thanks @muzzamil-rx! - Settings has a Languages page: it lists each language with its code, writing direction, fallback and how much content it holds, and adds, renames, reorders and removes languages and changes the default after showing what that changes. Languages declared in the configuration are shown read-only, saying where they are set.

  • #5121 7776758 Thanks @aqib-rx! - nextly migrate follows more of a hand-written migration before it records one applied without running it. A constraint named inside a column's definition (author integer CONSTRAINT posts_author_fk REFERENCES users (id) DEFERRABLE) is checked as one written as its own clause: a PostgreSQL key's deferrability, a MySQL check's enforcement, a unique constraint's index. A later drop removes only an object of its own kind, so a DROP INDEX sharing a constraint's name no longer stops the constraint from being checked. A MySQL CREATE TABLE that declares an index with a method or order (INDEX i USING HASH (c)), or a full-text or spatial one, is refused as the CREATE INDEX form is. On SQLite, the AUTOINCREMENT counter is compared with the highest key inside SQLite in one statement, exact above 2^53, and a key declared PRIMARY KEY ON CONFLICT <resolution> AUTOINCREMENT is read as one. Files nextly migrate:create writes are unaffected: where the database does not stand as a hand-written file leaves it, the run stops with MIGRATION_NOT_PROVEN instead of recording it.

  • #5150 81ac406 Thanks @aqib-rx! - nextly migrate reads a hand-written migration's indexes, keys and constraints the same way however the statement is written, before it records the file applied without running it. On PostgreSQL and SQLite, a key or exclusion declared in a CREATE TABLE body (UNIQUE NULLS NOT DISTINCT, EXCLUDE, SQLite's UNIQUE (c DESC)) is now refused as not shown by the snapshot, as its ALTER TABLE ... ADD CONSTRAINT spelling already was, and an unnamed ALTER TABLE ... ADD EXCLUDE or ADD UNIQUE NULLS NOT DISTINCT is no longer read as adding a column. A MySQL index whose unquoted name is an order word (INDEX nulls (c)) is no longer refused. A key named inside a column that references an unquoted table named like a keyword (REFERENCES generated (id) DEFERRABLE) has its deferrability read. On SQLite, a table whose key is declared AUTOINCREMENT at the table's level (PRIMARY KEY (id AUTOINCREMENT)) has its counter checked as the column form's is, instead of being refused. Files nextly migrate:create writes are unaffected.

  • #5009 d7b6515 Thanks @faisal-rx! - Staff can retry and cancel a queued email.

    • Retry: POST /api/email-deliveries/queued/:id/retry (Direct API: nextly.email.retryQueued({ id })) retries a queued email now while its message is held.
      • A waiting or retrying email has its next attempt brought forward to now.
      • A failed email waits again, due now, with a fresh set of attempts. Its last failure shows until the next attempt replaces it.
      • A template email is rendered from its template as saved at that moment, so a retry after fixing the template sends the fixed version.
      • It is refused (CONFLICT, saying why) while an attempt is with the provider, and for an email already sent or cancelled, or whose message has been cleared.
    • Cancel: POST /api/email-deliveries/queued/:id/cancel cancels as nextly.email.cancelQueued does. While an attempt is with the provider, the cancel is a request: it takes effect only if that attempt fails.
    • Permissions: both need manage-email-deliveries, seeded to super-admin only.
    • In the admin: the Activity tab's detail sheet for a queued email offers Try again now and Cancel email to a person who may manage email deliveries. Cancel asks first. While an attempt is with the provider, only Cancel is offered, and it holds only if that attempt fails. An email whose message was cleared can be cancelled but not tried again. A refusal shows the server's reason, and the list and the sheet are read again either way.
    • Recorded: each retry and cancel by a person is written to the activity log as an update under email-deliveries, naming the queued email and the action. No address is recorded.
    • A queued email whose attempt stopped after its send was recorded now keeps the provider that sent it, read from that send's delivery records.
    • Plugins are told: when a person retries a failed email a plugin queued, the plugin hears state: "retrying" with the new optional retry: { by: "person", userId }, in the retry's own transaction. The attempts that follow count from 1 again. QueuedEmailChange.retry is a new optional field (@experimental).
  • #5128 92c2103 Thanks @mobeenabdullah! - On a site upgrading with committed migrations and no localization block, nextly migrate and nextly migrate:check no longer list its text-like columns as bare drops: each drop says it moves to the <table>_locales table, and the message names the fields, says nothing is lost, and gives the two safe ways forward (mark the fields localized: false, or declare localization on purpose). nextly migrate:create's refusal there says the same. Nothing about storage changes.

  • #5155 8776b10 Thanks @faisal-rx! - The admin package builds its type declarations again: the collection schema API declares its types, which declarations made from each module alone need. Nothing it does changes.

  • #5124 cb15bac Thanks @faisal-rx! - A translated field's type change now gives its translations column the new type. The Schema Builder save writes the column's change in a companion migration file of its own, retypes, ahead of the main one, and judges each language's value before anything runs. nextly migrate groups that file with its change and judges each language's value before either runs. A value one language holds that the new type cannot read refuses the change, naming that language's row. Such a change was refused before, whatever its values. It stays refused where the road doesn't carry the column's change: a change whose translations column changes only on a database other than the file's, a Single's save, and the code-first reload, db:sync and REST. A build before this one refuses a retypes file (header version 8) as one it does not support.

  • #5141 6c97ed2 Thanks @faisal-rx! - A translated relationship switched between storage shapes (one link becoming a list, the reverse, or to or from naming several collections) keeps its values again on PostgreSQL and MySQL. The companion migration file that gives a translations column its new type no longer casts such a column ahead of the switch's own statements, which carry each stored link into the new shape.

  • #5137 d1153eb Thanks @mobeenabdullah! - A start resolves every translation table's readiness with one table listing rather than one probe per translated collection, Single and field group, so its statements no longer grow with the number of entities. Reads that need the same table's readiness at the same moment share one probe.

  • #5135 b629f5c Thanks @mobeenabdullah! - The admin asks for a document's review state, and for whether anything can wait for its reader's review, only where a workflow holds something that reader may read. The signed-in workspace answer (GET /api/admin-meta/workspace) now carries workflowEntities: the collections and Singles a workflow holds that the reader may read, by slug. An entry of a collection no workflow holds is answered "no workflow" without a request, and a site with no workflow attached sends neither request on a list or an edit page. Where the workspace answer does not say (it failed, or comes from an older server), both are asked as before.

Packages

  • @nextlyhq/adapter-drizzle
  • @nextlyhq/adapter-mysql
  • @nextlyhq/adapter-postgres
  • @nextlyhq/adapter-sqlite
  • @nextlyhq/admin
  • @nextlyhq/admin-css
  • @nextlyhq/blocks-engine
  • @nextlyhq/blocks-react
  • @nextlyhq/builder
  • @nextlyhq/eslint-plugin
  • @nextlyhq/plugin-accounts
  • @nextlyhq/plugin-form-builder
  • @nextlyhq/plugin-mcp
  • @nextlyhq/plugin-page-builder
  • @nextlyhq/plugin-sdk
  • @nextlyhq/plugin-seo
  • @nextlyhq/storage-s3
  • @nextlyhq/storage-uploadthing
  • @nextlyhq/storage-vercel-blob
  • @nextlyhq/ui
  • create-nextly-app
  • nextly