@intelligentgraphics/ig.gfx.packager 2.1.2 → 2.1.3
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/build/index.js +27 -58
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +4 -0
package/build/index.js
CHANGED
|
@@ -3847,21 +3847,14 @@ const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
|
|
|
3847
3847
|
const PACKAGE_FILE = "_Package.json";
|
|
3848
3848
|
const INDEX_FILE = "_Index.json";
|
|
3849
3849
|
const ANIMATION_FILE = ".animation.json";
|
|
3850
|
-
var Mode;
|
|
3851
|
-
|
|
3852
|
-
(function (Mode) {
|
|
3853
|
-
Mode[Mode["Standard"] = 0] = "Standard";
|
|
3854
|
-
Mode[Mode["IG_GFX"] = 1] = "IG_GFX";
|
|
3855
|
-
})(Mode || (Mode = {}));
|
|
3856
|
-
|
|
3857
3850
|
let validateSchema;
|
|
3858
3851
|
const runtimeScripts = ["Interactor", "Core", "Mixed"];
|
|
3859
3852
|
const notRuntimeScripts = ["Context", "Evaluator"];
|
|
3860
3853
|
|
|
3861
3854
|
const executePackager = async options => {
|
|
3862
|
-
const logStep = step => (0, _util2.logPackageMessage)(
|
|
3855
|
+
const logStep = step => (0, _util2.logPackageMessage)(options.data.Package, step);
|
|
3863
3856
|
|
|
3864
|
-
const packageName = `${options.
|
|
3857
|
+
const packageName = `${options.data.Package}_${options.version}`;
|
|
3865
3858
|
const binDir = path.join(options.cwd, "bin");
|
|
3866
3859
|
fs.ensureDirSync(binDir);
|
|
3867
3860
|
const zipFilePath = path.join(binDir, packageName + ".zip");
|
|
@@ -3884,7 +3877,8 @@ const buildArchive = async ({
|
|
|
3884
3877
|
domain,
|
|
3885
3878
|
subdomain,
|
|
3886
3879
|
cwd,
|
|
3887
|
-
folderPath
|
|
3880
|
+
folderPath,
|
|
3881
|
+
data
|
|
3888
3882
|
}, zipFilePath, logStep) => {
|
|
3889
3883
|
if (validateSchema === undefined) {
|
|
3890
3884
|
validateSchema = await _axios.default.get("https://archive.intelligentgraphics.biz/schemas/gfx/animation.json").then(({
|
|
@@ -3898,41 +3892,14 @@ const buildArchive = async ({
|
|
|
3898
3892
|
}).compile(data));
|
|
3899
3893
|
}
|
|
3900
3894
|
|
|
3901
|
-
let mode = Mode.Standard;
|
|
3902
|
-
|
|
3903
|
-
if (domain === "IG") {
|
|
3904
|
-
switch (subdomain) {
|
|
3905
|
-
case "GFX.Standard":
|
|
3906
|
-
case "GFX.Furniture":
|
|
3907
|
-
mode = Mode.IG_GFX;
|
|
3908
|
-
console.log("Special Mode: IG.GFX");
|
|
3909
|
-
break;
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
3895
|
const scriptDirectories = [];
|
|
3914
3896
|
let primaryScriptDir;
|
|
3915
3897
|
const libFilePath = path.join(cwd, "bin", `${domain}.${subdomain}.min.js`);
|
|
3916
3898
|
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
if (dir === "Standard") {
|
|
3923
|
-
scriptDirectories.push(path.join(cwd, "src", dir, "images"));
|
|
3924
|
-
}
|
|
3925
|
-
|
|
3926
|
-
break;
|
|
3927
|
-
|
|
3928
|
-
default:
|
|
3929
|
-
if (fs.existsSync(path.join(folderPath, "Scripts"))) {
|
|
3930
|
-
scriptDirectories.push(path.join(folderPath, "Scripts"));
|
|
3931
|
-
} else {
|
|
3932
|
-
scriptDirectories.push(folderPath);
|
|
3933
|
-
}
|
|
3934
|
-
|
|
3935
|
-
break;
|
|
3899
|
+
if (fs.existsSync(path.join(folderPath, "Scripts"))) {
|
|
3900
|
+
scriptDirectories.push(path.join(folderPath, "Scripts"));
|
|
3901
|
+
} else {
|
|
3902
|
+
scriptDirectories.push(folderPath);
|
|
3936
3903
|
}
|
|
3937
3904
|
|
|
3938
3905
|
try {
|
|
@@ -3942,6 +3909,11 @@ const buildArchive = async ({
|
|
|
3942
3909
|
throw new Error(`Expected scripts directory "${scriptDirectories[0]}" to exist`);
|
|
3943
3910
|
}
|
|
3944
3911
|
|
|
3912
|
+
if (subdomain === "GFX.Standard") {
|
|
3913
|
+
logStep(`Including Images folder`);
|
|
3914
|
+
scriptDirectories.push(path.join(folderPath, "Images"));
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3945
3917
|
const manifest = _igTools.FileUtil.readJsonFile(path.join(primaryScriptDir, PACKAGE_FILE));
|
|
3946
3918
|
|
|
3947
3919
|
if (manifest !== undefined) {
|
|
@@ -4005,22 +3977,19 @@ Packaging without a javascript file is only allowed when animation json files ar
|
|
|
4005
3977
|
* Copyright (C) ${date.getFullYear()} intelligentgraphics. All Rights Reserved. */`;
|
|
4006
3978
|
}
|
|
4007
3979
|
|
|
4008
|
-
if (!library.includes(`${domain}.${subdomain}`)) {
|
|
4009
|
-
library += `
|
|
4010
|
-
var ${domain};
|
|
4011
|
-
(function (${domain}) {
|
|
4012
|
-
var ${subdomain};
|
|
4013
|
-
(function (${subdomain}) {
|
|
4014
|
-
})(${subdomain} = ${domain}.${subdomain} || (${domain}.${subdomain} = {}));
|
|
4015
|
-
})(${domain} || (${domain} = {}));
|
|
4016
|
-
`;
|
|
4017
|
-
}
|
|
4018
|
-
|
|
4019
3980
|
if (animations.size > 0) {
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
3981
|
+
const [scriptDomain, scriptSubdomain] = data.Scope.split(".");
|
|
3982
|
+
const scope = `${scriptDomain}.${scriptSubdomain}`;
|
|
3983
|
+
|
|
3984
|
+
if (!library.includes(scope)) {
|
|
3985
|
+
library += `
|
|
3986
|
+
var ${scriptDomain};
|
|
3987
|
+
(function (${scriptDomain}) {
|
|
3988
|
+
var ${scriptSubdomain};
|
|
3989
|
+
(function (${scriptSubdomain}) {
|
|
3990
|
+
})(${scriptSubdomain} = ${scriptDomain}.${scriptSubdomain} || (${scriptDomain}.${scriptSubdomain} = {}));
|
|
3991
|
+
})(${scriptDomain} || (${scriptDomain} = {}));
|
|
3992
|
+
`;
|
|
4024
3993
|
}
|
|
4025
3994
|
|
|
4026
3995
|
for (const [name, data] of animations) {
|
|
@@ -4032,7 +4001,7 @@ Packaging without a javascript file is only allowed when animation json files ar
|
|
|
4032
4001
|
const minifyResult = terser.minify(library, {
|
|
4033
4002
|
ecma: 5
|
|
4034
4003
|
});
|
|
4035
|
-
archive.file(`${
|
|
4004
|
+
archive.file(`${data.Package}.js`, minifyResult.code);
|
|
4036
4005
|
|
|
4037
4006
|
for (const directory of scriptDirectories) {
|
|
4038
4007
|
try {
|
|
@@ -7987,7 +7956,7 @@ module.exports = require("util");
|
|
|
7987
7956
|
/***/ ((module) => {
|
|
7988
7957
|
|
|
7989
7958
|
"use strict";
|
|
7990
|
-
module.exports = JSON.parse('{"name":"@intelligentgraphics/ig.gfx.packager","version":"2.1.
|
|
7959
|
+
module.exports = JSON.parse('{"name":"@intelligentgraphics/ig.gfx.packager","version":"2.1.3","description":"IG.GFX.Packager 2.1.3 (2.1.3.100)","main":"build/index.js","private":false,"publishConfig":{"access":"public"},"bin":{"packager":"./build/index.js"},"files":["build","locales","scripts"],"scripts":{"dist":"webpack","clean":"rimraf build *.tsbuildinfo","prepublishOnly":"yarn clean && yarn dist","test":"jest","_postinstall":"node scripts/postinstall.js"},"author":"Michael Beier <mb@intelligentgraphics.biz>","dependencies":{"ajv":"^8.6.2","axios":"^0.21.1","core-js":"^3.16.0","execa":"^5.1.1","fs-extra":"^10.0.0","glob":"^7.1.4","jszip":"^3.10.0","rimraf":"^3.0.2","source-map-support":"^0.5.19","terser":"^4.8.0","typedoc":"~0.22.15","typescript":"~4.6.3","update-notifier":"^5.1.0","v8-compile-cache":"^2.1.1","y18n":"^5.0.8","yargs":"^17.0.1"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-proposal-object-rest-spread":"^7.14.7","@babel/preset-env":"^7.14.9","@intelligentgraphics/ig.tools.core":"^1.5.1","@intelligentgraphics/ig.utilities":"^1.6.6","@types/archiver":"^5.1.1","@types/fs-extra":"^9.0.12","@types/glob":"^7.1.4","@types/node":"^16.4.11","@types/rimraf":"^3.0.1","@types/update-notifier":"^5.1.0","@types/yargs":"^17.0.2","babel-loader":"^8.1.0","jest":"^28.1.1","ts-jest":"^28.0.5","ts-loader":"^9.2.5","ts-node":"^10.1.0","webpack":"^5.64.4","webpack-cli":"^4.7.2"},"jest":{"transform":{"\\\\.tsx?$":"ts-jest"},"testRegex":"(.*\\\\.(test))\\\\.(ts|tsx)$","moduleFileExtensions":["ts","tsx","js","json"],"moduleNameMapper":{"^~/(.*)":"<rootDir>/src/$1"},"testEnvironmentOptions":{"url":"http://localhost/"}}}');
|
|
7991
7960
|
|
|
7992
7961
|
/***/ })
|
|
7993
7962
|
|