mirror of https://github.com/mastodon/mastodon
Upgrade to Yarn 4, remove support for Node 16 (#27073)
parent
23e32a4b30
commit
757d7c73c0
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/lib/index.js b/lib/index.js
|
||||||
|
index 16ed6be8be8f555cc99096c2ff60954b42dc313d..d009c069770d066ad0db7ad02de1ea473a29334e 100644
|
||||||
|
--- a/lib/index.js
|
||||||
|
+++ b/lib/index.js
|
||||||
|
@@ -99,7 +99,7 @@ function lodash(_ref) {
|
||||||
|
|
||||||
|
var node = _ref3;
|
||||||
|
|
||||||
|
- if ((0, _types.isModuleDeclaration)(node)) {
|
||||||
|
+ if ((0, _types.isImportDeclaration)(node) || (0, _types.isExportDeclaration)(node)) {
|
||||||
|
isModule = true;
|
||||||
|
break;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/dist/index.js b/dist/index.js
|
||||||
|
index 57e375592d984e9a429bcd9f800fa2d15cd662e4..0c47d96df3608e23adfd77d887a8f72abbd501c0 100644
|
||||||
|
--- a/dist/index.js
|
||||||
|
+++ b/dist/index.js
|
||||||
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
-var _crypto = _interopRequireDefault(require("crypto"));
|
||||||
|
+var _createHash = _interopRequireDefault(require("webpack/lib/util/createHash"));
|
||||||
|
|
||||||
|
var _path = _interopRequireDefault(require("path"));
|
||||||
|
|
||||||
|
@@ -227,7 +227,7 @@ class CompressionPlugin {
|
||||||
|
originalAlgorithm: this.options.algorithm,
|
||||||
|
compressionOptions: this.options.compressionOptions,
|
||||||
|
name,
|
||||||
|
- contentHash: _crypto.default.createHash("md4").update(input).digest("hex")
|
||||||
|
+ contentHash: _createHash.default("md4").update(input).digest("hex")
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
cacheData.name = (0, _serializeJavascript.default)({
|
@ -1,49 +0,0 @@
|
|||||||
# test directories
|
|
||||||
__tests__
|
|
||||||
test
|
|
||||||
tests
|
|
||||||
powered-test
|
|
||||||
|
|
||||||
# asset directories
|
|
||||||
docs
|
|
||||||
doc
|
|
||||||
website
|
|
||||||
images
|
|
||||||
# assets
|
|
||||||
|
|
||||||
# examples
|
|
||||||
example
|
|
||||||
examples
|
|
||||||
|
|
||||||
# code coverage directories
|
|
||||||
coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# build scripts
|
|
||||||
Makefile
|
|
||||||
Gulpfile.js
|
|
||||||
Gruntfile.js
|
|
||||||
|
|
||||||
# configs
|
|
||||||
.tern-project
|
|
||||||
.gitattributes
|
|
||||||
.editorconfig
|
|
||||||
.*ignore
|
|
||||||
.eslintrc
|
|
||||||
.jshintrc
|
|
||||||
.flowconfig
|
|
||||||
.documentup.json
|
|
||||||
.yarn-metadata.json
|
|
||||||
.*.yml
|
|
||||||
*.yml
|
|
||||||
|
|
||||||
# misc
|
|
||||||
*.gz
|
|
||||||
*.md
|
|
||||||
|
|
||||||
# for specific ignore
|
|
||||||
!.svgo.yml
|
|
||||||
!sass-lint/**/*.yml
|
|
||||||
|
|
||||||
# breaks lint-staged or generally anything using https://github.com/eemeli/yaml/issues/384
|
|
||||||
!**/yaml/dist/**/doc
|
|
@ -0,0 +1 @@
|
|||||||
|
nodeLinker: node-modules
|
@ -0,0 +1,34 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Disable this task as we use pnpm
|
||||||
|
|
||||||
|
require 'semantic_range'
|
||||||
|
|
||||||
|
Rake::Task['webpacker:check_yarn'].clear
|
||||||
|
|
||||||
|
namespace :webpacker do
|
||||||
|
desc 'Verifies if Yarn is installed'
|
||||||
|
task check_yarn: :environment do
|
||||||
|
begin
|
||||||
|
yarn_version = `yarn --version`.strip
|
||||||
|
raise Errno::ENOENT if yarn_version.blank?
|
||||||
|
|
||||||
|
yarn_range = '>=4 <5'
|
||||||
|
is_valid = begin
|
||||||
|
SemanticRange.satisfies?(yarn_version, yarn_range)
|
||||||
|
rescue
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
unless is_valid
|
||||||
|
warn "Mastodon and Webpacker requires Yarn \"#{yarn_range}\" and you are using #{yarn_version}"
|
||||||
|
warn 'Exiting!'
|
||||||
|
exit!
|
||||||
|
end
|
||||||
|
rescue Errno::ENOENT
|
||||||
|
warn 'Yarn not installed. Please see the Mastodon documentation to install the correct version.'
|
||||||
|
warn 'Exiting!'
|
||||||
|
exit!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue