alchemy_cms 6.0.0.b3 → 6.0.0.pre.b4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8fcd022eba5fdba4ce96cfe4971344ced0191b6d12d9cbd7bad923b07b7359a
4
- data.tar.gz: 9dfbf5f590c6c2e8d562bf81daeb8faf3a1358f5f46aeb8857adef4d48fd6181
3
+ metadata.gz: fb49f5d73d0fe450fc5b15c1a31b8ea9db3c281a0ffbc10ea41fac56617f0ba8
4
+ data.tar.gz: a0a78888094965fc097dcfe0642ef1ea22905300abff1659257d8ae2b7990670
5
5
  SHA512:
6
- metadata.gz: 82cc3e7f0c3b0e8fb8a4d2219d8237d66db02275b878951be1fcc0d12f9a7fdd750415ad45b5af03a05e6abce298c718551541dc80774c689b395d758d39d942
7
- data.tar.gz: 665d8a15204e872ab41867e1466c4611fec7c46f83d862669c89d3e5c3038f30fa1dfb45fb56d227a71b92c945a9c45de9a5d887bbb726af9d49b5c87121d2c9
6
+ metadata.gz: 0ce83617901077c47a15d5e3e3ec48e3f78ff1c879a18467a44aab0c20d69b59f4a7eb698b49688ca6e7d5cd45b1127196084943c4604d7474ea588eeae176e9
7
+ data.tar.gz: 6e13fe6a39778668e02f5f09c475db1029f28fb42f8f439464798f017169ee28247f45e3a444c5c82a88d2d928cbdc4492ce5ba4d21dea509e61cb8098b8102f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.0.0-b4 (2021-08-27)
2
+
3
+ - Load custom Tinymce config for ingredients [#2182](https://github.com/AlchemyCMS/alchemy_cms/pull/2182) ([tvdeyen](https://github.com/tvdeyen))
4
+ - Fix ingredient editor selector in element update callback [#2181](https://github.com/AlchemyCMS/alchemy_cms/pull/2181) ([tvdeyen](https://github.com/tvdeyen))
5
+ - Ingredient by role block level helper [#2180](https://github.com/AlchemyCMS/alchemy_cms/pull/2180) ([tvdeyen](https://github.com/tvdeyen))
6
+ - Fixes caching [#2179](https://github.com/AlchemyCMS/alchemy_cms/pull/2179) ([tvdeyen](https://github.com/tvdeyen))
7
+ - make images non-executable [#2176](https://github.com/AlchemyCMS/alchemy_cms/pull/2176) ([mensfeld](https://github.com/mensfeld))
8
+ - Release task [#2173](https://github.com/AlchemyCMS/alchemy_cms/pull/2173) ([tvdeyen](https://github.com/tvdeyen))
9
+
1
10
  ## 6.0.0.b3 (2021-08-12)
2
11
 
3
12
  ### Fixes
data/README.md CHANGED
@@ -339,6 +339,10 @@ $ bin/rails s
339
339
 
340
340
  ## 📦 Releasing
341
341
 
342
+ ### Bump version
343
+
344
+ Bump the version number in both `lib/alchemy/version.rb` and `./package.json`. Make sure both are exactly the same and follow [SemVer format](https://semver.org/#semantic-versioning-specification-semver).
345
+
342
346
  ### Update the changelog
343
347
 
344
348
  ```bash
@@ -346,12 +350,20 @@ $ export GITHUB_ACCESS_TOKEN=...
346
350
  $ PREVIOUS_VERSION=4.1.0 bundle exec rake alchemy:changelog:update
347
351
  ```
348
352
 
349
- ### Release a new version
353
+ ### Commit version bump
350
354
 
351
355
  ```bash
352
- $ bundle exec rake release
356
+ $ git commit -am "Bump version to vX.Y.Z"
353
357
  ```
354
358
 
359
+ ### Release a new version
360
+
361
+ This task will publish both the ruby gem and the npm package.
362
+ It also tags the latest commit.
363
+
364
+ ```bash
365
+ $ bundle exec rake alchemy:release
366
+ ```
355
367
 
356
368
  ## ❓Getting Help
357
369
 
data/Rakefile CHANGED
@@ -1,37 +1,37 @@
1
1
  begin
2
- require 'bundler/setup'
2
+ require "bundler/setup"
3
3
  rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
4
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
5
5
  end
6
6
 
7
7
  begin
8
- require 'rdoc/task'
8
+ require "rdoc/task"
9
9
  rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
10
+ require "rdoc/rdoc"
11
+ require "rake/rdoctask"
12
12
  RDoc::Task = Rake::RDocTask
13
13
  end
14
14
 
15
- desc 'Generate documentation for Alchemy CMS.'
15
+ desc "Generate documentation for Alchemy CMS."
16
16
  RDoc::Task.new(:rdoc) do |rdoc|
17
- rdoc.rdoc_dir = 'rdoc'
18
- rdoc.title = 'Alchemy CMS'
19
- rdoc.options << '--line-numbers' << '--inline-source'
20
- rdoc.rdoc_files.include('README.md')
21
- rdoc.rdoc_files.include('config/alchemy/*.yml')
22
- rdoc.rdoc_files.include('lib/**/*.rb')
23
- rdoc.rdoc_files.include('app/**/*.rb')
17
+ rdoc.rdoc_dir = "rdoc"
18
+ rdoc.title = "Alchemy CMS"
19
+ rdoc.options << "--line-numbers" << "--inline-source"
20
+ rdoc.rdoc_files.include("README.md")
21
+ rdoc.rdoc_files.include("config/alchemy/*.yml")
22
+ rdoc.rdoc_files.include("lib/**/*.rb")
23
+ rdoc.rdoc_files.include("app/**/*.rb")
24
24
  end
25
25
 
26
- APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
27
- load 'rails/tasks/engine.rake'
26
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
27
+ load "rails/tasks/engine.rake"
28
28
 
29
- require 'rspec/core'
30
- require 'rspec/core/rake_task'
29
+ require "rspec/core"
30
+ require "rspec/core/rake_task"
31
31
 
32
32
  RSpec::Core::RakeTask.new(:spec)
33
33
 
34
- task default: ['alchemy:spec:prepare', :spec]
34
+ task default: ["alchemy:spec:prepare", :spec]
35
35
 
36
36
  Bundler::GemHelper.install_tasks
37
37
 
@@ -56,11 +56,11 @@ namespace :alchemy do
56
56
  namespace :changelog do
57
57
  desc "Update CHANGELOG from GitHub (Set GITHUB_ACCESS_TOKEN and PREVIOUS_VERSION to a version you want to write changelog changes for)"
58
58
  task :update do
59
- original_file = './CHANGELOG.md'
60
- new_file = original_file + '.new'
61
- backup = original_file + '.old'
62
- changes = `git rev-list v#{ENV['PREVIOUS_VERSION']}..HEAD | bundle exec github_fast_changelog AlchemyCMS/alchemy_cms`
63
- File.open(new_file, 'w') do |fo|
59
+ original_file = "./CHANGELOG.md"
60
+ new_file = original_file + ".new"
61
+ backup = original_file + ".old"
62
+ changes = `git rev-list v#{ENV["PREVIOUS_VERSION"]}..HEAD | bundle exec github_fast_changelog AlchemyCMS/alchemy_cms`
63
+ File.open(new_file, "w") do |fo|
64
64
  fo.puts changes
65
65
  File.foreach(original_file) do |li|
66
66
  fo.puts li
@@ -72,4 +72,18 @@ namespace :alchemy do
72
72
  File.delete(backup)
73
73
  end
74
74
  end
75
+
76
+ desc "Release a new Ruby gem and npm package in one command"
77
+ task :release do
78
+ require "json"
79
+ require_relative "lib/alchemy/version"
80
+ package = File.read("package.json")
81
+ unless JSON.parse(package)["version"] == Alchemy.version
82
+ abort "Ruby gem and npm package versions are out of sync! Please fix."
83
+ end
84
+ # Release the Ruby gem with bundler
85
+ Rake::Task["release"].invoke
86
+ # Publish npm package via CLI
87
+ system "npm publish"
88
+ end
75
89
  end
File without changes
@@ -77,6 +77,12 @@ module Alchemy
77
77
  end
78
78
 
79
79
  deprecate essence: "Use `ingredient_by_role` instead", deprecator: Alchemy::Deprecation
80
+
81
+ # Return's the ingredient record by given role.
82
+ #
83
+ def ingredient_by_role(role)
84
+ element.ingredient_by_role(role)
85
+ end
80
86
  end
81
87
 
82
88
  # Block-level helper for element views. Constructs a DOM element wrapping
@@ -267,20 +267,6 @@ module Alchemy
267
267
  "alchemy/elements/#{name}"
268
268
  end
269
269
 
270
- # Returns the key that's taken for cache path.
271
- #
272
- # Uses the page's +published_at+ value that's updated when the user publishes the page.
273
- #
274
- # If the page is the current preview it uses the element's updated_at value as cache key.
275
- #
276
- def cache_key
277
- if Page.current_preview == page
278
- "alchemy/elements/#{id}-#{updated_at}"
279
- else
280
- "alchemy/elements/#{id}-#{page.published_at}"
281
- end
282
- end
283
-
284
270
  # A collection of element names that can be nested inside this element.
285
271
  def nestable_elements
286
272
  definition.fetch("nestable_elements", [])
@@ -110,22 +110,13 @@ module Alchemy
110
110
  # If the page is the current preview it uses the updated_at value as cache key.
111
111
  #
112
112
  def cache_key
113
- if Page.current_preview == self
113
+ if Page.current_preview == id
114
114
  "alchemy/pages/#{id}-#{updated_at}"
115
115
  else
116
116
  "alchemy/pages/#{id}-#{published_at}"
117
117
  end
118
118
  end
119
119
 
120
- # We use the published_at value for the cache_key.
121
- #
122
- # If no published_at value is set yet, i.e. because it was never published,
123
- # we return the updated_at value.
124
- #
125
- def published_at
126
- read_attribute(:published_at) || updated_at
127
- end
128
-
129
120
  # Returns true if the page cache control headers should be set.
130
121
  #
131
122
  # == Disable Alchemy's page caching globally
@@ -198,13 +198,13 @@ module Alchemy
198
198
  %w[name urlname title]
199
199
  end
200
200
 
201
- # Used to store the current page previewed in the edit page template.
201
+ # Used to store the current page id previewed in the edit page template.
202
202
  #
203
203
  def current_preview=(page)
204
- RequestStore.store[:alchemy_current_preview] = page
204
+ RequestStore.store[:alchemy_current_preview] = page&.id
205
205
  end
206
206
 
207
- # Returns the current page previewed in the edit page template.
207
+ # Returns the current page id previewed in the edit page template.
208
208
  #
209
209
  def current_preview
210
210
  RequestStore.store[:alchemy_current_preview]
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Alchemy
4
4
  class PageVersion < BaseRecord
5
- belongs_to :page, class_name: "Alchemy::Page", inverse_of: :versions
5
+ belongs_to :page, class_name: "Alchemy::Page", inverse_of: :versions, touch: true
6
6
 
7
7
  has_many :elements, -> { order(:position) },
8
8
  class_name: "Alchemy::Element",
@@ -1,7 +1,7 @@
1
1
  (function() {
2
2
  var $el = $('#element_<%= @element.id %>');
3
3
  var $errors = $('#element_<%= @element.id %>_errors');
4
- $('> .element-content .content_editor, > .element-content .ingredient_editor', $el).removeClass('validation_failed');
4
+ $('> .element-content .content_editor, > .element-content .ingredient-editor', $el).removeClass('validation_failed');
5
5
 
6
6
  <%- if @element_validated -%>
7
7
 
@@ -138,7 +138,7 @@
138
138
  <% end %>
139
139
 
140
140
  <% content_for :javascripts do %>
141
- <% if Alchemy::Tinymce.custom_config_contents(@page).present? %>
141
+ <% if Alchemy::Tinymce.custom_configs_present?(@page) %>
142
142
  <%= render 'tinymce_custom_config' %>
143
143
  <% end %>
144
144
 
@@ -34,6 +34,10 @@ module Alchemy
34
34
  @@init
35
35
  end
36
36
 
37
+ def custom_configs_present?(page)
38
+ custom_config_contents(page).any? || custom_config_ingredients(page).any?
39
+ end
40
+
37
41
  def custom_config_contents(page)
38
42
  content_definitions_from_elements(page.descendent_element_definitions)
39
43
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.0.b3"
4
+ VERSION = "6.0.0-b4"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.0-b2",
3
+ "version": "6.0.0-b4",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.b3
4
+ version: 6.0.0.pre.b4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -10,10 +10,10 @@ authors:
10
10
  - Hendrik Mans
11
11
  - Carsten Fregin
12
12
  - Martin Meyerhoff
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-08-12 00:00:00.000000000 Z
16
+ date: 2021-08-27 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -1517,8 +1517,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1517
1517
  requirements:
1518
1518
  - ImageMagick (libmagick), v6.6 or greater.
1519
1519
  rubygems_version: 3.1.6
1520
- signing_key:
1520
+ signing_key:
1521
1521
  specification_version: 4
1522
1522
  summary: A powerful, userfriendly and flexible CMS for Rails
1523
1523
  test_files: []
1524
- ...