Skip to content

Commit eabad0e

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature-layout-widget
2 parents a1a978f + 87b07c9 commit eabad0e

File tree

87 files changed

+11204
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+11204
-689
lines changed

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public-hoist-pattern[]=*

CHANGELOG.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,75 @@
44

55
### Adds
66

7+
* Custom operations registered with `addCreateWidgetOperation` can now specify an `ifTypesIntersect` property containing an array of widget type names. If the area in question allows at least one, the operation is offered.
8+
* The login-requirements tests were updated to include tests for the `uponSubmit` filter
9+
* Add `prependNodes` and `appendNodes` calls for `main`.
10+
* Add options for pieces to change the title, message and icon of the empty state block.
11+
12+
### Fixes
13+
14+
* Fixes a bug in the login `uponSubmit` filter where a user could login without meeting the requirement.
15+
* Fixes pieces filters when values from optional fields are falsy.
16+
* Resolve inline image URLs correctly when in edit mode and not in the default locale.
17+
* Using `CTRL+F` or `CMD+F` in the page manager now works.
18+
19+
### Changes
20+
21+
* Redirects to URLs containing accent marks and other non-ascii characters now behave as expected with Astro. Pre-encoding the URLs exactly the way `res.redirect` would before passing them to Astro prevents an error in Astro and allows the redirect to succeed.
22+
* Removes the non-functional `uniqueUsername` route from the `user` module
23+
* Modifies the `annotateAreaForExternalFront()` method of the `@apostrophecms/template` module to accept a per-module `annotateWidgetForExternalFront()` method. This allows widgets to send project-level options alongside the per-area options to external frontends.
24+
* Updated dependencies to address deprecation warnings.
25+
26+
## 4.21.1 (2025-09-26)
27+
28+
### Adds
29+
30+
* The `exit` option to the main `apostrophe()` function now supports the new string value `exit: 'throw'`. If this value is specified and the apostrophe startup procedure fails with an error, the actual error is re-thrown for the benefit of the caller.
31+
* For backwards compatibility, the existing `exit: false` option to the main `apostrophe()` function is still supported, but now logs the error that took place before returning `undefined` as before. This is more useful than the previous behavior, but `exit: 'throw'` is the more logical choice if you need to avoid a process exit.
32+
* The default behavior is still to log the error and exit the process, which isthe only sensible move in most single-site projects.
33+
34+
## 4.21.0 (2025-09-03)
35+
36+
### Adds
37+
38+
* Modules can now call `apos.area.addCreateWidgetOperation` to register a custom operation that invokes a modal and inserts the widget returned by that modal. These operations are offered as choices in all "add widget" menus, both regular and expanded.
39+
* `AposDocEditor` now accepts a `values` prop, which can be used to pass an object of initial values for some or all fields. Use of this prop is optional. It is not supported when editing existing documents.
40+
* `apos.doc.edit` now accepts an optional `values` object as the final parameter, containing initial values for some or all fields. This is supported only when editing existing documents.
41+
* When specifying a modal name to be executed, developers may now register "transformers" to be invoked first, using pipe syntax. For example, the modal name `aposSectionTemplateLibraryWidgetToDoc|AposDocEditor` will invoke the transformer `aposSectionTemplateLibraryWidgetToDoc` with the original props, and pass the returned result to `AposDocEditor`. Note that transformers are awaited. Transformers are registered in frontend admin UI code by passing a name and a function to `apos.ui.addTransformer`.
42+
* Adds quick image upload UI to `@apostrophecms/image-widget`.
43+
* Makes autocropping work when uploading or selecting images from the new quick image upload UI.
44+
45+
### Fixes
46+
47+
* The `?render-areas=1` API feature now correctly disregards areas in separate documents loaded via relationship fields. Formerly their presence resulted in an error, not a rendering.
48+
* Make conditional fields work in Image Editor.
49+
* Importing a custom icon from an npm module using a `~` path per the admin UI now works per the documentation, as long as the Vue component used for the icon is structured like those found in `@apostrophecms/vue-material-design-icons`.
50+
* The `button: true` flag works again for piece module utility operations. Previously the button appeared but did not trigger the desired operation.
51+
* Fix the fact that area options `minSize` and `aspectRatio` weren't passed to the image cropper when coming directly from the area and the widget controls (without passing through the widget editor).
52+
* Fixes the widget data being cloned to be saved before the `postprocess` method being called, which leads to a loss of data in `AposWidgetEditor` (like the autocrop data).
53+
* In editors like `AposWidgetEditor` relationships are now post processed after they are updated in `AposInputRelationship` only for the relationship that has been updated.
54+
It allows live preview to work well with it, it also avoids complexity and fixes updated data not being properly synced between the editor and the `AposSchema`.
55+
* Deeply nested widgets can now be edited properly via the editor dialog box. This longstanding issue did not affect on-page editing.
56+
57+
### Changes
58+
59+
* Rolled back a change in 4.16.0 that strictly enforced `required` and `min` for relationship fields. Because the related document can be archived or deleted at any time, it is misleading to offer such enforcement. Also, it greatly complicates adding these constraints to existing schemas, resulting in surprising and unwanted behaviors. Therefore it is better for these constraints to be soft constraints on the front end. `max` is still a hard constraint.
60+
* The `@apostrophecms/login/whoami` route now accepts both `POST` (recommended) and `GET` requests. Previously, it only supported `GET`. This maintains backwards compatibility while aligning with the documentation’s recommendation to use `POST`.
61+
62+
## 4.20.0 (2025-08-06)
63+
64+
### Adds
65+
766
* Adds any alt text found in an attribute to the media library attachment during import of rich text inline images by API
867
* Adds `prependNodes` and `appendNodes` methods to every module. These methods allow you to inject HTML to every page using a `node` declaration.
968

1069
### Changes
1170

71+
* A `clone-widget.js` file has been factored out, providing a universal way to return a clone of an existing widget which is distinct from the original.
72+
* Adds any alt text found in an attribute to the media library attachment during import of rich text inline images by API
73+
* Adds `prependNodes` and `appendNodes` methods to every module. These methods allow you to inject HTML to every page using a `node` declaration.
1274
* Changes handling of `order` and `groups` in the `admin-bar` module to respect, rather that reverse, the order of items
13-
* Interacting with the text inside a rich text widget will hide the widget controls to prevent awkawrd text selection.
75+
* Interacting with the text inside a rich text widget will hide the widget controls to prevent awkward text selection.
1476

1577
### Fixes
1678

README.md

Lines changed: 112 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,142 @@
1-
![Unit Tests](https://github.com/apostrophecms/apostrophe/actions/workflows/main.yml/badge.svg)
2-
[![Chat on Discord](https://img.shields.io/discord/517772094482677790.svg)](https://chat.apostrophecms.org)
3-
4-
<p align="center">
1+
<div align="center">
52
<a href="https://github.com/apostrophecms/apostrophe">
63
<img src="logo.svg" alt="ApostropheCMS logo" width="80" height="80">
74
</a>
85

9-
<h3 align="center">ApostropheCMS 3</h3>
6+
<h1>ApostropheCMS</h1>
7+
8+
<p>
9+
<a aria-label="Join the community on Discord" href="http://chat.apostrophecms.org">
10+
<img alt="" src="https://img.shields.io/discord/517772094482677790?color=5865f2&label=Join%20the%20Discord&logo=discord&logoColor=fff&labelColor=000&style=for-the-badge&logoWidth=20" />
11+
</a>
12+
<a aria-label="License" href="https://github.com/apostrophecms/apostrophe/blob/main/LICENSE.md">
13+
<img alt="" src="https://img.shields.io/static/v1?style=for-the-badge&labelColor=000000&label=License&message=MIT&color=3DA639" />
14+
</a>
15+
</p>
1016

11-
<p align="center">
12-
ApostropheCMS is a full-featured, open source CMS built with Node.js that seeks to empower organizations by combining in-context editing and headless architecture in a full-stack JS environment.
17+
<p>
18+
<strong>Full-stack CMS for developers and content teams</strong><br />
19+
Build websites with in-context editing and headless flexibility using Node.js and MongoDB.
1320
<br />
14-
<a href="https://v3.docs.apostrophecms.org/"><strong>Documentation »</strong></a>
21+
<a href="https://docs.apostrophecms.org/"><strong>Documentation »</strong></a>
1522
<br />
1623
<br />
1724
<a href="http://demo.apostrophecms.com">Demo</a>
1825
·
19-
<a href="https://portal.productboard.com/apostrophecms/1-product-roadmap/tabs/2-planned">Roadmap</a>
26+
<a href="https://productlane.com/edit-roadmap">Roadmap</a>
2027
·
2128
<a href="https://github.com/apostrophecms/apostrophe/issues/new?assignees=&labels=bug,3.0&template=bug_report.md&title=">Report Bug</a>
2229
</p>
23-
</p>
30+
</div>
31+
32+
## About
33+
34+
ApostropheCMS is a full-stack content management system built with Node.js and MongoDB. Content creators can edit directly on live pages without switching between admin interfaces, while developers can build with modern JavaScript or use it headlessly with any frontend framework.
35+
36+
### Key Features
37+
38+
- **🎯 In-Context Editing** - Content creators edit directly on the live page, seeing changes instantly
39+
- **⚡ Headless-Ready** - Use any frontend framework while keeping the powerful admin experience
40+
- **🛠️ Developer-First** - Built with Node.js and MongoDB for full-stack JavaScript development
41+
- **📈 Scales Beautifully** - From small sites to enterprise applications handling millions of pages
42+
- **🔐 Enterprise Features** - Advanced permissions, workflow management, automated translations, and more
43+
44+
## System Requirements
45+
46+
| Requirement | Version | Installation Notes |
47+
|-------------|---------|-------------------|
48+
| **Node.js** | 20.x+ | Use [NVM](https://github.com/nvm-sh/nvm) for version management |
49+
| **MongoDB** | 6.0+ | [MongoDB Atlas](https://www.mongodb.com/atlas) (cloud) or local install |
50+
| **npm** | 10.x+ | Included with Node.js |
51+
52+
See our [setup guides](https://docs.apostrophecms.org/guide/development-setup.html) for installation instructions.
53+
54+
## Quick Start
55+
56+
Get ApostropheCMS running locally in minutes:
57+
58+
```bash
59+
# Option 1: Install CLI globally (recommended for multiple projects)
60+
npm install -g @apostrophecms/cli
61+
apos create my-website
62+
cd my-website
63+
npm run dev
64+
65+
# Option 2: Use npx for one-time project creation
66+
npx @apostrophecms/cli create my-website
67+
cd my-website
68+
npm run dev
69+
```
2470

25-
## About ApostropheCMS
71+
Your new ApostropheCMS site will be available at `http://localhost:3000` with a powerful admin interface at `/login`.
2672

27-
ApostropheCMS is content software for everyone in an organization. It helps teams of all sizes create dynamic digital experiences with elegance and efficiency by blending powerful features, developer happiness, and a low learning curve for content creators. Apostrophe has powered websites and web apps for organizations large and small for over a decade.
73+
### Prefer to Go Headless?
2874

29-
#### Built With
75+
**Get started with Astro integration** - the easiest way to build headless sites while keeping visual editing:
3076

31-
* [Node](https://nodejs.org/en/)
32-
* [MongoDB](https://www.mongodb.com/)
33-
* [Nunjucks](https://mozilla.github.io/nunjucks/)
77+
- **[Apollo Starter Kit (Astro)](https://apostrophecms.com/starter-kits/apollo-starter-kit-for-astro-cms)** - Production-ready foundation with beautiful design system and rich content features
78+
- **[Essentials Starter Kit (Astro)](git clone https://github.com/apostrophecms/starter-kit-astro-essentials)** - Minimal, clean foundation for building custom designs from scratch
3479

35-
## Getting Started
80+
Both starter kits provide headless CMS power with in-context editing, letting content creators edit directly on the live site while you build with modern frontend tools. Our Astro integration handles all the content fetching automatically—no REST API calls to write.
3681

37-
To get started with Apostrophe 3, follow these steps to set up a local development environment. For more detail, refer to the [A3 getting started guide](https://a3.docs.apostrophecms.org/guide/setting-up.html) in the documentation.
82+
**Desire a different frontend framework?** Use our REST APIs with React, Vue, Svelte, or any other framework:
3883

39-
#### Prerequisites
84+
- **[REST API Documentation](https://docs.apostrophecms.org/reference/api/pieces.html)** - Complete API reference
85+
- **[Headless CMS Guide](https://docs.apostrophecms.org/guide/headless-cms.html)** - Integration walkthrough for any framework
4086

41-
We recommend installing the following with [Homebrew](https://brew.sh/) on macOS. If you're on Linux, you should use your package manager (apt or yum). If you're on Windows, we recommend the Windows Subsystem for Linux.
87+
### Hosting & Deployment
4288

43-
| Software | Minimum Version | Notes
44-
| ------------- | ------------- | -----
45-
| Node.js | 12.x | Or better
46-
| npm | 6.x | Or better
47-
| MongoDB | 3.6 | Or better
48-
| Imagemagick | Any | Faster image uploads, GIF support (optional)
89+
Choose [ApostropheCMS hosting](https://apostrophecms.com/hosting) for turnkey solutions with optimized performance and dedicated support, or deploy to [any platform where Node.js runs](https://docs.apostrophecms.org/guide/hosting.html).
4990

50-
## Community
91+
## Built With Modern Tech
5192

52-
[Discord](https://discord.com/invite/XkbRNq7) - [Twitter](https://twitter.com/apostrophecms) - [Discussions](https://github.com/apostrophecms/apostrophe/discussions)
93+
- **[Node.js](https://nodejs.org/)** - JavaScript runtime for server-side development
94+
- **[MongoDB](https://www.mongodb.com/)** - Flexible document database for content storage
95+
- **ESM Modules** - Native ES6 module support for modern JavaScript
96+
- **Vite** - Lightning-fast build tool and development server
97+
- **Modern JavaScript** - ES6+, async/await, and contemporary development patterns
98+
99+
## Community & Support
100+
101+
**Join other developers and content creators using ApostropheCMS:**
102+
103+
- **[Discord](https://discord.com/invite/XkbRNq7)** - Get help, share projects, and connect with other users
104+
- **[GitHub Discussions](https://github.com/apostrophecms/apostrophe/discussions)** - Feature requests, technical discussions, and community support
105+
- **[Documentation](https://docs.apostrophecms.org/)** - Comprehensive guides, tutorials, and API references
53106

54107
## Contributing
55108

56-
We eagerly welcome open source contributions. Before submitting a PR, please read through our [Contribution Guide](https://github.com/apostrophecms/apostrophe/blob/main/CONTRIBUTING.md)
109+
We welcome contributions from the community! Whether you're fixing bugs, adding features, or improving documentation, your help makes ApostropheCMS better for everyone.
110+
111+
- **[Contribution Guide](https://github.com/apostrophecms/apostrophe/blob/main/CONTRIBUTING.md)** - How to contribute code, documentation, and feedback
112+
- **[Good First Issues](https://github.com/apostrophecms/apostrophe/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)** - Perfect starting points for new contributors
113+
114+
115+
## Pro Features
116+
117+
**For teams and organizations requiring additional features:**
118+
119+
- **🔐 Advanced User Management** - Granular permissions, user groups, and access controls
120+
- **🌍 Automated Translation** - AI-powered translation with DeepL, Google Translate, and Azure
121+
- **📊 Analytics & SEO** - Built-in SEO optimization and content analytics
122+
- **⚡ Performance Optimization** - Advanced caching, CDN integration, and performance monitoring
123+
- **🏢 Multisite Management** - Manage multiple sites from a single dashboard with shared resources
124+
- **💼 Professional Support** - Dedicated support, training, and consultation services
125+
126+
[Explore all the pro extensions](https://apostrophecms.com/extensions?autocomplete=&license=assembly&license=pro) and [sign up](https://app.apostrophecms.com/login) for a Pro license in our self-service Apostrophe Workspaces, or [contact us](https://apostrophecms.com/contact-us) to learn about licensing and support options.
57127

58128
## License
59129

60-
ApostropheCMS is released under the [ MIT License](https://github.com/apostrophecms/apostrophe/blob/main/LICENSE.md).
130+
ApostropheCMS is open source software licensed under the [MIT License](https://github.com/apostrophecms/apostrophe/blob/main/LICENSE.md). This means you're free to use, modify, and distribute it for both personal and commercial projects.
131+
132+
---
133+
134+
<div align="center">
135+
<p>
136+
<strong>Ready to build something amazing?</strong><br>
137+
<a href="https://docs.apostrophecms.org/">Get started with our documentation</a> or <a href="https://apostrophecms.com/contact-us">talk to our team</a>
138+
</p>
139+
<p>
140+
<em>Built with ❤️ by the <a href="https://apostrophecms.com">ApostropheCMS team</a></em>
141+
</p>
142+
</div>

eslint.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const apostrophe = require('eslint-config-apostrophe').default;
2+
const { defineConfig, globalIgnores } = require('eslint/config');
3+
4+
module.exports = defineConfig([
5+
globalIgnores([
6+
'**/vendor/**/*.js',
7+
'**/blueimp/**/*.js',
8+
'test/public',
9+
'test/apos-build',
10+
'coverage'
11+
]),
12+
apostrophe
13+
]);

index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,16 @@ async function apostrophe(options, telemetry, rootSpan) {
350350

351351
return self;
352352
} catch (e) {
353-
if (options.exit !== false) {
353+
if (options.exit === false) {
354+
console.error('apostrophe: error occurred during startup, continuing:');
355+
console.error(e);
356+
// returns undefined, for legacy reasons
357+
} else if (options.exit === 'throw') {
358+
// A more sensible approach for those who want to do something
359+
// if initialization fails
360+
throw e;
361+
} else {
362+
// Longstanding default behavior
354363
console.error(e);
355364
await self._exit(1, e);
356365
}
@@ -752,7 +761,7 @@ async function apostrophe(options, telemetry, rootSpan) {
752761
if (self.argv[`ignore-${name}`]) {
753762
return;
754763
}
755-
/* eslint-disable-next-line no-console */
764+
756765
console.warn(message);
757766
}
758767
}

lib/moog-require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = async function(options) {
8787
);
8888
projectLevelDefinition = defaultProjectLevelDefinition;
8989
if (Object.keys(projectLevelDefinition).length === 0) {
90-
/* eslint-disable-next-line no-console */
90+
9191
console.warn(`⚠️ The file ${projectLevelPath}\ndoes not export anything, did you misspell or forget module.exports?\n`);
9292
}
9393
}

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarMenu.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
:is="item.options.component"
7373
v-if="item.options.component"
7474
:key="`${item.name}.component`"
75+
:action="item.action"
7576
/>
7677
<AposButton
7778
v-else

0 commit comments

Comments
 (0)