@scifeon/sdk 0.88.0 → 0.91.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.
- package/dist/cli/commands/app/build.d.ts +2 -1
- package/dist/cli/commands/app/build.js +17 -2
- package/dist/cli/index.js +7 -2
- package/dist/cli/webpack-runner.js +6 -1
- package/dist/utils/test-helper.d.ts +2 -2
- package/dist/utils/test-helper.js +3 -3
- package/dist/webpack-app-config.js +2 -1
- package/dist/webpack-utils.js +19 -13
- package/package.json +16 -16
|
@@ -16,13 +16,28 @@ 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
|
+
branch = branch.replace(/\//ig, "-");
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
yield this.downloadTypes(branch);
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
yield this.downloadTypes();
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
(0, webpack_runner_1.webpackRunner)("build");
|
|
25
35
|
});
|
|
26
36
|
}
|
|
37
|
+
downloadTypes(branch) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
yield download_utils_1.DownloadUtils.downloadZip(`https://scifeon.azureedge.net/sdk/packages-types${branch}.zip`, path.resolve("runtime", "scifeon", "generated"), `Downloading Scifeon Types ${branch}`);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
27
42
|
}
|
|
28
43
|
exports.BuildCommand = BuildCommand;
|
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -59,9 +63,10 @@ class ScifeonCLI {
|
|
|
59
63
|
setup() {
|
|
60
64
|
this.program
|
|
61
65
|
.command("build")
|
|
66
|
+
.option("--branch [branch]", "Platform branch to use for SDK types")
|
|
62
67
|
.allowUnknownOption()
|
|
63
68
|
.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(); }));
|
|
69
|
+
.action((options) => __awaiter(this, void 0, void 0, function* () { return yield new build_1.BuildCommand().execute(options); }));
|
|
65
70
|
this.program
|
|
66
71
|
.command("clean")
|
|
67
72
|
.description("Remove the /build-folder.\n")
|
|
@@ -15,7 +15,12 @@ function webpackRunner(mode) {
|
|
|
15
15
|
chunks: false,
|
|
16
16
|
colors: true,
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
if (err) {
|
|
19
|
+
console.error(err);
|
|
20
|
+
}
|
|
21
|
+
if (stats) {
|
|
22
|
+
console.log(stats.toString(config));
|
|
23
|
+
}
|
|
19
24
|
});
|
|
20
25
|
}
|
|
21
26
|
exports.webpackRunner = webpackRunner;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WorkBook } from "@scifeon/plugins/src/xlsx-types";
|
|
1
|
+
import { ParsingOptions, WorkBook } from "@scifeon/plugins/src/xlsx-types";
|
|
2
2
|
export declare class TestHelper {
|
|
3
3
|
static XLSX(): Promise<any>;
|
|
4
|
-
static fileToXLSX(filename: string): Promise<WorkBook>;
|
|
4
|
+
static fileToXLSX(filename: string, options?: ParsingOptions): Promise<WorkBook>;
|
|
5
5
|
}
|
|
@@ -33,13 +33,13 @@ const requireURL = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
33
33
|
class TestHelper {
|
|
34
34
|
static XLSX() {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
return
|
|
36
|
+
return requireURL(XLSX_URL);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
static fileToXLSX(filename) {
|
|
39
|
+
static fileToXLSX(filename, options = { cellDates: true }) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
const xlsx = yield TestHelper.XLSX();
|
|
42
|
-
return xlsx.read(fs.readFileSync(filename));
|
|
42
|
+
return xlsx.read(fs.readFileSync(filename), options);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -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
|
@@ -29,11 +29,11 @@ class WebpackUtils {
|
|
|
29
29
|
scifeonVersion = scifeonVersion.replace("--scifeon-version=", "");
|
|
30
30
|
publicPath = "https://scifeon.azureedge.net/";
|
|
31
31
|
if (prefix) {
|
|
32
|
-
publicPath += prefix
|
|
32
|
+
publicPath += `${prefix}/`;
|
|
33
33
|
}
|
|
34
|
-
publicPath += scifeonVersion
|
|
34
|
+
publicPath += `${scifeonVersion}/`;
|
|
35
35
|
if (postfix) {
|
|
36
|
-
publicPath += postfix
|
|
36
|
+
publicPath += `${postfix}/`;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
return publicPath;
|
|
@@ -55,23 +55,29 @@ function getFileDirectory(filePath) {
|
|
|
55
55
|
if (filePath.indexOf("/") === -1) {
|
|
56
56
|
return filePath.substring(0, filePath.lastIndexOf("\\"));
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
return filePath.substring(0, filePath.lastIndexOf("/"));
|
|
60
|
-
}
|
|
58
|
+
return filePath.substring(0, filePath.lastIndexOf("/"));
|
|
61
59
|
}
|
|
62
|
-
const ModuleDependencyWarning = require("webpack/lib/ModuleDependencyWarning");
|
|
63
60
|
class IgnoreNotFoundExportPlugin {
|
|
64
61
|
apply(compiler) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
const doneHook = (stats) => {
|
|
63
|
+
stats.compilation.warnings = stats.compilation.warnings.filter(warn => {
|
|
64
|
+
const ignoreWarn1 = /export '.*'( \(reexported as '.*'\))? was not found in/;
|
|
65
|
+
const ignoreWarn2 = /export 'default'( \(imported as '.*'\))? was not found in/;
|
|
66
|
+
const ignoreWarn3 = /export '.*'( \(imported as '.*'\))? was not found in/;
|
|
67
|
+
if (warn.constructor.name === "ModuleDependencyWarning"
|
|
68
|
+
&& (ignoreWarn1.test(warn.message)
|
|
69
|
+
|| ignoreWarn2.test(warn.message)
|
|
70
|
+
|| ignoreWarn3.test(warn.message))) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (warn.constructor.name === "ModuleWarning"
|
|
74
|
+
&& warn.message.includes("Can't resolve")
|
|
75
|
+
&& warn.message.includes("chevrotain")) {
|
|
70
76
|
return false;
|
|
71
77
|
}
|
|
72
78
|
return true;
|
|
73
79
|
});
|
|
74
|
-
}
|
|
80
|
+
};
|
|
75
81
|
if (compiler.hooks) {
|
|
76
82
|
compiler.hooks.done.tap("IgnoreNotFoundExportPlugin", doneHook);
|
|
77
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scifeon/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"description": "A tool for developing Apps for Scifeon.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Scifeon",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"watch:test": "npm run test -- --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@types/chai": "4.
|
|
29
|
-
"adm-zip": "0.
|
|
30
|
-
"aurelia-bootstrapper": "2.
|
|
28
|
+
"@types/chai": "4.3.1",
|
|
29
|
+
"adm-zip": "0.5.9",
|
|
30
|
+
"aurelia-bootstrapper": "2.4.0",
|
|
31
31
|
"aurelia-webpack-plugin": "4.0.0",
|
|
32
|
-
"chai": "4.
|
|
32
|
+
"chai": "4.3.6",
|
|
33
33
|
"chalk": "2.4.2",
|
|
34
34
|
"commander": "4.0.0",
|
|
35
|
-
"chokidar": "
|
|
35
|
+
"chokidar": "3.5.3",
|
|
36
36
|
"copy-webpack-plugin": "5.1.1",
|
|
37
37
|
"css-loader": "3.5.3",
|
|
38
38
|
"file-loader": "6.0.0",
|
|
@@ -40,33 +40,33 @@
|
|
|
40
40
|
"html-loader": "1.1.0",
|
|
41
41
|
"json-loader": "0.5.7",
|
|
42
42
|
"mini-css-extract-plugin": "0.9.0",
|
|
43
|
-
"mocha": "7.1.2",
|
|
44
|
-
"mocha-junit-reporter": "1.23.3",
|
|
45
43
|
"node-fetch": "2.6.0",
|
|
44
|
+
"mocha": "10.0.0",
|
|
45
|
+
"mocha-junit-reporter": "2.0.2",
|
|
46
46
|
"node-hook": "1.0.0",
|
|
47
47
|
"openurl": "1.1.1",
|
|
48
48
|
"optimize-css-assets-webpack-plugin": "5.0.3",
|
|
49
49
|
"post-compile-webpack-plugin": "0.1.2",
|
|
50
50
|
"progress": "2.0.3",
|
|
51
|
-
"prompt": "1.
|
|
52
|
-
"resolve": "1.
|
|
53
|
-
"sass": "1.
|
|
51
|
+
"prompt": "1.3.0",
|
|
52
|
+
"resolve": "1.22.0",
|
|
53
|
+
"sass": "1.52.3",
|
|
54
54
|
"sass-loader": "8.0.2",
|
|
55
|
-
"semver": "7.3.
|
|
55
|
+
"semver": "7.3.7",
|
|
56
56
|
"style-loader": "1.2.1",
|
|
57
57
|
"terser-webpack-plugin": "2.3.6",
|
|
58
58
|
"ts-loader": "8.3.0",
|
|
59
|
-
"ts-node": "8.
|
|
59
|
+
"ts-node": "10.8.1",
|
|
60
60
|
"tsconfig-paths-webpack-plugin": "3.2.0",
|
|
61
|
-
"tslib": "2.
|
|
62
|
-
"typescript": "4.4
|
|
61
|
+
"tslib": "2.4.0",
|
|
62
|
+
"typescript": "4.6.4",
|
|
63
63
|
"url-loader": "4.1.0",
|
|
64
64
|
"webpack": "4.43.0",
|
|
65
65
|
"webpack-cli": "3.3.11",
|
|
66
66
|
"webpack-dev-server": "3.10.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@types/node": "
|
|
69
|
+
"@types/node": "17.0.41",
|
|
70
70
|
"rimraf": "3.0.2"
|
|
71
71
|
}
|
|
72
72
|
}
|