@qooxdoo/framework 7.2.1 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Manifest.json +1 -1
- package/lib/compiler/compile-info.json +55 -55
- package/lib/compiler/index.js +718 -474
- package/lib/resource/qx/tool/schema/compile-1-0-0.json +4 -0
- package/npm-shrinkwrap.json +23 -23
- package/package.json +3 -2
- package/source/class/qx/bom/webfonts/Manager.js +16 -8
- package/source/class/qx/core/MEvent.js +91 -22
- package/source/class/qx/core/MObjectId.js +8 -0
- package/source/class/qx/core/MProperty.js +45 -5
- package/source/class/qx/core/Object.js +5 -1
- package/source/class/qx/data/MBinding.js +6 -4
- package/source/class/qx/data/controller/CheckedList.js +2 -2
- package/source/class/qx/test/Interface.js +12 -10
- package/source/class/qx/test/core/Property.js +104 -0
- package/source/class/qx/theme/simple/Appearance.js +35 -0
- package/source/class/qx/theme/simple/Decoration.js +16 -0
- package/source/class/qx/theme/tangible/Appearance.js +9 -9
- package/source/class/qx/tool/cli/Cli.js +4 -0
- package/source/class/qx/tool/cli/Watch.js +3 -0
- package/source/class/qx/tool/cli/commands/Compile.js +5 -3
- package/source/class/qx/tool/cli/commands/Es6ify.js +51 -0
- package/source/class/qx/tool/compiler/Analyser.js +62 -13
- package/source/class/qx/tool/compiler/ClassFile.js +30 -48
- package/source/class/qx/tool/compiler/Console.js +2 -0
- package/source/class/qx/tool/compiler/Es6ify.js +1 -0
- package/source/class/qx/tool/compiler/targets/Target.js +7 -3
- package/source/class/qx/tool/compiler/targets/meta/Browserify.js +21 -14
- package/source/class/qx/tool/compiler/targets/meta/Uglify.js +2 -0
- package/source/class/qx/tool/config/Abstract.js +4 -0
- package/source/class/qx/ui/basic/Image.js +1 -1
- package/source/class/qx/ui/basic/Label.js +2 -3
- package/source/class/qx/ui/container/Composite.js +0 -11
- package/source/class/qx/ui/control/DateChooser.js +39 -0
- package/source/class/qx/ui/core/MChildrenHandling.js +4 -0
- package/source/class/qx/ui/core/MLayoutHandling.js +4 -0
- package/source/class/qx/ui/core/MRemoteLayoutHandling.js +11 -2
- package/source/class/qx/ui/form/FileSelectorButton.js +30 -18
- package/source/class/qx/ui/form/MForm.js +3 -2
- package/source/class/qx/ui/form/Slider.js +13 -13
- package/source/class/qx/ui/form/validation/Manager.js +29 -4
- package/source/class/qx/ui/layout/Canvas.js +4 -1
- package/source/class/qx/ui/tabview/Page.js +9 -0
- package/source/class/qx/ui/tabview/ScrollingPage.js +54 -0
- package/source/class/qx/ui/toolbar/FileSelectorButton.js +6 -4
- package/source/class/qx/ui/toolbar/ToolBar.js +6 -2
- package/source/resource/qx/tool/schema/compile-1-0-0.json +4 -0
- package/source/translation/ru.po +2 -2
|
@@ -1060,6 +1060,110 @@ qx.Class.define("qx.test.core.Property", {
|
|
|
1060
1060
|
object.setPropTwo(arr2);
|
|
1061
1061
|
this.assertIdentical(savePropTwo, object.getPropTwo());
|
|
1062
1062
|
this.assertArrayEquals(["2", "3"], savePropTwo.toArray());
|
|
1063
|
+
},
|
|
1064
|
+
|
|
1065
|
+
testPromises() {
|
|
1066
|
+
const promiseDelay = (delay, fn) => new qx.Promise(resolve => {
|
|
1067
|
+
setTimeout(async () => {
|
|
1068
|
+
await fn();
|
|
1069
|
+
resolve();
|
|
1070
|
+
}, delay);
|
|
1071
|
+
});
|
|
1072
|
+
|
|
1073
|
+
qx.Class.define("qxl.TestPromises", {
|
|
1074
|
+
extend: qx.core.Object,
|
|
1075
|
+
|
|
1076
|
+
construct() {
|
|
1077
|
+
super();
|
|
1078
|
+
this.state = [];
|
|
1079
|
+
},
|
|
1080
|
+
|
|
1081
|
+
properties: {
|
|
1082
|
+
propOne: {
|
|
1083
|
+
init: null,
|
|
1084
|
+
nullable: true,
|
|
1085
|
+
apply: "_applyPropOne",
|
|
1086
|
+
event: "changePropOne"
|
|
1087
|
+
},
|
|
1088
|
+
|
|
1089
|
+
propTwo: {
|
|
1090
|
+
init: null,
|
|
1091
|
+
nullable: true,
|
|
1092
|
+
async: true,
|
|
1093
|
+
apply: "_applyPropTwo",
|
|
1094
|
+
event: "changePropTwo"
|
|
1095
|
+
}
|
|
1096
|
+
},
|
|
1097
|
+
|
|
1098
|
+
members: {
|
|
1099
|
+
state: null,
|
|
1100
|
+
|
|
1101
|
+
async _applyPropOne(value) {
|
|
1102
|
+
await promiseDelay(10, () => {
|
|
1103
|
+
this.state.push("apply-one");
|
|
1104
|
+
});
|
|
1105
|
+
return "apply-one";
|
|
1106
|
+
},
|
|
1107
|
+
async _applyPropTwo(value) {
|
|
1108
|
+
await promiseDelay(10, () => {
|
|
1109
|
+
this.state.push("apply-two");
|
|
1110
|
+
});
|
|
1111
|
+
return "apply-two";
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
const createTestPromise = () => {
|
|
1117
|
+
let tp = new qxl.TestPromises();
|
|
1118
|
+
tp.addListener("changePropOne", async evt => {
|
|
1119
|
+
await promiseDelay(1, () => {
|
|
1120
|
+
evt.getTarget().state.push("event-one");
|
|
1121
|
+
});
|
|
1122
|
+
return "event-one";
|
|
1123
|
+
});
|
|
1124
|
+
tp.addListener("changePropTwo", async evt => {
|
|
1125
|
+
await promiseDelay(1, () => {
|
|
1126
|
+
evt.getTarget().state.push("event-two");
|
|
1127
|
+
});
|
|
1128
|
+
return "event-two";
|
|
1129
|
+
});
|
|
1130
|
+
return tp;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
const testImpl = async () => {
|
|
1134
|
+
let tmp;
|
|
1135
|
+
let tp;
|
|
1136
|
+
let result;
|
|
1137
|
+
("");
|
|
1138
|
+
|
|
1139
|
+
tp = createTestPromise();
|
|
1140
|
+
tmp = tp.setPropOne(12);
|
|
1141
|
+
this.assertTrue(tmp === 12);
|
|
1142
|
+
this.assertArrayEquals(tp.state, []);
|
|
1143
|
+
|
|
1144
|
+
tp = createTestPromise();
|
|
1145
|
+
tmp = tp.setPropOne(qx.Promise.resolve(14));
|
|
1146
|
+
this.assertTrue(qx.lang.Type.isPromise(tmp));
|
|
1147
|
+
this.assertArrayEquals(tp.state, []);
|
|
1148
|
+
|
|
1149
|
+
tp = createTestPromise();
|
|
1150
|
+
tmp = tp.setPropTwoAsync(16);
|
|
1151
|
+
this.assertTrue(qx.lang.Type.isPromise(tmp));
|
|
1152
|
+
this.assertArrayEquals(tp.state, []);
|
|
1153
|
+
result = await tmp;
|
|
1154
|
+
this.assertTrue(result === 16);
|
|
1155
|
+
this.assertArrayEquals(tp.state, ["apply-two", "event-two"]);
|
|
1156
|
+
|
|
1157
|
+
tp = createTestPromise();
|
|
1158
|
+
tmp = tp.setPropTwoAsync(qx.Promise.resolve(18));
|
|
1159
|
+
this.assertTrue(qx.lang.Type.isPromise(tmp));
|
|
1160
|
+
this.assertArrayEquals(tp.state, []);
|
|
1161
|
+
result = await tmp;
|
|
1162
|
+
this.assertTrue(result === 18);
|
|
1163
|
+
this.assertArrayEquals(tp.state, ["apply-two", "event-two"]);
|
|
1164
|
+
};
|
|
1165
|
+
testImpl().then(() => this.resume());
|
|
1166
|
+
this.wait(1000);
|
|
1063
1167
|
}
|
|
1064
1168
|
}
|
|
1065
1169
|
});
|
|
@@ -785,6 +785,41 @@ qx.Theme.define("qx.theme.simple.Appearance", {
|
|
|
785
785
|
"row-layer": "widget",
|
|
786
786
|
"column-layer": "widget",
|
|
787
787
|
|
|
788
|
+
"virtual-background-span": {
|
|
789
|
+
alias: "widget",
|
|
790
|
+
|
|
791
|
+
style(states) {
|
|
792
|
+
var style = {
|
|
793
|
+
decorator: "virtual-background-span"
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
if (states.header) {
|
|
797
|
+
style.decorator = "virtual-background-header";
|
|
798
|
+
style.backgroundColor = "table-header-cell";
|
|
799
|
+
} else if (states.selected) {
|
|
800
|
+
style.backgroundColor = "table-row-background-selected";
|
|
801
|
+
} else if (states.odd) {
|
|
802
|
+
style.backgroundColor = "table-row-background-odd";
|
|
803
|
+
} else {
|
|
804
|
+
style.backgroundColor = "table-row-background-even";
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
return style;
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
|
|
811
|
+
"virtual-list-header-cell": {
|
|
812
|
+
alias: "atom",
|
|
813
|
+
|
|
814
|
+
style(states) {
|
|
815
|
+
return {
|
|
816
|
+
font: "bold",
|
|
817
|
+
paddingTop: 3,
|
|
818
|
+
paddingLeft: 5
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
|
|
788
823
|
"group-item": {
|
|
789
824
|
include: "label",
|
|
790
825
|
alias: "label",
|
|
@@ -930,6 +930,22 @@ qx.Theme.define("qx.theme.simple.Decoration", {
|
|
|
930
930
|
}
|
|
931
931
|
},
|
|
932
932
|
|
|
933
|
+
"virtual-background-header": {
|
|
934
|
+
style: {
|
|
935
|
+
gradientStart: ["button-box-bright", 40],
|
|
936
|
+
gradientEnd: ["button-box-dark", 70],
|
|
937
|
+
backgroundColor: "button-box-bright"
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
|
|
941
|
+
"virtual-background-span": {
|
|
942
|
+
include: "table-header-cell",
|
|
943
|
+
style: {
|
|
944
|
+
color: "table-row-line",
|
|
945
|
+
width: [0, 0, 1, 0]
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
|
|
933
949
|
"progressive-table-header": {
|
|
934
950
|
include: "button-box",
|
|
935
951
|
|
|
@@ -645,7 +645,7 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
|
|
|
645
645
|
alias: "selectbox",
|
|
646
646
|
|
|
647
647
|
style(states) {
|
|
648
|
-
return {
|
|
648
|
+
return {
|
|
649
649
|
padding: [0, 2],
|
|
650
650
|
backgroundColor: "surface"
|
|
651
651
|
};
|
|
@@ -657,10 +657,10 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
|
|
|
657
657
|
alias: "combobox",
|
|
658
658
|
|
|
659
659
|
style(states) {
|
|
660
|
-
return {
|
|
660
|
+
return {
|
|
661
661
|
decorator: undefined,
|
|
662
662
|
backgroundColor: "surface"
|
|
663
|
-
|
|
663
|
+
};
|
|
664
664
|
}
|
|
665
665
|
},
|
|
666
666
|
|
|
@@ -1006,18 +1006,18 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
|
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
1008
|
},
|
|
1009
|
+
|
|
1009
1010
|
"menubar-button/icon": {
|
|
1010
1011
|
style(states) {
|
|
1011
1012
|
return {
|
|
1012
|
-
textColor: states.disabled
|
|
1013
|
-
? "text-disabled-on-surface"
|
|
1014
|
-
:
|
|
1015
|
-
? "text-on-primary"
|
|
1013
|
+
textColor: states.disabled
|
|
1014
|
+
? "text-disabled-on-surface"
|
|
1015
|
+
: states.pressed || states.hovered
|
|
1016
|
+
? "text-on-primary"
|
|
1016
1017
|
: "text-on-surface"
|
|
1017
|
-
}
|
|
1018
|
+
};
|
|
1018
1019
|
}
|
|
1019
1020
|
},
|
|
1020
|
-
|
|
1021
1021
|
|
|
1022
1022
|
/*
|
|
1023
1023
|
---------------------------------------------------------------------------
|
|
@@ -338,9 +338,13 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
|
|
|
338
338
|
configFilename: compileJsonFilename
|
|
339
339
|
}));
|
|
340
340
|
|
|
341
|
+
// Boot the compiler API, load the compile.json and create configuration data
|
|
341
342
|
await compilerApi.load();
|
|
342
343
|
let config = compilerApi.getConfiguration();
|
|
343
344
|
|
|
345
|
+
// Validate configuration data against the schema
|
|
346
|
+
await qx.tool.config.Compile.getInstance().load(config);
|
|
347
|
+
|
|
344
348
|
/*
|
|
345
349
|
* Open the lockfile and check versions
|
|
346
350
|
*/
|
|
@@ -154,6 +154,9 @@ qx.Class.define("qx.tool.cli.Watch", {
|
|
|
154
154
|
dir = path.join(lib.getRootDir(), lib.getThemePath());
|
|
155
155
|
dirs.push(dir);
|
|
156
156
|
});
|
|
157
|
+
if (analyser.getProxySourcePath()) {
|
|
158
|
+
dirs.push(path.resolve(analyser.getProxySourcePath()));
|
|
159
|
+
}
|
|
157
160
|
var applications = (this.__applications = []);
|
|
158
161
|
this.__maker.getApplications().forEach(function (application) {
|
|
159
162
|
var data = {
|
|
@@ -359,9 +359,6 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
|
|
|
359
359
|
this.argv["feedback"] = configDb.db("qx.default.feedback", true);
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
// Validate compile.json against the schema
|
|
363
|
-
await qx.tool.config.Compile.getInstance().load();
|
|
364
|
-
|
|
365
362
|
if (this.argv.verbose) {
|
|
366
363
|
console.log(`
|
|
367
364
|
Compiler: v${this.getCompilerVersion()} in ${require.main.filename}
|
|
@@ -1122,6 +1119,11 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
|
|
|
1122
1119
|
.getAnalyser()
|
|
1123
1120
|
.setApplicationTypes(targetConfig["application-types"]);
|
|
1124
1121
|
}
|
|
1122
|
+
if (targetConfig["proxySourcePath"]) {
|
|
1123
|
+
maker
|
|
1124
|
+
.getAnalyser()
|
|
1125
|
+
.setProxySourcePath(targetConfig["proxySourcePath"]);
|
|
1126
|
+
}
|
|
1125
1127
|
|
|
1126
1128
|
maker.setLocales(data.locales || ["en"]);
|
|
1127
1129
|
if (data.writeAllTranslations) {
|
|
@@ -36,6 +36,10 @@ qx.Class.define("qx.tool.cli.commands.Es6ify", {
|
|
|
36
36
|
describe: "Verbose logging"
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
+
gitPreCommit: {
|
|
40
|
+
describe: "When used as a Git pre-commit hook"
|
|
41
|
+
},
|
|
42
|
+
|
|
39
43
|
overwrite: {
|
|
40
44
|
type: "boolean",
|
|
41
45
|
default: true,
|
|
@@ -68,6 +72,7 @@ qx.Class.define("qx.tool.cli.commands.Es6ify", {
|
|
|
68
72
|
throw err;
|
|
69
73
|
}
|
|
70
74
|
}
|
|
75
|
+
|
|
71
76
|
let exclude = this.argv.exclude;
|
|
72
77
|
if (exclude) {
|
|
73
78
|
if (!qx.lang.Type.isArray(exclude)) {
|
|
@@ -90,6 +95,52 @@ qx.Class.define("qx.tool.cli.commands.Es6ify", {
|
|
|
90
95
|
await ify.transform();
|
|
91
96
|
};
|
|
92
97
|
|
|
98
|
+
if (this.argv.gitPreCommit) {
|
|
99
|
+
let result = await qx.tool.utils.Utils.runCommand(
|
|
100
|
+
process.cwd(),
|
|
101
|
+
"git",
|
|
102
|
+
"diff",
|
|
103
|
+
"--cached",
|
|
104
|
+
"--name-only",
|
|
105
|
+
"--diff-filter=ACMR"
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
if (result.exitCode != 0) {
|
|
109
|
+
qx.tool.compiler.Console.error(
|
|
110
|
+
`Failed to run 'git diff': ${JSON.stringify(result, null, 2)}`
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
process.exit(1);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let lines = result.output
|
|
117
|
+
.split(/\n/)
|
|
118
|
+
.filter(str => !!str.match(/^source\/class\/.*\.js$/));
|
|
119
|
+
for (let filename of lines) {
|
|
120
|
+
await processFile(filename);
|
|
121
|
+
result = await qx.tool.utils.Utils.runCommand(
|
|
122
|
+
process.cwd(),
|
|
123
|
+
"git",
|
|
124
|
+
"add",
|
|
125
|
+
filename
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
if (result.exitCode != 0) {
|
|
129
|
+
qx.tool.compiler.Console.error(
|
|
130
|
+
`Failed to run 'git add ${filename}': ${JSON.stringify(
|
|
131
|
+
result,
|
|
132
|
+
null,
|
|
133
|
+
2
|
|
134
|
+
)}`
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
process.exit(1);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
process.exit(0);
|
|
142
|
+
}
|
|
143
|
+
|
|
93
144
|
const scanImpl = async filename => {
|
|
94
145
|
let basename = path.basename(filename);
|
|
95
146
|
let stat = await fs.promises.stat(filename);
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
/* eslint no-inner-declarations: 0 */
|
|
25
25
|
|
|
26
26
|
var fs = require("fs");
|
|
27
|
+
const path = require("path");
|
|
27
28
|
var async = require("async");
|
|
28
29
|
|
|
29
30
|
var hash = require("object-hash");
|
|
@@ -69,6 +70,13 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
69
70
|
check: "String"
|
|
70
71
|
},
|
|
71
72
|
|
|
73
|
+
/** Directory for proxy source files, if they are to be used */
|
|
74
|
+
proxySourcePath: {
|
|
75
|
+
init: null,
|
|
76
|
+
nullable: true,
|
|
77
|
+
check: "String"
|
|
78
|
+
},
|
|
79
|
+
|
|
72
80
|
/** Supported application types */
|
|
73
81
|
applicationTypes: {
|
|
74
82
|
init: ["node", "browser"],
|
|
@@ -919,8 +927,7 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
919
927
|
);
|
|
920
928
|
}
|
|
921
929
|
metaWrittenLog[classname] = true;
|
|
922
|
-
var filename =
|
|
923
|
-
qx.tool.compiler.ClassFile.getOutputPath(t, classname) + "on";
|
|
930
|
+
var filename = t.getClassOutputPath(classname) + "on";
|
|
924
931
|
return writeFile(filename, JSON.stringify(meta, null, 2), {
|
|
925
932
|
encoding: "utf-8"
|
|
926
933
|
});
|
|
@@ -937,8 +944,7 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
937
944
|
if (cachedMeta[classname]) {
|
|
938
945
|
return Promise.resolve(cachedMeta[classname]);
|
|
939
946
|
}
|
|
940
|
-
var filename =
|
|
941
|
-
qx.tool.compiler.ClassFile.getOutputPath(t, classname) + "on";
|
|
947
|
+
var filename = t.getClassOutputPath(classname) + "on";
|
|
942
948
|
return readFile(filename, { encoding: "utf-8" })
|
|
943
949
|
.then(str => JSON.parse(str))
|
|
944
950
|
.then(meta => (cachedMeta[classname] = meta))
|
|
@@ -1065,15 +1071,9 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
1065
1071
|
return;
|
|
1066
1072
|
}
|
|
1067
1073
|
|
|
1068
|
-
var sourceClassFilename =
|
|
1069
|
-
library,
|
|
1070
|
-
className
|
|
1071
|
-
);
|
|
1074
|
+
var sourceClassFilename = this.getClassSourcePath(library, className);
|
|
1072
1075
|
|
|
1073
|
-
var outputClassFilename =
|
|
1074
|
-
this,
|
|
1075
|
-
className
|
|
1076
|
-
);
|
|
1076
|
+
var outputClassFilename = this.getClassOutputPath(className);
|
|
1077
1077
|
|
|
1078
1078
|
const scanFile = async () => {
|
|
1079
1079
|
let sourceStat = await qx.tool.utils.files.Utils.safeStat(
|
|
@@ -1085,6 +1085,12 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
1087
|
var dbClassInfo = db.classInfo[className];
|
|
1088
|
+
if (
|
|
1089
|
+
!dbClassInfo ||
|
|
1090
|
+
(!forceScan && dbClassInfo.filename != sourceClassFilename)
|
|
1091
|
+
) {
|
|
1092
|
+
forceScan = true;
|
|
1093
|
+
}
|
|
1088
1094
|
|
|
1089
1095
|
if (!forceScan) {
|
|
1090
1096
|
let outputStat = await qx.tool.utils.files.Utils.safeStat(
|
|
@@ -1119,7 +1125,8 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
1119
1125
|
: null;
|
|
1120
1126
|
dbClassInfo = db.classInfo[className] = {
|
|
1121
1127
|
mtime: sourceStat.mtime,
|
|
1122
|
-
libraryName: library.getNamespace()
|
|
1128
|
+
libraryName: library.getNamespace(),
|
|
1129
|
+
filename: sourceClassFilename
|
|
1123
1130
|
};
|
|
1124
1131
|
|
|
1125
1132
|
// Analyse it and collect unresolved symbols and dependencies
|
|
@@ -1147,6 +1154,48 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
1147
1154
|
qx.tool.utils.Promisify.callback(scanFile(), cb);
|
|
1148
1155
|
},
|
|
1149
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* Returns the absolute path to the class file
|
|
1159
|
+
*
|
|
1160
|
+
* @param library {qx.tool.compiler.app.Library}
|
|
1161
|
+
* @param className {String}
|
|
1162
|
+
* @returns {String}
|
|
1163
|
+
*/
|
|
1164
|
+
getClassSourcePath(library, className) {
|
|
1165
|
+
let filename =
|
|
1166
|
+
className.replace(/\./g, path.sep) +
|
|
1167
|
+
library.getSourceFileExtension(className);
|
|
1168
|
+
if (this.getProxySourcePath()) {
|
|
1169
|
+
let test = path.join(this.getProxySourcePath(), filename);
|
|
1170
|
+
if (fs.existsSync(test)) {
|
|
1171
|
+
return path.resolve(test);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return path.join(
|
|
1176
|
+
library.getRootDir(),
|
|
1177
|
+
library.getSourcePath(),
|
|
1178
|
+
className.replace(/\./g, path.sep) +
|
|
1179
|
+
library.getSourceFileExtension(className)
|
|
1180
|
+
);
|
|
1181
|
+
},
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Returns the path to the rewritten class file
|
|
1185
|
+
*
|
|
1186
|
+
* @param className {String}
|
|
1187
|
+
* @returns {String}
|
|
1188
|
+
*/
|
|
1189
|
+
getClassOutputPath(className) {
|
|
1190
|
+
var filename = path.join(
|
|
1191
|
+
this.getOutputDir(),
|
|
1192
|
+
"transpiled",
|
|
1193
|
+
className.replace(/\./g, path.sep) + ".js"
|
|
1194
|
+
);
|
|
1195
|
+
|
|
1196
|
+
return filename;
|
|
1197
|
+
},
|
|
1198
|
+
|
|
1150
1199
|
/**
|
|
1151
1200
|
* Returns the CLDR data for a given locale
|
|
1152
1201
|
* @param locale {String} the locale string
|
|
@@ -200,10 +200,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
200
200
|
this.__metaStack = [];
|
|
201
201
|
this.__metaDefinitions = {};
|
|
202
202
|
this.__library = library;
|
|
203
|
-
this.__sourceFilename =
|
|
204
|
-
library,
|
|
205
|
-
className
|
|
206
|
-
);
|
|
203
|
+
this.__sourceFilename = analyser.getClassSourcePath(library, className);
|
|
207
204
|
|
|
208
205
|
this.__requiredClasses = {};
|
|
209
206
|
this.__environmentChecks = {
|
|
@@ -317,10 +314,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
317
314
|
* @returns {string}
|
|
318
315
|
*/
|
|
319
316
|
getOutputPath() {
|
|
320
|
-
return
|
|
321
|
-
this.__analyser,
|
|
322
|
-
this.__className
|
|
323
|
-
);
|
|
317
|
+
return this.__analyser.getClassOutputPath(this.__className);
|
|
324
318
|
},
|
|
325
319
|
|
|
326
320
|
/**
|
|
@@ -1314,7 +1308,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
1314
1308
|
path.traverse(COLLECT_CLASS_NAMES_VISITOR, {
|
|
1315
1309
|
collectedClasses: t.__classMeta.interfaces
|
|
1316
1310
|
});
|
|
1317
|
-
} else if (keyName == "include") {
|
|
1311
|
+
} else if (keyName == "include" || keyName == "patch") {
|
|
1318
1312
|
path.skip();
|
|
1319
1313
|
path.traverse(COLLECT_CLASS_NAMES_VISITOR, {
|
|
1320
1314
|
collectedClasses: t.__classMeta.mixins
|
|
@@ -1359,11 +1353,25 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
1359
1353
|
meta.allowNull = data.nullable;
|
|
1360
1354
|
}
|
|
1361
1355
|
if (data.check !== undefined) {
|
|
1356
|
+
let checks;
|
|
1362
1357
|
if (qx.lang.Type.isArray(data.check)) {
|
|
1363
|
-
meta.possibleValues = data.check;
|
|
1358
|
+
checks = meta.possibleValues = data.check;
|
|
1364
1359
|
} else {
|
|
1365
1360
|
meta.check = data.check;
|
|
1361
|
+
checks = [data.check];
|
|
1366
1362
|
}
|
|
1363
|
+
checks.forEach(check => {
|
|
1364
|
+
if (!qx.tool.compiler.ClassFile.SYSTEM_CHECKS[check]) {
|
|
1365
|
+
let symbolData = t.__analyser.getSymbolType(check);
|
|
1366
|
+
if (symbolData?.symbolType == "class") {
|
|
1367
|
+
t._requireClass(check, {
|
|
1368
|
+
load: false,
|
|
1369
|
+
usage: "dynamic",
|
|
1370
|
+
location: path.node.loc
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1367
1375
|
}
|
|
1368
1376
|
if (data.init !== undefined) {
|
|
1369
1377
|
meta.defaultValue = data.init;
|
|
@@ -1690,16 +1698,17 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
1690
1698
|
let arg = path.node.arguments[0];
|
|
1691
1699
|
if (types.isLiteral(arg)) {
|
|
1692
1700
|
if (typeof arg.value != "string") {
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1701
|
+
t.addMarker(
|
|
1702
|
+
"compiler.requireLiteralArguments",
|
|
1703
|
+
path.node.loc,
|
|
1704
|
+
arg.value
|
|
1697
1705
|
);
|
|
1698
1706
|
} else {
|
|
1699
1707
|
qx.tool.compiler.Console.log(
|
|
1700
1708
|
`${t.__className}:${path.node.loc.start.line}:` +
|
|
1701
1709
|
` automatically detected \'require(${arg.value})\``
|
|
1702
1710
|
);
|
|
1711
|
+
|
|
1703
1712
|
t.addCommonjsModule(
|
|
1704
1713
|
arg.value,
|
|
1705
1714
|
t.__className,
|
|
@@ -2944,42 +2953,13 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
2944
2953
|
"in instanceof int interface let long native new null package private protected public return short static " +
|
|
2945
2954
|
"super switch synchronized this throw throws transient true try typeof var void volatile while with yield";
|
|
2946
2955
|
str.split(/\s+/).forEach(word => (statics.RESERVED_WORDS[word] = true));
|
|
2956
|
+
statics.SYSTEM_CHECKS = {};
|
|
2957
|
+
"Boolean,String,Number,Integer,PositiveNumber,PositiveInteger,Error,RegExp,Object,Array,Map,Function,Date,Node,Element,Document,Window,Event,Class,Mixin,Interface,Theme,Color,Decorator,Font"
|
|
2958
|
+
.split(",")
|
|
2959
|
+
.forEach(word => (statics.SYSTEM_CHECKS[word] = true));
|
|
2947
2960
|
},
|
|
2948
2961
|
|
|
2949
2962
|
statics: {
|
|
2950
|
-
/**
|
|
2951
|
-
* Returns the absolute path to the class file
|
|
2952
|
-
*
|
|
2953
|
-
* @param library {qx.tool.compiler.app.Library}
|
|
2954
|
-
* @param className {String}
|
|
2955
|
-
* @returns {String}
|
|
2956
|
-
*/
|
|
2957
|
-
getSourcePath(library, className) {
|
|
2958
|
-
return pathModule.join(
|
|
2959
|
-
library.getRootDir(),
|
|
2960
|
-
library.getSourcePath(),
|
|
2961
|
-
className.replace(/\./g, pathModule.sep) +
|
|
2962
|
-
library.getSourceFileExtension(className)
|
|
2963
|
-
);
|
|
2964
|
-
},
|
|
2965
|
-
|
|
2966
|
-
/**
|
|
2967
|
-
* Returns the path to the rewritten class file
|
|
2968
|
-
*
|
|
2969
|
-
* @param analyser {qx.tool.compiler.Analyser}
|
|
2970
|
-
* @param className {String}
|
|
2971
|
-
* @returns {String}
|
|
2972
|
-
*/
|
|
2973
|
-
getOutputPath(analyser, className) {
|
|
2974
|
-
var filename = pathModule.join(
|
|
2975
|
-
analyser.getOutputDir(),
|
|
2976
|
-
"transpiled",
|
|
2977
|
-
className.replace(/\./g, pathModule.sep) + ".js"
|
|
2978
|
-
);
|
|
2979
|
-
|
|
2980
|
-
return filename;
|
|
2981
|
-
},
|
|
2982
|
-
|
|
2983
2963
|
/**
|
|
2984
2964
|
* Returns the root namespace from the classname, or null if it cannot be determined
|
|
2985
2965
|
* @param className
|
|
@@ -3176,6 +3156,8 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
3176
3156
|
"qx.promise": true,
|
|
3177
3157
|
"qx.promise.warnings": true,
|
|
3178
3158
|
"qx.promise.longStackTraces": true
|
|
3179
|
-
}
|
|
3159
|
+
},
|
|
3160
|
+
|
|
3161
|
+
SYSTEM_CHECKS: null
|
|
3180
3162
|
}
|
|
3181
3163
|
});
|
|
@@ -252,6 +252,8 @@ qx.Class.define("qx.tool.compiler.Console", {
|
|
|
252
252
|
"qx.tool.compiler.symbol.unresolved": "Unresolved use of symbol %1",
|
|
253
253
|
"qx.tool.compiler.environment.unreachable":
|
|
254
254
|
"Environment check '%1' may be indeterminable, add to Manifest/provides/environment or use class name prefix",
|
|
255
|
+
"qx.tool.compiler.compiler.requireLiteralArguments":
|
|
256
|
+
"Wrong class name or filename - expected to find at least %1 but only found [%2]",
|
|
255
257
|
|
|
256
258
|
"qx.tool.compiler.target.missingAppLibrary":
|
|
257
259
|
"Cannot find the application library for %1",
|
|
@@ -436,9 +436,13 @@ qx.Class.define("qx.tool.compiler.targets.Target", {
|
|
|
436
436
|
// class will always bundle local modules specified for an
|
|
437
437
|
// application in compile.json, but will not bundle `require()`d
|
|
438
438
|
// modules that are Node modules.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
)
|
|
439
|
+
if (
|
|
440
|
+
appMeta.getEnvironmentValue("qx.compiler.applicationType") == "browser"
|
|
441
|
+
) {
|
|
442
|
+
bootPackage.addJavascriptMeta(
|
|
443
|
+
new qx.tool.compiler.targets.meta.Browserify(appMeta)
|
|
444
|
+
);
|
|
445
|
+
}
|
|
442
446
|
|
|
443
447
|
/*
|
|
444
448
|
* Assemble the Parts
|