@scifeon/sdk 0.88.0 → 0.89.0
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.
|
@@ -16,13 +16,27 @@ const download_utils_1 = require("../../../download-utils");
|
|
|
16
16
|
const config_1 = require("../../config");
|
|
17
17
|
const webpack_runner_1 = require("../../webpack-runner");
|
|
18
18
|
class BuildCommand {
|
|
19
|
-
execute() {
|
|
19
|
+
execute(options) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
if (!fs.existsSync(config_1.config.wwwDir)) {
|
|
22
|
-
|
|
22
|
+
let branch = "";
|
|
23
|
+
if (options === null || options === void 0 ? void 0 : options.branch) {
|
|
24
|
+
branch = `-${options.branch}`;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
yield this.downloadTypes(branch);
|
|
28
|
+
}
|
|
29
|
+
catch (_a) {
|
|
30
|
+
yield this.downloadTypes();
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
(0, webpack_runner_1.webpackRunner)("build");
|
|
25
34
|
});
|
|
26
35
|
}
|
|
36
|
+
downloadTypes(branch) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
yield download_utils_1.DownloadUtils.downloadZip(`https://scifeon.azureedge.net/sdk/packages-types${branch}.zip`, path.resolve("runtime", "scifeon", "generated"), `Downloading Scifeon Types ${branch}`);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
27
41
|
}
|
|
28
42
|
exports.BuildCommand = BuildCommand;
|
package/dist/cli/index.js
CHANGED
|
@@ -59,9 +59,10 @@ class ScifeonCLI {
|
|
|
59
59
|
setup() {
|
|
60
60
|
this.program
|
|
61
61
|
.command("build")
|
|
62
|
+
.option("--branch [branch]", "Platform branch to use for SDK types")
|
|
62
63
|
.allowUnknownOption()
|
|
63
64
|
.description("Build the App into the folder /build.\n")
|
|
64
|
-
.action(() => __awaiter(this, void 0, void 0, function* () { return yield new build_1.BuildCommand().execute(); }));
|
|
65
|
+
.action((options) => __awaiter(this, void 0, void 0, function* () { return yield new build_1.BuildCommand().execute(options); }));
|
|
65
66
|
this.program
|
|
66
67
|
.command("clean")
|
|
67
68
|
.description("Remove the /build-folder.\n")
|
|
@@ -42,7 +42,8 @@ function webpackAppConfig(env, config, appType = "sdk") {
|
|
|
42
42
|
let output = {};
|
|
43
43
|
if (!TEST) {
|
|
44
44
|
const aureliaPlugins = [];
|
|
45
|
-
plugins = plugins.concat([
|
|
45
|
+
plugins = plugins.concat([
|
|
46
|
+
...aureliaPlugins,
|
|
46
47
|
new MiniCssExtractPlugin({
|
|
47
48
|
filename: "[name].[contenthash].css",
|
|
48
49
|
chunkFilename: "[id].[contenthash].css",
|
package/dist/webpack-utils.js
CHANGED
|
@@ -59,19 +59,20 @@ function getFileDirectory(filePath) {
|
|
|
59
59
|
return filePath.substring(0, filePath.lastIndexOf("/"));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const ModuleDependencyWarning = require("webpack/lib/ModuleDependencyWarning");
|
|
63
62
|
class IgnoreNotFoundExportPlugin {
|
|
64
63
|
apply(compiler) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
const doneHook = (stats) => {
|
|
65
|
+
stats.compilation.warnings = stats.compilation.warnings.filter(warn => {
|
|
66
|
+
const ignoreWarn1 = /export '.*'( \(reexported as '.*'\))? was not found in/;
|
|
67
|
+
const ignoreWarn2 = /export 'default'( \(imported as '.*'\))? was not found in/;
|
|
68
|
+
const ignoreWarn3 = /export '.*'( \(imported as '.*'\))? was not found in/;
|
|
69
|
+
if (warn.constructor.name === "ModuleDependencyWarning"
|
|
70
|
+
&& (ignoreWarn1.test(warn.message) || ignoreWarn2.test(warn.message) || ignoreWarn3.test(warn.message))) {
|
|
70
71
|
return false;
|
|
71
72
|
}
|
|
72
73
|
return true;
|
|
73
74
|
});
|
|
74
|
-
}
|
|
75
|
+
};
|
|
75
76
|
if (compiler.hooks) {
|
|
76
77
|
compiler.hooks.done.tap("IgnoreNotFoundExportPlugin", doneHook);
|
|
77
78
|
}
|