Merge pull request !2919 from rhodecode-enterprise-ce babel-6-to-7-upgrade
Changes from branch: Babel 6 to 7 upgrade
This commit is contained in:
commit
9790153ed6
8 changed files with 3302 additions and 9211 deletions
14
.babelrc
14
.babelrc
|
|
@ -1,16 +1,20 @@
|
|||
{
|
||||
"assumptions": {
|
||||
"setPublicClassFields": true
|
||||
},
|
||||
"presets": [
|
||||
[
|
||||
"env",
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"esmodules": true
|
||||
},
|
||||
"exclude": ["transform-es2015-classes"]
|
||||
"exclude": [
|
||||
"@babel/transform-classes",
|
||||
"@babel/transform-regenerator",
|
||||
"@babel/transform-async-generator-functions"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"transform-object-rest-spread"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
3
Makefile
3
Makefile
|
|
@ -160,10 +160,9 @@ docs-cleanup:
|
|||
|
||||
.PHONY: web-build
|
||||
# web-build: Build JS packages static/js
|
||||
# TODO need to upgrade to webpack 5 and remove -e NODE_OPTIONS=--openssl-legacy-provider
|
||||
web-build:
|
||||
rm -rf node_modules
|
||||
docker run -it --rm -e NODE_OPTIONS=--openssl-legacy-provider -v $(PWD):/project --workdir=/project rhodecode/static-files-build:24 -c "npm install && /project/node_modules/.bin/grunt"
|
||||
docker run -it --rm -v $(PWD):/project --workdir=/project rhodecode/static-files-build:24 -c "npm install && /project/node_modules/.bin/grunt"
|
||||
# run static file check
|
||||
./rhodecode/tests/scripts/static-file-check.sh rhodecode/public/
|
||||
rm -rf node_modules
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@
|
|||
},
|
||||
"concat": {
|
||||
"dist": {
|
||||
"options": {
|
||||
"separator": ";"
|
||||
},
|
||||
"src": [
|
||||
"<%= dirs.js.node_modules %>/jquery/dist/jquery.min.js",
|
||||
"<%= dirs.js.node_modules %>/mousetrap/mousetrap.min.js",
|
||||
|
|
@ -97,6 +100,9 @@
|
|||
"nonull": true
|
||||
},
|
||||
"ext": {
|
||||
"options": {
|
||||
"separator": ";"
|
||||
},
|
||||
"src": [
|
||||
"<%= dirs.js.src %>/codemirror/codemirror.js",
|
||||
"<%= dirs.js.src %>/codemirror/codemirror_loadmode.js",
|
||||
|
|
@ -116,35 +122,10 @@
|
|||
"dist": {
|
||||
"options": {
|
||||
"compress": {
|
||||
"ecma": 6,
|
||||
"arrows": false,
|
||||
"collapse_vars": false,
|
||||
"comparisons": false,
|
||||
"computed_props": false,
|
||||
"hoist_funs": false,
|
||||
"hoist_props": false,
|
||||
"hoist_vars": false,
|
||||
"inline": false,
|
||||
"loops": false,
|
||||
"negate_iife": false,
|
||||
"properties": false,
|
||||
"reduce_funcs": false,
|
||||
"reduce_vars": false,
|
||||
"switches": false,
|
||||
"toplevel": false,
|
||||
"typeofs": false,
|
||||
"booleans": true,
|
||||
"if_return": true,
|
||||
"sequences": true,
|
||||
"unused": true,
|
||||
"conditionals": true,
|
||||
"dead_code": true,
|
||||
"evaluate": true
|
||||
"ecma": 6
|
||||
},
|
||||
"mangle": {
|
||||
"keep_classnames": true,
|
||||
"keep_fnames": false,
|
||||
"reserved": ["noChange", "nothing"]
|
||||
"reserved": ["T", "A", "noChange", "nothing", "html", "css", "svg", "render", "LitElement", "ReactiveElement", "customElements"]
|
||||
},
|
||||
"output": {
|
||||
"ecma": 6
|
||||
|
|
@ -159,35 +140,10 @@
|
|||
"ext": {
|
||||
"options": {
|
||||
"compress": {
|
||||
"ecma": 6,
|
||||
"arrows": false,
|
||||
"collapse_vars": false,
|
||||
"comparisons": false,
|
||||
"computed_props": false,
|
||||
"hoist_funs": false,
|
||||
"hoist_props": false,
|
||||
"hoist_vars": false,
|
||||
"inline": false,
|
||||
"loops": false,
|
||||
"negate_iife": false,
|
||||
"properties": false,
|
||||
"reduce_funcs": false,
|
||||
"reduce_vars": false,
|
||||
"switches": false,
|
||||
"toplevel": false,
|
||||
"typeofs": false,
|
||||
"booleans": true,
|
||||
"if_return": true,
|
||||
"sequences": true,
|
||||
"unused": true,
|
||||
"conditionals": true,
|
||||
"dead_code": true,
|
||||
"evaluate": true
|
||||
"ecma": 6
|
||||
},
|
||||
"mangle": {
|
||||
"keep_classnames": true,
|
||||
"keep_fnames": false,
|
||||
"reserved": ["noChange", "nothing"]
|
||||
"reserved": ["T", "A"]
|
||||
},
|
||||
"output": {
|
||||
"ecma": 6
|
||||
|
|
|
|||
12339
package-lock.json
generated
12339
package-lock.json
generated
File diff suppressed because it is too large
Load diff
38
package.json
38
package.json
|
|
@ -9,17 +9,18 @@
|
|||
"url": "https://code.rhodecode.com/rhodecode-enterprise-ce"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.0",
|
||||
"@babel/plugin-transform-class-properties": "^7.27.1",
|
||||
"@babel/plugin-transform-private-methods": "^7.24.0",
|
||||
"@babel/plugin-transform-private-property-in-object": "^7.24.0",
|
||||
"@babel/preset-env": "^7.24.0",
|
||||
"@webcomponents/webcomponentsjs": "^2.8.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-syntax-class-properties": "^6.13.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.0",
|
||||
"babel-loader": "^9.1.3",
|
||||
"clipboard": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.4.2",
|
||||
"css-loader": "^0.28.11",
|
||||
"exports-loader": "^0.6.4",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"core-js": "^3.36.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"exports-loader": "^5.0.0",
|
||||
"favico.js": "^0.3.10",
|
||||
"filepond": "^4.32.10",
|
||||
"grunt": "^1.6.1",
|
||||
|
|
@ -30,27 +31,26 @@
|
|||
"grunt-contrib-less": "^3.0.0",
|
||||
"grunt-contrib-watch": "^1.1.0",
|
||||
"grunt-terser": "^2.0.0",
|
||||
"grunt-webpack": "^4.0.3",
|
||||
"html-loader": "^0.4.4",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"imports-loader": "^0.7.1",
|
||||
"grunt-webpack": "^6.0.0",
|
||||
"html-loader": "^5.1.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"imports-loader": "^5.0.0",
|
||||
"install": "^0.13.0",
|
||||
"jquery": "^3.7.1",
|
||||
"jshint": "^2.9.1-rc3",
|
||||
"jshint": "^2.13.6",
|
||||
"luxon": "^3.7.2",
|
||||
"mark.js": "8.11.1",
|
||||
"mousetrap": "^1.6.1",
|
||||
"raw-loader": "1.0.0-beta.0",
|
||||
"sticky-sidebar": "3.3.1",
|
||||
"style-loader": "^0.21.0",
|
||||
"style-loader": "^4.0.0",
|
||||
"sweetalert2": "^11.26.3",
|
||||
"ts-loader": "^1.3.3",
|
||||
"waypoints": "4.0.1",
|
||||
"webpack": "4.46.0",
|
||||
"webpack-cli": "3.3.12"
|
||||
"webpack": "^5.95.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit": "^2.8.0",
|
||||
"regenerator-runtime": "^0.13.9"
|
||||
"regenerator-runtime": "^0.14.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
17
rhodecode/public/js/rhodecode-components.js.LICENSE.txt
Normal file
17
rhodecode/public/js/rhodecode-components.js.LICENSE.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
|
@ -227,10 +227,11 @@ export class RhodecodeToast extends LitElement {
|
|||
if (!templateContext.rhodecode_user.notification_status && !data.message.force) {
|
||||
return;
|
||||
}
|
||||
this.toasts = [...this.toasts, {
|
||||
const newToast = {
|
||||
level: data.message.level,
|
||||
message: data.message.message
|
||||
}];
|
||||
};
|
||||
this.toasts = [...this.toasts, newToast];
|
||||
}
|
||||
|
||||
_gettext(x) {
|
||||
|
|
|
|||
|
|
@ -12,25 +12,29 @@ if (process.env.RC_STATIC_DIR) {
|
|||
|
||||
// doing it this way because it seems that plugin via grunt does not pick up .babelrc
|
||||
let babelRCOptions = {
|
||||
"assumptions": {
|
||||
"setPublicClassFields": true
|
||||
},
|
||||
"presets": [
|
||||
["env", {
|
||||
["@babel/preset-env", {
|
||||
"targets": {
|
||||
"esmodules": true
|
||||
},
|
||||
"exclude": [
|
||||
"transform-es2015-classes",
|
||||
"transform-regenerator",
|
||||
"transform-async-to-generator"
|
||||
"@babel/transform-classes",
|
||||
"@babel/transform-regenerator",
|
||||
"@babel/transform-async-generator-functions"
|
||||
]
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
["transform-class-properties", { "loose": true }],
|
||||
"transform-object-rest-spread"
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
optimization: {
|
||||
minimize: false, // Disable webpack minification - grunt-terser handles final minification
|
||||
usedExports: false, // Disable tree-shaking - it breaks Lit's re-exports
|
||||
},
|
||||
// Tell Webpack which file kicks off our app.
|
||||
entry: {
|
||||
main: path.resolve(__dirname, 'rhodecode/public/js/src/components/index.js'),
|
||||
|
|
@ -53,8 +57,8 @@ module.exports = {
|
|||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /style-lit.css/,
|
||||
use: 'raw-loader'
|
||||
test: /style-lit\.css$/,
|
||||
type: 'asset/source'
|
||||
},
|
||||
{
|
||||
// Babel-loader for JS files
|
||||
|
|
@ -63,8 +67,13 @@ module.exports = {
|
|||
use: {loader: 'babel-loader', options: babelRCOptions}
|
||||
},
|
||||
{
|
||||
test: /intl-messageformat.min.js/,
|
||||
use: 'imports-loader?this=>window'
|
||||
test: /intl-messageformat\.min\.js$/,
|
||||
use: {
|
||||
loader: 'imports-loader',
|
||||
options: {
|
||||
wrapper: 'window'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue