@microtronics/studio-cli 0.9.1 → 0.10.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/CHANGELOG.md +14 -0
- package/dist/studio-cli.d.ts +2265 -6
- package/out/api.d.ts.map +1 -1
- package/out/api.js +5 -1
- package/out/cliFS.js +1 -1
- package/out/dde/fileGenerators/xml.d.ts.map +1 -1
- package/out/dde/fileGenerators/xml.js +2 -29
- package/out/defaultFiles.d.ts.map +1 -1
- package/out/defaultFiles.js +16 -0
- package/out/globals.d.ts.map +1 -1
- package/out/globals.js +9 -0
- package/out/helper.d.ts.map +1 -1
- package/out/helper.js +41 -0
- package/out/main.js +35 -50
- package/out/manifest.d.ts.map +1 -1
- package/out/manifest.js +195 -0
- package/out/package/apm.d.ts.map +1 -0
- package/out/package/apm.js +288 -0
- package/out/package/package.d.ts.map +1 -0
- package/out/package/package.js +153 -0
- package/out/registryAPI.d.ts.map +1 -1
- package/out/registryAPI.js +140 -1
- package/out/scriptRunner.d.ts.map +1 -1
- package/out/scriptRunner.js +3 -2
- package/out/typings/registry.d.ts.map +1 -1
- package/package.json +75 -73
package/out/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,MAAM,EACN,WAAW,EACX,YAAY,EACZ,cAAc,EACd,OAAO,EACP,GAAG,EACH,OAAO,EACP,GAAG,EACH,CAAC"}
|
package/out/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DLO = exports.Globals = exports.DeviceProfiles = exports.DefaultFiles = exports.Diagnostics = exports.Helper = exports.DDE = exports.DDE_Core = exports.Registry = exports.Manifest = exports.Dependencies = void 0;
|
|
3
|
+
exports.APM = exports.Package = exports.DLO = exports.Globals = exports.DeviceProfiles = exports.DefaultFiles = exports.Diagnostics = exports.Helper = exports.DDE = exports.DDE_Core = exports.Registry = exports.Manifest = exports.Dependencies = void 0;
|
|
4
4
|
const dependencies_1 = require("./dependencies");
|
|
5
5
|
Object.defineProperty(exports, "Dependencies", { enumerable: true, get: function () { return dependencies_1.Dependencies; } });
|
|
6
6
|
const manifest_1 = require("./manifest");
|
|
@@ -23,4 +23,8 @@ const globals_1 = require("./globals");
|
|
|
23
23
|
Object.defineProperty(exports, "Globals", { enumerable: true, get: function () { return globals_1.Globals; } });
|
|
24
24
|
const dlo_1 = require("./dlo/dlo");
|
|
25
25
|
Object.defineProperty(exports, "DLO", { enumerable: true, get: function () { return dlo_1.DLO; } });
|
|
26
|
+
const package_1 = require("./package/package");
|
|
27
|
+
Object.defineProperty(exports, "Package", { enumerable: true, get: function () { return package_1.Package; } });
|
|
28
|
+
const apm_1 = require("./package/apm");
|
|
29
|
+
Object.defineProperty(exports, "APM", { enumerable: true, get: function () { return apm_1.APM; } });
|
|
26
30
|
//# sourceMappingURL=api.js.map
|
package/out/cliFS.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../../src/dde/fileGenerators/xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../../src/dde/fileGenerators/xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;AAQlC,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,MAAM,CAA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1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateXMLFromMap = generateXMLFromMap;
|
|
4
|
-
exports.patchValueWithArrayInfo = patchValueWithArrayInfo;
|
|
5
4
|
const coreDefinitions_1 = require("../coreDefinitions");
|
|
6
5
|
var TransferDirection = coreDefinitions_1.DDE_Core.TransferDirection;
|
|
7
6
|
var parseXMLValueWithRelation = coreDefinitions_1.DDE_Core.parseXMLValueWithRelation;
|
|
8
7
|
var parseXMLBitmask = coreDefinitions_1.DDE_Core.parseXMLBitmask;
|
|
9
8
|
var parseXMLDefaultValue = coreDefinitions_1.DDE_Core.parseXMLDefaultValue;
|
|
10
9
|
var fieldTypeDefinitions = coreDefinitions_1.DDE_Core.fieldTypeDefinitions;
|
|
10
|
+
const helper_1 = require("../../helper");
|
|
11
11
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
12
12
|
function generateXMLFromMap(ddeMap) {
|
|
13
13
|
const indent = '';
|
|
@@ -171,35 +171,8 @@ function patchFieldWithArrayInfo(ddeField) {
|
|
|
171
171
|
// eslint-disable-next-line prefer-const
|
|
172
172
|
for (let [attribute, value] of Object.entries(clonedField)) {
|
|
173
173
|
// @ts-ignore
|
|
174
|
-
clonedField[attribute] = patchValueWithArrayInfo(value, arrayIndex);
|
|
174
|
+
clonedField[attribute] = helper_1.Helper.patchValueWithArrayInfo(value, arrayIndex);
|
|
175
175
|
}
|
|
176
176
|
return clonedField;
|
|
177
177
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Parse and resolve any {index} or {index+X} within the given value
|
|
180
|
-
* @param valueToPatch
|
|
181
|
-
* @param arrayIndex
|
|
182
|
-
*/
|
|
183
|
-
function patchValueWithArrayInfo(valueToPatch, arrayIndex) {
|
|
184
|
-
// look for these phrases in attribute strings: "<a>i+<b>", "<a>o+<b>", "<a>n+<b>" (or "<a>i", "<a>o", "<a>n")
|
|
185
|
-
const valueNTHS = `${valueToPatch}`.match(/\{\d*(index)(\+\d*)?}/g);
|
|
186
|
-
if (valueNTHS) {
|
|
187
|
-
let patchedValue = valueToPatch;
|
|
188
|
-
valueNTHS.forEach((nth) => {
|
|
189
|
-
// normalize & parse "(xn+y)" string
|
|
190
|
-
const normalizedNTH = nth.replace(/\+0$/, '');
|
|
191
|
-
const scope = normalizedNTH.match(/index/)?.[0];
|
|
192
|
-
if (scope) {
|
|
193
|
-
const stepOffset = normalizedNTH.slice(1, -1).split(scope)[1];
|
|
194
|
-
const offset = parseInt(stepOffset) || 0;
|
|
195
|
-
// reassign the patched value
|
|
196
|
-
patchedValue = patchedValue.replace(nth, `${arrayIndex + offset}`);
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
return patchedValue;
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
return valueToPatch;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
178
|
//# sourceMappingURL=xml.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultFiles.d.ts","sourceRoot":"","sources":["../src/defaultFiles.ts"],"names":[],"mappings":"AAMA,yBAAiB,YAAY,CAAC;IACtB,MAAM,SAAS;;;;;;;;;;;;;;;;;;KAmBrB,CAAC;IAIK,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoDrB,CAAC;
|
|
1
|
+
{"version":3,"file":"defaultFiles.d.ts","sourceRoot":"","sources":["../src/defaultFiles.ts"],"names":[],"mappings":"AAMA,yBAAiB,YAAY,CAAC;IACtB,MAAM,SAAS;;;;;;;;;;;;;;;;;;KAmBrB,CAAC;IAIK,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoDrB,CAAC;IAEF;;OAEG;IACI,MAAM,MAAM,SAAU,MAAM,WAIlC,CAAC;IAEF;;OAEG;IACI,MAAM,SAAS,4KAI0D,CAAC;CACjF"}
|
package/out/defaultFiles.js
CHANGED
|
@@ -83,5 +83,21 @@ var DefaultFiles;
|
|
|
83
83
|
mainDFILES: `${dfilesDirectoryName}/main.dfiles`
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Changelog.md
|
|
88
|
+
*/
|
|
89
|
+
DefaultFiles.readme = (name) => {
|
|
90
|
+
return `# ${name} README
|
|
91
|
+
|
|
92
|
+
This is the README for your project "${name}". Write a brief description what this project is about.`;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Changelog.md
|
|
96
|
+
*/
|
|
97
|
+
DefaultFiles.changelog = `# Changelog
|
|
98
|
+
|
|
99
|
+
All notable changes to this project will be documented in this file.
|
|
100
|
+
|
|
101
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).`;
|
|
86
102
|
})(DefaultFiles || (exports.DefaultFiles = DefaultFiles = {}));
|
|
87
103
|
//# sourceMappingURL=defaultFiles.js.map
|
package/out/globals.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AAUxC,yBAAiB,OAAO,CAAC;IACxB,UAAiB,OAAO;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB;IAED;;;;OAIG;IACH,SAAsB,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAkClE;CACD"}
|
|
1
|
+
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AAUxC,yBAAiB,OAAO,CAAC;IACxB;;OAEG;IACH,KAAY,GAAG;QACd,KAAK,UAAU;QACf,KAAK,UAAU;QACf,UAAU,eAAe;KACzB;IAED,UAAiB,OAAO;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB;IAED;;;;OAIG;IACH,SAAsB,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAkClE;CACD"}
|
package/out/globals.js
CHANGED
|
@@ -34,6 +34,15 @@ var convertBlobToString = helper_1.Helper.convertBlobToString;
|
|
|
34
34
|
const DLO_PATH = defaultFiles_1.DefaultFiles.filePaths.dlo.path;
|
|
35
35
|
var Globals;
|
|
36
36
|
(function (Globals) {
|
|
37
|
+
/**
|
|
38
|
+
* Supported ENV for the studio environment
|
|
39
|
+
*/
|
|
40
|
+
let ENV;
|
|
41
|
+
(function (ENV) {
|
|
42
|
+
ENV["lucky"] = "lucky";
|
|
43
|
+
ENV["winny"] = "winny";
|
|
44
|
+
ENV["production"] = "production";
|
|
45
|
+
})(ENV = Globals.ENV || (Globals.ENV = {}));
|
|
37
46
|
/**
|
|
38
47
|
* Read all ini files from the project directory
|
|
39
48
|
* @param cwd
|
package/out/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAG1C,yBAAiB,MAAM,CAAC;IACvB;;;;OAIG;IACH,SAAgB,0BAA0B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,KAAK,GACf;QACF,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACrB,CAQA;IAID;;;OAGG;IACH,SAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,UAE7D;IAED,SAAgB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IG;IACH,SAAgB,uBAAuB,CAAC,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAoB5E;CACD"}
|
package/out/helper.js
CHANGED
|
@@ -78,5 +78,46 @@ var Helper;
|
|
|
78
78
|
Helper.isNumeric = (v) => {
|
|
79
79
|
return !Array.isArray(v) && v - parseFloat(v) + 1 >= 0;
|
|
80
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Convert an uint8Array to a base64 string
|
|
83
|
+
* @param bytes
|
|
84
|
+
*/
|
|
85
|
+
function bufferToBase64(bytes) {
|
|
86
|
+
let binary = '';
|
|
87
|
+
const len = bytes.byteLength;
|
|
88
|
+
for (let i = 0; i < len; i++) {
|
|
89
|
+
binary += String.fromCharCode(bytes[i]);
|
|
90
|
+
}
|
|
91
|
+
return btoa(binary);
|
|
92
|
+
}
|
|
93
|
+
Helper.bufferToBase64 = bufferToBase64;
|
|
94
|
+
/**
|
|
95
|
+
* Parse and resolve any {index} or {index+X} within the given value
|
|
96
|
+
* @param valueToPatch
|
|
97
|
+
* @param arrayIndex
|
|
98
|
+
*/
|
|
99
|
+
function patchValueWithArrayInfo(valueToPatch, arrayIndex) {
|
|
100
|
+
// look for these phrases in attribute strings: "<a>i+<b>", "<a>o+<b>", "<a>n+<b>" (or "<a>i", "<a>o", "<a>n")
|
|
101
|
+
const valueNTHS = `${valueToPatch}`.match(/\{\d*(index)(\+\d*)?}/g);
|
|
102
|
+
if (valueNTHS) {
|
|
103
|
+
let patchedValue = valueToPatch;
|
|
104
|
+
valueNTHS.forEach((nth) => {
|
|
105
|
+
// normalize & parse "(xn+y)" string
|
|
106
|
+
const normalizedNTH = nth.replace(/\+0$/, '');
|
|
107
|
+
const scope = normalizedNTH.match(/index/)?.[0];
|
|
108
|
+
if (scope) {
|
|
109
|
+
const stepOffset = normalizedNTH.slice(1, -1).split(scope)[1];
|
|
110
|
+
const offset = parseInt(stepOffset) || 0;
|
|
111
|
+
// reassign the patched value
|
|
112
|
+
patchedValue = patchedValue.replace(nth, `${arrayIndex + offset}`);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return patchedValue;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return valueToPatch;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
Helper.patchValueWithArrayInfo = patchValueWithArrayInfo;
|
|
81
122
|
})(Helper || (exports.Helper = Helper = {}));
|
|
82
123
|
//# sourceMappingURL=helper.js.map
|
package/out/main.js
CHANGED
|
@@ -10,35 +10,44 @@ const vscode_uri_1 = require("vscode-uri");
|
|
|
10
10
|
const dependencies_1 = require("./dependencies");
|
|
11
11
|
var installDependencies = dependencies_1.Dependencies.installDependencies;
|
|
12
12
|
var installDependency = dependencies_1.Dependencies.installDependency;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const scriptRunner_1 = require("./scriptRunner");
|
|
13
|
+
const package_1 = require("./package/package");
|
|
14
|
+
const apm_1 = require("./package/apm");
|
|
15
|
+
const globals_1 = require("./globals");
|
|
17
16
|
const program = new commander_1.Command();
|
|
18
17
|
// dummy cwd
|
|
19
18
|
const devPath = process.env.NODE_ENV === 'local-dev' ? './dev' : '';
|
|
20
19
|
const cwd = vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.file(process.cwd()), devPath);
|
|
21
20
|
program.version(package_json_1.default.version).usage('<command>');
|
|
22
21
|
function handleStudioEnv(env) {
|
|
23
|
-
process.env.STUDIO_ENV = env ||
|
|
24
|
-
if (env && env !==
|
|
22
|
+
process.env.STUDIO_ENV = env || globals_1.Globals.ENV.production;
|
|
23
|
+
if (env && env !== globals_1.Globals.ENV.production) {
|
|
25
24
|
console.log(`Using STUDIO_ENV=${env}`);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function getStudioApiToken(opts) {
|
|
29
28
|
return opts?.token || null;
|
|
30
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Generic option for the STUDIO_ENV
|
|
32
|
+
*/
|
|
33
|
+
const optionStudioEnv = new commander_1.Option('-e, --env <environment>', 'CLI target environment (defaults to STUDIO_ENV environment variable)')
|
|
34
|
+
.default(process.env['STUDIO_ENV'])
|
|
35
|
+
.choices(Object.values(globals_1.Globals.ENV));
|
|
36
|
+
/**
|
|
37
|
+
* Generic option for the STUDIO_TOKEN
|
|
38
|
+
*/
|
|
39
|
+
const optionStudioToken = new commander_1.Option('--token <API-token>', 'API Access Token (defaults to STUDIO_TOKEN environment variable)').default(process.env['STUDIO_TOKEN']);
|
|
31
40
|
program
|
|
32
41
|
.command('install')
|
|
33
42
|
.aliases(['i'])
|
|
34
43
|
.description('install all the dependencies in your project')
|
|
35
44
|
.arguments('[dependency...]')
|
|
36
45
|
.allowExcessArguments(true)
|
|
37
|
-
.
|
|
38
|
-
.
|
|
46
|
+
.addOption(optionStudioEnv)
|
|
47
|
+
.addOption(optionStudioToken)
|
|
39
48
|
.action(async (dependencies, opts) => {
|
|
40
49
|
handleStudioEnv(opts.env);
|
|
41
|
-
const apiToken =
|
|
50
|
+
const apiToken = getStudioApiToken(opts);
|
|
42
51
|
try {
|
|
43
52
|
if (dependencies.length > 0) {
|
|
44
53
|
for (const dependency of dependencies) {
|
|
@@ -56,46 +65,22 @@ program
|
|
|
56
65
|
});
|
|
57
66
|
program
|
|
58
67
|
.command('build')
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
if (result.ddeJSON) {
|
|
77
|
-
await dde_1.DDE.exportMyDatanetXML(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
78
|
-
await dde_1.DDE.exportHistoryJson(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
79
|
-
await dde_1.DDE.exportOpenApi(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
80
|
-
await dde_1.DDE.exportAutoDloFiles(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
81
|
-
await dlo_1.DLO.exportDloConfig(cwd, cliFS_1.cliFS);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
throw new Error('Project has errors!');
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (!apmPart || apmPart === 'dlo') {
|
|
88
|
-
//todo skip if manifest.dlo not set!
|
|
89
|
-
const compiler = new compiler_1.DloCompiler();
|
|
90
|
-
await compiler.compile(cwd, cliFS_1.cliFS);
|
|
91
|
-
}
|
|
92
|
-
if (!apmPart || apmPart === 'pov') {
|
|
93
|
-
await scriptRunner_1.Shell.tryBuildPov(cwd, cliFS_1.cliFS);
|
|
94
|
-
}
|
|
95
|
-
if (!apmPart || apmPart === 'blo') {
|
|
96
|
-
await scriptRunner_1.Shell.tryBuildBlo(cwd, cliFS_1.cliFS);
|
|
97
|
-
}
|
|
98
|
-
console.log('DONE');
|
|
68
|
+
.addOption(new commander_1.Option('-p --part <APM part>', 'APM part that should be build').choices(['dde', 'dlo', 'pov', 'blo']))
|
|
69
|
+
.action(async (opts) => {
|
|
70
|
+
await package_1.Package.buildAll(cwd, cliFS_1.cliFS, opts.part);
|
|
71
|
+
});
|
|
72
|
+
const releasePhaseArguments = Object.values(apm_1.APM.TagPhase);
|
|
73
|
+
program
|
|
74
|
+
.command('publish')
|
|
75
|
+
.addOption(new commander_1.Option('-ph --phase <release phase>', 'specify a release phase')
|
|
76
|
+
.choices(releasePhaseArguments)
|
|
77
|
+
.default('release'))
|
|
78
|
+
.addOption(optionStudioEnv)
|
|
79
|
+
.addOption(optionStudioToken)
|
|
80
|
+
.action(async (opts) => {
|
|
81
|
+
handleStudioEnv(opts.env);
|
|
82
|
+
const token = getStudioApiToken(opts);
|
|
83
|
+
await package_1.Package.releaseAPM(cwd, cliFS_1.cliFS, token, opts.phase, opts.env);
|
|
99
84
|
});
|
|
100
85
|
module.exports = function (argv) {
|
|
101
86
|
program.parse(argv);
|
package/out/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAI/B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,yBAAiB,QAAQ,CAAC;IAEzB,KAAY,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IAE9F,UAAiB,QAAQ;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,cAAc,CAAC;QACrB,OAAO,CAAC,EAAE;YACT,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;SACrB,CAAC;QACF,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,mBAAmB,CAAC,EAAE,YAAY,CAAC;QACnC,sBAAsB,CAAC,EAAE,YAAY,CAAC;QACtC;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,GAAG,CAAC,EAAE;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AE,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,iBAQzF;IAED,SAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,mOAiBtD;IAED,SAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,4dAmB1E;IAED,SAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,uEAM5D;IAED,SAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,kMAe1D;IAED,SAAsB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,2BAMzF;IAID,SAAsB,+BAA+B,CAAC,eAAe,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,2BAgB1G;CACD"}
|
package/out/manifest.js
CHANGED
|
@@ -3,9 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Manifest = void 0;
|
|
4
4
|
const vscode_uri_1 = require("vscode-uri");
|
|
5
5
|
const helper_1 = require("./helper");
|
|
6
|
+
const image_dimensions_1 = require("image-dimensions");
|
|
7
|
+
const file_type_checker_1 = require("file-type-checker");
|
|
8
|
+
const registryAPI_1 = require("./registryAPI");
|
|
6
9
|
var Manifest;
|
|
7
10
|
(function (Manifest) {
|
|
8
11
|
var convertBlobToString = helper_1.Helper.convertBlobToString;
|
|
12
|
+
let BloAccessLevel;
|
|
13
|
+
(function (BloAccessLevel) {
|
|
14
|
+
BloAccessLevel["restricted"] = "restricted";
|
|
15
|
+
BloAccessLevel["global"] = "global";
|
|
16
|
+
})(BloAccessLevel = Manifest.BloAccessLevel || (Manifest.BloAccessLevel = {}));
|
|
17
|
+
let PovLocation;
|
|
18
|
+
(function (PovLocation) {
|
|
19
|
+
PovLocation["embedded"] = "$embedded";
|
|
20
|
+
PovLocation["pure"] = "$pure";
|
|
21
|
+
})(PovLocation = Manifest.PovLocation || (Manifest.PovLocation = {}));
|
|
9
22
|
/**
|
|
10
23
|
* Read the studio.json manifest and parse it
|
|
11
24
|
* @param cwd
|
|
@@ -34,5 +47,187 @@ var Manifest;
|
|
|
34
47
|
return !!manifest.library;
|
|
35
48
|
}
|
|
36
49
|
Manifest.isLibraryProject = isLibraryProject;
|
|
50
|
+
/**
|
|
51
|
+
* Validates if the properties within
|
|
52
|
+
* @param cwd
|
|
53
|
+
* @param fs
|
|
54
|
+
* @param manifest
|
|
55
|
+
*/
|
|
56
|
+
async function validateManifest(cwd, fs, manifest) {
|
|
57
|
+
if (!manifest) {
|
|
58
|
+
manifest = await read(cwd, fs);
|
|
59
|
+
}
|
|
60
|
+
validatePOVSettings(manifest);
|
|
61
|
+
validateBLOSettings(manifest);
|
|
62
|
+
validateEngineSettings(manifest);
|
|
63
|
+
await validateApplicationIcon(cwd, fs, manifest);
|
|
64
|
+
}
|
|
65
|
+
Manifest.validateManifest = validateManifest;
|
|
66
|
+
function validateLibraryName(libraryName) {
|
|
67
|
+
const errorMessage = `Library name can only contain 'a' through 'z', '0' through '9', '_' and '-'. The Library name must start with an alphabetic or numeric character.`;
|
|
68
|
+
const valid = libraryName.match(/^[a-z0-9-_]+$/);
|
|
69
|
+
if (valid) {
|
|
70
|
+
const invalidChars = ['-', '_'];
|
|
71
|
+
if (invalidChars.includes(libraryName[0]) || invalidChars.includes(libraryName[libraryName.length - 1])) {
|
|
72
|
+
return errorMessage;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return errorMessage;
|
|
77
|
+
}
|
|
78
|
+
if (libraryName.length < 3 || libraryName.length > 20) {
|
|
79
|
+
return `The library name is beyond permissible length of 20 characters.`;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
Manifest.validateLibraryName = validateLibraryName;
|
|
84
|
+
async function validateProjectName(name, isLibrary) {
|
|
85
|
+
if (isLibrary) {
|
|
86
|
+
return validateLibraryName(name);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const errorMessage = `Project name can only contain 'A' through 'Z', 'a' through 'z', '0' through '9', ' ', '_' and '-'. The Project name must start with an alphabetic or numeric character.`;
|
|
90
|
+
// ...validate...
|
|
91
|
+
const validChars = name.match(/^([a-zA-Z0-9 _-]+)$/);
|
|
92
|
+
if (!validChars) {
|
|
93
|
+
return errorMessage;
|
|
94
|
+
}
|
|
95
|
+
if (name.length < 3 || name.length > 40) {
|
|
96
|
+
return `The project name is beyond permissible length of 40 characters.`;
|
|
97
|
+
}
|
|
98
|
+
const invalidChars = ['-', '_', ' '];
|
|
99
|
+
if (invalidChars.includes(name[0]) || invalidChars.includes(name[name.length - 1])) {
|
|
100
|
+
return errorMessage;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
Manifest.validateProjectName = validateProjectName;
|
|
106
|
+
async function validateDescription(description) {
|
|
107
|
+
if (description.length < 5) {
|
|
108
|
+
return `The description must have at least 5 characters.`;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
Manifest.validateDescription = validateDescription;
|
|
115
|
+
async function validatePublisherId(publisher) {
|
|
116
|
+
if (!publisher) {
|
|
117
|
+
return `No publisher set yet`;
|
|
118
|
+
}
|
|
119
|
+
const errorMessage = `Publisher can only contain 'A' through 'Z', 'a' through 'z', '0' through '9' and '-'. The Publisher start with an alphabetic or numeric character.`;
|
|
120
|
+
const valid = publisher.match(/^[a-zA-Z0-9-]+$/);
|
|
121
|
+
if (valid) {
|
|
122
|
+
const invalidChars = ['-'];
|
|
123
|
+
if (invalidChars.includes(publisher[0]) || invalidChars.includes(publisher[publisher.length - 1])) {
|
|
124
|
+
return errorMessage;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
Manifest.validatePublisherId = validatePublisherId;
|
|
130
|
+
async function validatePublisherOnline(token, publisher) {
|
|
131
|
+
const exists = await registryAPI_1.Registry.getPublisher(token, publisher);
|
|
132
|
+
if (!exists) {
|
|
133
|
+
return `Publisher '${publisher}' does not exist.`;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
Manifest.validatePublisherOnline = validatePublisherOnline;
|
|
138
|
+
const REGEX_SERVER_DOMAIN = /^(((?!-))(xn--)?[a-z0-9\-_]{0,61}[a-z0-9]{1,1}\.)*(xn--)?([a-z0-9-]{1,61}|[a-z0-9-]{1,30})\.[a-z]{2,}$/;
|
|
139
|
+
async function validateRegistryAllowedBackends(allowedBackends) {
|
|
140
|
+
if (allowedBackends === undefined) {
|
|
141
|
+
return 'Allowed backends not specified yet';
|
|
142
|
+
}
|
|
143
|
+
if (Array.isArray(allowedBackends) || allowedBackends?.includes(';')) {
|
|
144
|
+
const validationArray = allowedBackends?.includes(';') ? allowedBackends.split(';') : allowedBackends;
|
|
145
|
+
for (const domain of validationArray) {
|
|
146
|
+
if (!domain.match(REGEX_SERVER_DOMAIN)) {
|
|
147
|
+
return `Domain "${domain}" is invalid`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else if (!allowedBackends?.match(REGEX_SERVER_DOMAIN) && allowedBackends !== '*') {
|
|
152
|
+
return `Invalid value for "allowedBackends"`;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
Manifest.validateRegistryAllowedBackends = validateRegistryAllowedBackends;
|
|
37
157
|
})(Manifest || (exports.Manifest = Manifest = {}));
|
|
158
|
+
function validatePOVSettings(manifest) {
|
|
159
|
+
const { pov } = manifest;
|
|
160
|
+
if (!pov) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (pov.details) {
|
|
164
|
+
if (!Object.hasOwn(pov.details, 'buildCommand')) {
|
|
165
|
+
throw new Error('Setting "pov.details.buildCommand" missing!');
|
|
166
|
+
}
|
|
167
|
+
if (!Object.hasOwn(pov.details, 'workingPath')) {
|
|
168
|
+
throw new Error('Setting "pov.details.workingPath" missing!');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function validateBLOSettings(manifest) {
|
|
173
|
+
const { blo } = manifest;
|
|
174
|
+
if (!blo) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (!Object.hasOwn(blo, 'buildCommand')) {
|
|
178
|
+
throw new Error('Setting "blo.buildCommand" missing!');
|
|
179
|
+
}
|
|
180
|
+
if (!Object.hasOwn(blo, 'workingPath')) {
|
|
181
|
+
throw new Error('Setting "blo.workingPath" missing!');
|
|
182
|
+
}
|
|
183
|
+
if (blo.accessLevel &&
|
|
184
|
+
![Manifest.BloAccessLevel.restricted, Manifest.BloAccessLevel.global].includes(blo.accessLevel)) {
|
|
185
|
+
throw new Error(`Only "${Manifest.BloAccessLevel.restricted}" or "${Manifest.BloAccessLevel.global}" are allowed as value for "blo.accessLevel"!`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function validateEngineSettings(manifest) {
|
|
189
|
+
const { engines } = manifest;
|
|
190
|
+
// validate vor server versions >=52v006
|
|
191
|
+
if (engines?.backend &&
|
|
192
|
+
!engines.backend.match(/(^[5-9][2-9]|[6-9]\d+|\d{3,})v(0(0[6-9]|[1-9]\d)|[1-9]\d{2}|[1-9]\d{3,})$/)) {
|
|
193
|
+
throw new Error('Setting "engines.backend" is invalid');
|
|
194
|
+
}
|
|
195
|
+
validateHwFwOrProductId(manifest);
|
|
196
|
+
}
|
|
197
|
+
function validateHwFwOrProductId(manifest) {
|
|
198
|
+
const { backend, productId, hwfw } = manifest.engines;
|
|
199
|
+
if (backend && backend >= '52v007') {
|
|
200
|
+
if (hwfw && productId) {
|
|
201
|
+
throw new Error('Only "engines.hwfw" or "engines.productId" is allowed!"');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else if (productId) {
|
|
205
|
+
throw new Error('"engines.productId" requires "engines.backend" to be ">=52v007"');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async function validateApplicationIcon(cwd, fs, manifest) {
|
|
209
|
+
const iconPath = manifest.icon;
|
|
210
|
+
if (!iconPath) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const iconUri = vscode_uri_1.Utils.joinPath(cwd, iconPath);
|
|
214
|
+
const iconExist = await fs.stat(iconUri);
|
|
215
|
+
if (!iconExist) {
|
|
216
|
+
throw new Error(`Could not load icon "${iconPath}"`);
|
|
217
|
+
}
|
|
218
|
+
const iconData = await fs.readFile(iconUri);
|
|
219
|
+
const dimensions = (0, image_dimensions_1.imageDimensionsFromData)(iconData);
|
|
220
|
+
if (!dimensions) {
|
|
221
|
+
throw new Error(`App icon could not be validated!`);
|
|
222
|
+
}
|
|
223
|
+
if (dimensions?.width !== dimensions?.height) {
|
|
224
|
+
throw new Error(`App icon has to be a square!`);
|
|
225
|
+
}
|
|
226
|
+
if (dimensions.width > 512 || dimensions.width < 75) {
|
|
227
|
+
throw new Error(`App icon size should be between 75px and 512px!`);
|
|
228
|
+
}
|
|
229
|
+
if (!(0, file_type_checker_1.isPNG)(iconData)) {
|
|
230
|
+
throw new Error(`App icon has to be of type PNG!`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
38
233
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apm.d.ts","sourceRoot":"","sources":["../../src/package/apm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,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