postnhost 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/README.md +22 -9
- data/Rakefile +28 -0
- data/app/assets/builds/postnhost/application.css +1 -1
- data/app/assets/stylesheets/application.tailwind.css +5 -1
- data/app/controllers/postnhost/api/base_controller.rb +29 -0
- data/app/controllers/postnhost/api/v1/commands_controller.rb +27 -0
- data/app/controllers/postnhost/api/v1/mcp_controller.rb +49 -0
- data/app/controllers/postnhost/api_tokens_controller.rb +34 -0
- data/app/controllers/postnhost/articles/translations_controller.rb +2 -9
- data/app/controllers/postnhost/categories/translations_controller.rb +2 -9
- data/app/controllers/postnhost/management_preview_controller.rb +17 -0
- data/app/controllers/postnhost/pages/translations_controller.rb +2 -9
- data/app/helpers/postnhost/application_helper.rb +0 -11
- data/app/models/postnhost/api_token.rb +26 -0
- data/app/models/postnhost/user.rb +2 -0
- data/app/services/postnhost/api/v1/openapi.rb +27 -0
- data/app/services/postnhost/management/catalog.rb +151 -0
- data/app/services/postnhost/management/command.rb +174 -0
- data/app/services/postnhost/management/content_actions.rb +75 -0
- data/app/services/postnhost/management/input.rb +49 -0
- data/app/services/postnhost/management/mcp.rb +54 -0
- data/app/services/postnhost/management/preview.rb +25 -0
- data/app/services/postnhost/management/resources.rb +30 -0
- data/app/services/postnhost/management/schema_fields.rb +25 -0
- data/app/services/postnhost/management/serializer.rb +40 -0
- data/app/services/postnhost/management/settings_actions.rb +64 -0
- data/app/services/postnhost/management/upload.rb +18 -0
- data/app/services/postnhost/translation/enqueue.rb +59 -0
- data/app/views/layouts/postnhost/_sidebar.html.erb +7 -0
- data/app/views/layouts/postnhost/application.html.erb +2 -2
- data/app/views/layouts/postnhost/articles.html.erb +3 -3
- data/app/views/layouts/postnhost/product.html.erb +3 -3
- data/app/views/layouts/postnhost/public/templates/default.html.erb +2 -2
- data/app/views/layouts/postnhost/public/templates/swiss-editorial.html.erb +2 -2
- data/app/views/layouts/postnhost/public/templates/workspace-journal.html.erb +2 -2
- data/app/views/postnhost/api_tokens/index.html.erb +92 -0
- data/app/views/postnhost/onboarding/_post_install_checklist.html.erb +8 -8
- data/app/views/postnhost/pages/index.html.erb +1 -1
- data/app/views/postnhost/templates/edit.html.erb +1 -1
- data/config/routes.rb +12 -0
- data/db/migrate/20261008120000_create_api_tokens.rb +12 -0
- data/lib/generators/postnhost/install/install_generator.rb +11 -12
- data/lib/generators/postnhost/locale/locale_generator.rb +1 -1
- data/lib/generators/postnhost/static_pages/static_pages_generator.rb +1 -1
- data/lib/generators/postnhost/tailwindcss/install_generator.rb +28 -25
- data/lib/generators/postnhost/tailwindcss/templates/host.tailwind.css +0 -3
- data/lib/generators/postnhost/user/user_generator.rb +1 -1
- data/lib/generators/postnhost/views/views_generator.rb +5 -7
- data/lib/postnhost/css_build.rb +68 -0
- data/lib/postnhost/css_scope.rb +77 -0
- data/lib/postnhost/sample_data.rb +1 -1
- data/lib/postnhost/tailwind_compiler.rb +75 -0
- data/lib/postnhost/tailwind_input.rb +32 -0
- data/lib/postnhost/version.rb +1 -1
- data/lib/tasks/postnhost_tasks.rake +40 -65
- metadata +40 -2
- data/lib/generators/postnhost/tailwindcss/templates/tailwind.config.js +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 627ae55fdce85eb1586f9dd686b9b637a83443c5b3752bb9b932f563d972cc72
|
|
4
|
+
data.tar.gz: 29b259e49deacd46af93786df0bb5ee347a91ebc5ec8902d1b56cceb16c0a7d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e163ba13b11fed2c1840ccedb5d48523f89ea9039f5bf3b2d9fccc3ca02f2c2d82ed1d25133d08b6c5a0856ad3ff1df4b8ef0ba168603d3c9600862317a15ad3
|
|
7
|
+
data.tar.gz: f85efaf4ef237bb6119101c673ef8f57f1623f79e94fd488637590342b58b2c8c994d8189436f41bb8a7be9e41d068d069cd6e5a683e9f005dc83d6e0f60af03
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to PostnHost are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.0] - 2026-10-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Versioned JSON management API and Streamable HTTP MCP endpoint at `/api/v1/mcp`, relative to the engine mount path.
|
|
10
|
+
- 89 shared commands for CMS content, publishing, versions, uploads, translations, users, navigation, and settings, with command discovery and OpenAPI schemas.
|
|
11
|
+
- API & MCP dashboard for creating and revoking personal bearer tokens, with hashed token storage and one-time secret display.
|
|
12
|
+
|
|
13
|
+
### Improved
|
|
14
|
+
|
|
15
|
+
- Paginated management lists use compact summaries and bounded database queries; full content remains available through individual record commands.
|
|
16
|
+
- UI and management commands share translation enqueueing, preserving successfully queued work and cleaning up placeholders when enqueueing fails.
|
|
17
|
+
|
|
18
|
+
### Upgrading existing blogs
|
|
19
|
+
|
|
20
|
+
From your host application's directory, update any Gemfile constraint to allow PostnHost 0.2.0, then run:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bundle update postnhost
|
|
24
|
+
bin/rails postnhost:install:migrations
|
|
25
|
+
bin/rails db:migrate
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Commit the copied `db/migrate/*_create_api_tokens.postnhost.rb` migration and updated schema with your application. During production deployment, run `RAILS_ENV=production bin/rails db:migrate` before restarting the app.
|
|
29
|
+
|
|
30
|
+
The new `CreateApiTokens` migration creates the `postnhost_api_tokens` table. Existing blog content requires no backfill.
|
|
31
|
+
|
|
32
|
+
## [0.1.1] - 2026-08-31
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Scoped packaged and host-generated CSS to PostnHost layouts and replaced competing stylesheets with one combined host build that transparently shadows the packaged logical asset.
|
|
37
|
+
- Corrected installer, template customization, Tailwind setup, and production checklist instructions.
|
|
38
|
+
|
|
5
39
|
## [0.1.0] - 2026-08-29
|
|
6
40
|
|
|
7
41
|
First open source release of PostnHost.
|
|
@@ -22,4 +56,6 @@ First open source release of PostnHost.
|
|
|
22
56
|
|
|
23
57
|
Authored by Kirill Shevchenko (Ruby/Rails engineering) and Maxim Sova (technical SEO expertise).
|
|
24
58
|
|
|
59
|
+
[0.2.0]: https://github.com/postnhost/postnhost/compare/v0.1.1...v0.2.0
|
|
60
|
+
[0.1.1]: https://github.com/postnhost/postnhost/compare/v0.1.0...v0.1.1
|
|
25
61
|
[0.1.0]: https://github.com/postnhost/postnhost/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -42,8 +42,9 @@ Mount this engine into an existing Rails app, or use the <a href="https://github
|
|
|
42
42
|
- [Replacing favicon](#replacing-favicon)
|
|
43
43
|
- [Host app i18n](#host-app-i18n-optional)
|
|
44
44
|
- [Static pages](#static-pages-terms-privacy-etc)
|
|
45
|
+
- [API and MCP](#api-and-mcp)
|
|
45
46
|
- [Routes](#routes)
|
|
46
|
-
- [
|
|
47
|
+
- [Production checklist](#production-checklist)
|
|
47
48
|
- [Development](#development)
|
|
48
49
|
- [License](#license)
|
|
49
50
|
|
|
@@ -194,7 +195,6 @@ bin/dev
|
|
|
194
195
|
|
|
195
196
|
This generator creates:
|
|
196
197
|
|
|
197
|
-
- `postnhost.tailwind.config.js`
|
|
198
198
|
- `app/assets/stylesheets/postnhost/host.tailwind.css`
|
|
199
199
|
- `Procfile.dev` watcher entry:
|
|
200
200
|
- `postnhost_css: bundle exec rails postnhost:tailwindcss:watch`
|
|
@@ -202,8 +202,9 @@ This generator creates:
|
|
|
202
202
|
- `postnhost:tailwindcss`
|
|
203
203
|
- `postnhost:tailwindcss:watch`
|
|
204
204
|
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
Host-tailwind mode builds one combined stylesheet from the engine and host view sources at `app/assets/builds/postnhost/application.css`. That host-owned file transparently overrides the packaged asset with the same logical path; the engine always requests `postnhost/application`. This avoids competing Tailwind builds and lets copied views use ordinary classes such as `bg-red-500` or `md:grid`.
|
|
206
|
+
|
|
207
|
+
If the host build is absent, Rails uses the packaged engine asset automatically. Both packaged and combined stylesheets are limited to PostnHost layouts through the `data-postnhost` root attribute. You do not need to edit layout tags or prefix Tailwind classes. Host customization requires Tailwind CSS 4.
|
|
207
208
|
|
|
208
209
|
### Robots.txt sitemap URL (required)
|
|
209
210
|
|
|
@@ -295,6 +296,16 @@ Link helpers:
|
|
|
295
296
|
<%= link_to "Terms", postnhost.public_static_page_path(slug: "terms") %>
|
|
296
297
|
```
|
|
297
298
|
|
|
299
|
+
## API and MCP
|
|
300
|
+
|
|
301
|
+
Manage CMS content and settings through the versioned JSON command API and the
|
|
302
|
+
Streamable HTTP MCP endpoint. Open **API & MCP** in the CMS to create or revoke
|
|
303
|
+
bearer tokens. The API and MCP share the same discoverable commands, input schemas,
|
|
304
|
+
and publishing workflows.
|
|
305
|
+
|
|
306
|
+
Discover commands at `/api/v1/commands`, OpenAPI at `/api/v1/openapi`, and
|
|
307
|
+
connect MCP clients to `/api/v1/mcp`, relative to the engine mount path.
|
|
308
|
+
|
|
298
309
|
## Routes
|
|
299
310
|
|
|
300
311
|
The engine mounts at `/blog` by default. You can change this in `config/routes.rb`:
|
|
@@ -319,13 +330,15 @@ mount Postnhost::Engine, at: "/blog"
|
|
|
319
330
|
- `GET /sitemap.xml` - XML sitemap
|
|
320
331
|
- `GET /sitemap.xsl` - Sitemap stylesheet
|
|
321
332
|
|
|
322
|
-
##
|
|
333
|
+
## Production checklist
|
|
323
334
|
|
|
324
|
-
|
|
335
|
+
Review these host-application settings before deployment:
|
|
325
336
|
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
337
|
+
- Replace the host app’s favicon and related icon files if needed.
|
|
338
|
+
- Update `public/robots.txt` so its sitemap URL matches the production domain and engine mount path.
|
|
339
|
+
- Review the host app’s static `public/404.html` and `public/500.html` pages.
|
|
340
|
+
- Configure the generated CarrierWave initializer for S3-compatible production storage, or replace it with another storage configuration.
|
|
341
|
+
- If you customize the public templates, copy the required views and enable host Tailwind support when your changes introduce new utility classes.
|
|
329
342
|
|
|
330
343
|
## Development
|
|
331
344
|
|
data/Rakefile
CHANGED
|
@@ -2,6 +2,34 @@ require "bundler/setup"
|
|
|
2
2
|
require "fileutils"
|
|
3
3
|
|
|
4
4
|
require "bundler/gem_tasks"
|
|
5
|
+
require_relative "lib/postnhost/css_build"
|
|
6
|
+
|
|
7
|
+
css_build = lambda do |watch:|
|
|
8
|
+
root = __dir__
|
|
9
|
+
unscoped_path = File.join(root, "app/assets/builds/postnhost/application.unscoped.css")
|
|
10
|
+
output_path = File.join(root, "app/assets/builds/postnhost/application.css")
|
|
11
|
+
command = [
|
|
12
|
+
File.join(root, "node_modules/.bin/tailwindcss"),
|
|
13
|
+
"-i", File.join(root, "app/assets/stylesheets/application.tailwind.css"),
|
|
14
|
+
"-o", unscoped_path,
|
|
15
|
+
"--minify"
|
|
16
|
+
]
|
|
17
|
+
command << "--watch" if watch
|
|
18
|
+
|
|
19
|
+
Postnhost::CssBuild.run(command:, unscoped_path:, output_path:, watch:)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
namespace :css do
|
|
23
|
+
desc "Build the engine stylesheet"
|
|
24
|
+
task build: :environment do
|
|
25
|
+
css_build.call(watch: false)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "Build the engine stylesheet and watch for changes"
|
|
29
|
+
task watch: :environment do
|
|
30
|
+
css_build.call(watch: true)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
5
33
|
|
|
6
34
|
# Load dummy app so the Rails `environment` task exists (required by prepare_test_db).
|
|
7
35
|
require_relative "spec/dummy/config/application"
|