Skip to content

Commit ef518a4

Browse files
committed
GPU-1097 Update to jQuery 3.7.0, move building to eslint, esbuild and postcss
1 parent b7b13e0 commit ef518a4

29 files changed

+5813
-86780
lines changed

.eslintrc.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"amd": true,
6+
"commonjs": false
7+
},
8+
"extends": "eslint:recommended",
9+
"parserOptions": {
10+
"ecmaVersion": "latest"
11+
},
12+
"rules": {
13+
"no-mixed-spaces-and-tabs": "off",
14+
"no-useless-escape": "off",
15+
"no-unused-vars": "off",
16+
"no-extra-semi": "off",
17+
"no-undef": "off",
18+
"no-redeclare": "off",
19+
"no-fallthrough": "off",
20+
"no-prototype-builtins": "off",
21+
"no-empty": "off",
22+
"no-unexpected-multiline": "off",
23+
"no-cond-assign": "off",
24+
"no-extra-boolean-cast": "off",
25+
"no-self-assign": "off",
26+
"no-global-assign": "off",
27+
"no-control-regex": "off",
28+
"no-shadow-restricted-names": "off",
29+
"no-constant-condition": "off",
30+
"no-misleading-character-class": "off",
31+
"no-dupe-else-if": "off",
32+
"valid-typeof": "off"
33+
},
34+
"plugins": [
35+
"requirejs"
36+
]
37+
}

bin/build-aloha-editor.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
3+
# Default build profile.
4+
BUILD_PROFILE=build-profile-with-common-extra-plugins
5+
6+
# Make sure we are in the top-level directory of the project.
7+
cd $(dirname $(readlink -f "$0"))/..
8+
9+
# If a valid build profile was passed as argument, use that one.
10+
if [ -f "build/aloha/${1%.js}.js" ]
11+
then
12+
BUILD_PROFILE="${1%.js}"
13+
fi
14+
15+
run_command() {
16+
MSG="$1"
17+
18+
echo $MSG
19+
20+
shift
21+
$@
22+
23+
RESULT=$?
24+
25+
if [ $RESULT != 0 ]
26+
then
27+
echo "Error while executing '$@', aborting build"
28+
29+
exit $RESULT
30+
fi
31+
32+
echo "(${MSG}done)"
33+
echo
34+
}
35+
36+
run_command "Installing dependencies..." npm install -SD --no-fund --no-audit
37+
run_command "Performing linting..." npx eslint src/lib
38+
run_command "Building Aloha-Editor $BUILD_PROFILE..." npx r.js -o "build/aloha/$BUILD_PROFILE.js"
39+
40+
run_command "Building Aloha-Editor $BUILD_PROFILE (full)..." npx esbuild build/aloha/entrypoint-full.js --bundle --outfile="target/$BUILD_PROFILE/lib/aloha-full.js"
41+
run_command "Building Aloha-Editor $BUILD_PROFILE (full; minified)..." npx esbuild build/aloha/entrypoint-full.js --bundle --minify --sourcemap --outfile="target/$BUILD_PROFILE/lib/aloha-full.min.js"
42+
43+
run_command "Building Aloha-Editor $BUILD_PROFILE (bare)..." npx esbuild build/aloha/entrypoint-bare.js --bundle --outfile="target/$BUILD_PROFILE/lib/aloha-bare.js"
44+
run_command "Building Aloha-Editor $BUILD_PROFILE (bare; minified)..." npx esbuild build/aloha/entrypoint-bare.js --bundle --minify --sourcemap --outfile="target/$BUILD_PROFILE/lib/aloha-bare.min.js"
45+
46+
run_command "Building Aloha-Editor CSS..." npx postcss src/css/aloha-common-extra.css -u postcss-import -u cssnano -o "target/$BUILD_PROFILE/css/aloha.css"

build/aloha/build-profile-with-common-extra-plugins.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// We don't include Aloha's patched jquery by default, the user
4141
// should do it himself.
4242
"jquery": "empty:",
43-
//"jquery": 'vendor/jquery-1.7.2',
43+
//"jquery": 'vendor/jquery-3.7.0',
4444

4545
// We do include Aloha's patched jquery-ui by default, but the
4646
// user can override it if he is adventurous.
@@ -212,7 +212,7 @@
212212
//The directory path to save the output. If not specified, then
213213
//the path will default to be a directory called "build" as a sibling
214214
//to the build file. All relative paths are relative to the build file.
215-
dir: "../../target/build-profile-with-common-extra-plugins/rjs-output",
215+
dir: "../../target/build-profile-with-common-extra-plugins",
216216

217217
//As of RequireJS 2.0.2, the dir above will be deleted before the
218218
//build starts again. If you have a big build and are not doing

build/aloha/build-profile-with-common-plugins.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@
4040
// We don't include Aloha's patched jquery by default, the user
4141
// should do it himself.
4242
"jquery": "empty:",
43-
//"jquery": 'vendor/jquery-1.7.2',
43+
//"jquery": 'vendor/jquery-3.7.0',
4444

4545
// We do include Aloha's patched jquery-ui by default, but the
4646
// user can override it if he is adventurous.
47-
"jqueryui": 'vendor/jquery-ui-1.9.0.custom-aloha',
47+
"jqueryui": 'vendor/jquery-ui-1.13.2',
4848

4949
// For the repository browser
5050
'PubSub': 'vendor/pubsub/js/pubsub-unminified',
5151
'Class': 'vendor/class',
5252
'RepositoryBrowser': 'vendor/repository-browser/js/repository-browser-unminified',
5353
'jstree': 'vendor/jquery.jstree', // Mutates jquery
5454
'jqgrid': 'vendor/jquery.jqgrid', // Mutates jquery
55-
'jquery-layout': 'vendor/jquery.layout-1.3.0-rc29.14', // Mutates jquery
55+
'jquery-layout': 'vendor/jquery.layout', // Mutates jquery
5656
'jqgrid-locale-en': 'vendor/grid.locale.en', // Mutates jqgrid
5757
'jqgrid-locale-de': 'vendor/grid.locale.de', // Mutates jqgrid
5858
'repository-browser-i18n-de': 'vendor/repository-browser/js/repository-browser-unminified',
@@ -212,7 +212,7 @@
212212
//The directory path to save the output. If not specified, then
213213
//the path will default to be a directory called "build" as a sibling
214214
//to the build file. All relative paths are relative to the build file.
215-
dir: "../../target/build-profile-with-common-plugins/rjs-output",
215+
dir: "../../target/build-profile-with-common-plugins/",
216216

217217
//As of RequireJS 2.0.2, the dir above will be deleted before the
218218
//build starts again. If you have a big build and are not doing

build/aloha/entrypoint-bare.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('./license-header.frag')
2+
require('../../target/build-profile-with-common-extra-plugins/lib/aloha')

build/aloha/entrypoint-full.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require('../../target/build-profile-with-common-extra-plugins/lib/require')
2+
require('../../target/build-profile-with-common-extra-plugins/lib/vendor/jquery-3.7.0')
3+
require('../../target/build-profile-with-common-extra-plugins/lib/aloha-jquery-noconflict')
4+
require('./license-header.frag')
5+
require('../../target/build-profile-with-common-extra-plugins/lib/aloha')
File renamed without changes.

build/assembly/cdn-package.xml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<assembly
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
5+
<id>cdn</id>
6+
<formats>
7+
<format>zip</format>
8+
</formats>
9+
10+
<fileSets>
11+
<!-- Other non-core files -->
12+
<fileSet>
13+
<directory>${project.basedir}/target/${build.profile}</directory>
14+
<outputDirectory>/</outputDirectory>
15+
<excludes>
16+
<!-- Don't include the core -->
17+
<exclude>lib/aloha/*.js</exclude>
18+
<exclude>lib/aloha.js</exclude>
19+
<exclude>**/*.less</exclude>
20+
<exclude>test/**</exclude>
21+
<exclude>**/.gitmodules</exclude>
22+
<!-- Don't include the examples -->
23+
<exclude>**/test/**</exclude>
24+
<exclude>**/example/**</exclude>
25+
<exclude>**/demo/**</exclude>
26+
</excludes>
27+
</fileSet>
28+
29+
<!-- Workaround for jquery-ui dependency
30+
<fileSet>
31+
<directory>${project.basedir}/target/${build.profile}/rjs-output</directory>
32+
<outputDirectory>/</outputDirectory>
33+
<includes>
34+
<include>lib/aloha/jquery-ui.js</include>
35+
</includes>
36+
</fileSet>
37+
-->
38+
</fileSets>
39+
40+
<files>
41+
<!-- License -->
42+
<file>
43+
<source>${project.basedir}/LICENSE.txt</source>
44+
<outputDirectory>/</outputDirectory>
45+
<destName>LICENSE.txt</destName>
46+
</file>
47+
48+
<!-- Default version of aloha (the minified bare version) -->
49+
<file>
50+
<source>${project.basedir}/target/${build.profile}/lib/aloha-bare.min.js</source>
51+
<outputDirectory>/lib</outputDirectory>
52+
<destName>aloha.js</destName>
53+
<filtered>true</filtered>
54+
</file>
55+
56+
<!-- package.json file -->
57+
<file>
58+
<source>${project.basedir}/src/package.json</source>
59+
<outputDirectory>/</outputDirectory>
60+
<filtered>true</filtered>
61+
</file>
62+
</files>
63+
64+
<includeBaseDirectory>false</includeBaseDirectory>
65+
</assembly>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<assembly
2-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
55
<id>bin</id>
66
<formats>
77
<format>zip</format>
@@ -15,66 +15,34 @@
1515
<destName>README</destName>
1616
<filtered>true</filtered>
1717
</file>
18-
18+
1919
<!-- License -->
2020
<file>
2121
<source>${project.basedir}/LICENSE.txt</source>
2222
<outputDirectory>/alohaeditor-${project.version}</outputDirectory>
2323
<destName>LICENSE.txt</destName>
2424
</file>
25-
25+
2626
<!-- package.json file -->
2727
<file>
2828
<source>${project.basedir}/src/package.json</source>
2929
<outputDirectory>/alohaeditor-${project.version}/aloha</outputDirectory>
3030
<filtered>true</filtered>
3131
</file>
32-
33-
<!-- Bare Version (No require, No jquery) - minified -->
34-
<file>
35-
<source>${project.basedir}/target/${build.profile}/minified-bare/${build.profile}-bare.js</source>
36-
<outputDirectory>/alohaeditor-${project.version}/aloha/lib</outputDirectory>
37-
<destName>aloha-bare.min.js</destName>
38-
<filtered>true</filtered>
39-
</file>
40-
41-
<!-- Bare Version (No require, No jquery) - unminified -->
42-
<file>
43-
<source>${project.basedir}/target/${build.profile}/debug-bare/${build.profile}-bare.js</source>
44-
<outputDirectory>/alohaeditor-${project.version}/aloha/lib</outputDirectory>
45-
<destName>aloha-bare.js</destName>
46-
<filtered>true</filtered>
47-
</file>
48-
49-
<!-- All inclusive version of aloha -->
50-
<file>
51-
<source>${project.basedir}/target/${build.profile}/minified-full/${build.profile}.js</source>
52-
<outputDirectory>/alohaeditor-${project.version}/aloha/lib</outputDirectory>
53-
<destName>aloha-full.min.js</destName>
54-
<filtered>true</filtered>
55-
</file>
56-
57-
<file>
58-
<source>${project.basedir}/target/${build.profile}/debug-full/${build.profile}.js</source>
59-
<outputDirectory>/alohaeditor-${project.version}/aloha/lib</outputDirectory>
60-
<destName>aloha-full.js</destName>
61-
<filtered>true</filtered>
62-
</file>
6332

6433
<!-- Default version of aloha (the minified bare version) -->
6534
<file>
66-
<source>${project.basedir}/target/${build.profile}/minified-bare/${build.profile}-bare.js</source>
35+
<source>${project.basedir}/target/${build.profile}/lib/aloha-bare.min.js</source>
6736
<outputDirectory>/alohaeditor-${project.version}/aloha/lib</outputDirectory>
6837
<destName>aloha.js</destName>
6938
<filtered>true</filtered>
7039
</file>
7140
</files>
7241

73-
7442
<fileSets>
75-
<!-- Other non core files -->
43+
<!-- Other non-core files -->
7644
<fileSet>
77-
<directory>${project.basedir}/target/${build.profile}/rjs-output</directory>
45+
<directory>${project.basedir}/target/${build.profile}</directory>
7846
<outputDirectory>/alohaeditor-${project.version}/aloha</outputDirectory>
7947
<excludes>
8048
<!-- Don't include the core -->
@@ -86,14 +54,15 @@
8654
</excludes>
8755
</fileSet>
8856

89-
<!-- Workaround for jquery-ui dependency -->
57+
<!-- Workaround for jquery-ui dependency
9058
<fileSet>
9159
<directory>${project.basedir}/target/${build.profile}/rjs-output</directory>
9260
<outputDirectory>/alohaeditor-${project.version}/aloha</outputDirectory>
9361
<includes>
9462
<include>lib/aloha/jquery-ui.js</include>
9563
</includes>
9664
</fileSet>
65+
-->
9766

9867
<!-- guides / api -->
9968
<fileSet>
@@ -102,7 +71,7 @@
10271
<includes>
10372
<include>**/*</include>
10473
</includes>
105-
</fileSet>
74+
</fileSet>
10675
</fileSets>
10776
<includeBaseDirectory>false</includeBaseDirectory>
10877
</assembly>
File renamed without changes.

0 commit comments

Comments
 (0)