New Upstream Release - ruby-terser
Ready changes
Summary
Merged new upstream version: 1.1.16+dfsg (was: 1.1.12+dfsg).
Resulting package
Built on 2023-06-25T00:57 (took 4m49s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases ruby-terser
Lintian Result
Diff
diff --git a/.rubocop.yml b/.rubocop.yml
index 1dcba2d..fb3533a 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -174,8 +174,6 @@ Lint/EmptyClass:
Enabled: true
Style/NilLambda:
Enabled: true
-Gemspec/DateAssignment: # (new in 1.10)
- Enabled: true
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
Enabled: true
Layout/SpaceBeforeBrackets: # (new in 1.7)
@@ -220,6 +218,98 @@ Style/RedundantArgument: # (new in 1.4)
Enabled: true
Style/StringChars: # (new in 1.12)
Enabled: true
+Gemspec/DeprecatedAttributeAssignment: # new in 1.30
+ Enabled: true
+Gemspec/DevelopmentDependencies: # new in 1.44
+ Enabled: true
+Gemspec/RequireMFA: # new in 1.23
+ Enabled: true
+Layout/LineContinuationLeadingSpace: # new in 1.31
+ Enabled: true
+Layout/LineContinuationSpacing: # new in 1.31
+ Enabled: true
+Lint/AmbiguousOperatorPrecedence: # new in 1.21
+ Enabled: true
+Lint/AmbiguousRange: # new in 1.19
+ Enabled: true
+Lint/ConstantOverwrittenInRescue: # new in 1.31
+ Enabled: true
+Lint/DuplicateMagicComment: # new in 1.37
+ Enabled: true
+Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
+ Enabled: true
+Lint/NonAtomicFileOperation: # new in 1.31
+ Enabled: true
+Lint/RefinementImportMethods: # new in 1.27
+ Enabled: true
+Lint/RequireRangeParentheses: # new in 1.32
+ Enabled: true
+Lint/RequireRelativeSelfPath: # new in 1.22
+ Enabled: true
+Lint/UselessRescue: # new in 1.43
+ Enabled: true
+Lint/UselessRuby2Keywords: # new in 1.23
+ Enabled: true
+Naming/BlockForwarding: # new in 1.24
+ Enabled: true
+Security/CompoundHash: # new in 1.28
+ Enabled: true
+Security/IoMethods: # new in 1.22
+ Enabled: true
+Style/ArrayIntersect: # new in 1.40
+ Enabled: true
+Style/ComparableClamp: # new in 1.44
+ Enabled: true
+Style/ConcatArrayLiterals: # new in 1.41
+ Enabled: true
+Style/EmptyHeredoc: # new in 1.32
+ Enabled: true
+Style/EnvHome: # new in 1.29
+ Enabled: true
+Style/FetchEnvVar: # new in 1.28
+ Enabled: true
+Style/FileRead: # new in 1.24
+ Enabled: true
+Style/FileWrite: # new in 1.24
+ Enabled: true
+Style/MagicCommentFormat: # new in 1.35
+ Enabled: true
+Style/MapCompactWithConditionalBlock: # new in 1.30
+ Enabled: true
+Style/MapToHash: # new in 1.24
+ Enabled: true
+Style/MapToSet: # new in 1.42
+ Enabled: true
+Style/MinMaxComparison: # new in 1.42
+ Enabled: true
+Style/NestedFileDirname: # new in 1.26
+ Enabled: true
+Style/NumberedParameters: # new in 1.22
+ Enabled: true
+Style/NumberedParametersLimit: # new in 1.22
+ Enabled: true
+Style/ObjectThen: # new in 1.28
+ Enabled: true
+Style/OpenStructUse: # new in 1.23
+ Enabled: true
+Style/OperatorMethodCall: # new in 1.37
+ Enabled: true
+Style/RedundantConstantBase: # new in 1.40
+ Enabled: true
+Style/RedundantDoubleSplatHashBraces: # new in 1.41
+ Enabled: true
+Style/RedundantEach: # new in 1.38
+ Enabled: true
+Style/RedundantHeredocDelimiterQuotes: # new in 1.45
+ Enabled: true
+Style/RedundantInitialize: # new in 1.27
+ Enabled: true
+Style/RedundantSelfAssignmentBranch: # new in 1.19
+ Enabled: true
+Style/RedundantStringEscape: # new in 1.37
+ Enabled: true
+Style/SelectByRegexp: # new in 1.22
+ Enabled: true
Performance/AncestorsInclude:
Enabled: true
@@ -255,3 +345,7 @@ Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
Enabled: true
Performance/RedundantSplitRegexpArgument: # (new in 1.10)
Enabled: true
+Performance/ConcurrentMonotonicTime: # new in 1.12
+ Enabled: true
+Performance/StringIdentifierArgument: # new in 1.13
+ Enabled: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e17a73a..79e3585 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,18 @@
## Unreleased
+## 1.1.16 (01 June 2023)
+- update TerserJS to [5.17.7]
+
+## 1.1.15 (09 May 2023)
+- update TerserJS to [5.17.3]
+- add lhs_constants (default is true)
+
+## 1.1.14 (24 February 2023)
+- update TerserJS to [5.16.5]
+- update Rubocop
+
+## 1.1.13 (03 December 2022)
+- update TerserJS to [5.16.1]
+
## 1.1.12 (15 July 2022)
- update TerserJS to [5.14.2]
diff --git a/Gemfile b/Gemfile
index 9fb8694..1586891 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,9 +4,9 @@ source "https://rubygems.org"
gemspec
-unless RUBY_VERSION < '2.5'
+unless RUBY_VERSION < '2.6'
group :development do
- gem 'rubocop', '~> 1.18.0'
- gem 'rubocop-performance', '~> 1.11.3', :require => false
+ gem 'rubocop', '~> 1.46.0'
+ gem 'rubocop-performance', '~> 1.16.0', :require => false
end
end
diff --git a/README.md b/README.md
index 5226599..033a6bd 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,11 @@ in `config/environments/production.rb`.
Terser is available as a ruby gem.
$ gem install terser
+
+Or add to your Gemfile:
+
+ $ bundle add terser
+ $ bundle install
Ensure that your environment has a JavaScript interpreter supported by
[ExecJS](https://github.com/sstephenson/execjs). Using `miniracer` gem or NodeJS
@@ -125,6 +130,7 @@ Available options and their defaults are
:keep_fnames => false, # Do not drop names in function definitions
:passes => 1, # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
:keep_infinity => false, # Prevent compression of Infinity to 1/0
+ :lhs_constants => true, # Moves constant values to the left-hand side of binary nodes. `foo == 42 → 42 == foo`
:side_effects => true, # Pass false to disable potentially dropping functions marked as "pure" using pure comment annotation. See UglifyJS documentation for details.
:switches => true, # de-duplicate and remove unreachable switch branches
}, # Apply transformations to code, set to false to skip
diff --git a/debian/changelog b/debian/changelog
index 9169b9a..c89ece8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-terser (1.1.16+dfsg-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Sun, 25 Jun 2023 00:52:42 -0000
+
ruby-terser (1.1.12+dfsg-2) unstable; urgency=medium
* Team upload.
diff --git a/lib/terser.rb b/lib/terser.rb
index c2c708b..2070530 100644
--- a/lib/terser.rb
+++ b/lib/terser.rb
@@ -4,7 +4,7 @@
require "json"
require "base64"
require "execjs"
-require "terser/railtie" if defined?(::Rails::Railtie)
+require "terser/railtie" if defined?(Rails::Railtie)
require "terser/version"
# A wrapper around the Terser interface
@@ -85,6 +85,7 @@ class Terser
:keep_fnames => false, # Do not drop names in function definitions
:passes => 1, # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
:keep_infinity => false, # Prevent compression of Infinity to 1/0
+ :lhs_constants => true, # Moves constant values to the left-hand side of binary nodes. `foo == 42 → 42 == foo`
:side_effects => true, # Pass false to disable potentially dropping functions marked as "pure" using pure comment annotation. See TerserJS documentation for details.
:switches => true # de-duplicate and remove unreachable switch branches
}, # Apply transformations to code, set to false to skip
@@ -405,8 +406,8 @@ class Terser
if @options[:keep_fnames] || DEFAULTS[:keep_fnames]
true
else
- @options[type].respond_to?(:[]) && @options[type][:keep_fnames] ||
- DEFAULTS[type].respond_to?(:[]) && DEFAULTS[type][:keep_fnames]
+ (@options[type].respond_to?(:[]) && @options[type][:keep_fnames]) ||
+ (DEFAULTS[type].respond_to?(:[]) && DEFAULTS[type][:keep_fnames])
end
end
@@ -414,8 +415,8 @@ class Terser
if @options[:keep_classnames] || DEFAULTS[:keep_classnames]
true
else
- @options[type].respond_to?(:[]) && @options[type][:keep_classnames] ||
- DEFAULTS[type].respond_to?(:[]) && DEFAULTS[type][:keep_classnames]
+ (@options[type].respond_to?(:[]) && @options[type][:keep_classnames]) ||
+ (DEFAULTS[type].respond_to?(:[]) && DEFAULTS[type][:keep_classnames])
end
end
diff --git a/lib/terser/compressor.rb b/lib/terser/compressor.rb
index 51109ae..7daf5e2 100644
--- a/lib/terser/compressor.rb
+++ b/lib/terser/compressor.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'sprockets/digest_utils'
-require 'sprockets/source_map_utils' if Gem::Version.new(::Sprockets::VERSION) >= Gem::Version.new('4.x')
+require 'sprockets/source_map_utils' if Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new('4.x')
class Terser
# A wrapper for Sprockets
diff --git a/lib/terser/version.rb b/lib/terser/version.rb
index 68ff6f7..befa67b 100644
--- a/lib/terser/version.rb
+++ b/lib/terser/version.rb
@@ -2,5 +2,5 @@
class Terser
# Current version of Terser.
- VERSION = "1.1.12"
+ VERSION = "1.1.16"
end
diff --git a/terser.gemspec b/terser.gemspec
index 175b645..36c9782 100644
--- a/terser.gemspec
+++ b/terser.gemspec
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "execjs", [">= 0.3.0", "< 3"]
spec.add_development_dependency "bundler", ">= 1.3"
- spec.add_development_dependency "rake", "~> 12.0"
+ spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "sourcemap", "~> 0.1.1"
end
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/es5.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/split.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser/compressor.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser/railtie.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser/version.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/terser_wrapper.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/specifications/terser-1.1.16.gemspec lrwxrwxrwx root/root /usr/share/rubygems-integration/all/gems/terser-1.1.16/lib/source-map.js -> /usr/share/javascript/source-map/source-map.min.js
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/es5.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/split.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser/compressor.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser/railtie.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser/version.rb -rw-r--r-- root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/terser_wrapper.js -rw-r--r-- root/root /usr/share/rubygems-integration/all/specifications/terser-1.1.12.gemspec lrwxrwxrwx root/root /usr/share/rubygems-integration/all/gems/terser-1.1.12/lib/source-map.js -> /usr/share/javascript/source-map/source-map.min.js
No differences were encountered in the control files