@microtronics/studio-cli 0.35.0 → 0.37.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 +20 -3
- package/dist/studio-cli.d.ts +8 -4
- package/out/dde/coreDefinitions.js +3 -3
- package/out/dde/dde.js +4 -3
- package/out/dde/dynamic-dde.schema.json +2 -2
- package/out/dde/fileGenerators/xml.js +4 -3
- package/out/dde/yamlDdePreCompiler.js +19 -5
- package/out/dlo/CustomWasmFS.js +7 -7
- package/out/dlo/compiler.js +1 -1
- package/out/dlo/preCompiler.js +14 -8
- package/out/main.js +4 -1
- package/out/manifest.js +3 -0
- package/package.json +1 -1
- package/studio-cli-addon +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.37.0 (2025-10-22)
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Features
|
|
6
6
|
|
|
7
|
-
* **cli:**
|
|
7
|
+
* **cli:** add write permission for timeseries for type addon ([d8b8f05](https://bitbucket.org/microtronics-core/vscode-studio/commits/d8b8f059873f2c4503aef8b1a39d96707f843884))
|
|
8
|
+
* **cli:** enhance regex for relation validation ([7d995c4](https://bitbucket.org/microtronics-core/vscode-studio/commits/7d995c47bc6c24abdb2af6717f4df50f727a1b7a))
|
|
9
|
+
* **cli:** enhance support for cross-library relations ([3d9a6f7](https://bitbucket.org/microtronics-core/vscode-studio/commits/3d9a6f789758bfccf01963e7386573a54fe11f71))
|
|
10
|
+
* **cli:** improve container title extraction logic ([2a0618a](https://bitbucket.org/microtronics-core/vscode-studio/commits/2a0618aae01ed30c3c854430b0bd5ff4454b6288))
|
|
11
|
+
* **cli:** update `isApp` logic to handle undefined type ([fc9c12d](https://bitbucket.org/microtronics-core/vscode-studio/commits/fc9c12ddebdffe4ca9fbed10359ce9b8265f3e57))
|
|
12
|
+
* **core:** extend regex patterns for relation validation ([5ffe3b4](https://bitbucket.org/microtronics-core/vscode-studio/commits/5ffe3b4cad70a842111a937e5c8bd9306571f688))
|
|
13
|
+
|
|
14
|
+
## 0.36.0 (2025-09-25)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **cli:** enhance DDE function mangling logic for libraries ([4d2272d](https://bitbucket.org/microtronics-core/vscode-studio/commits/4d2272d627530dbbfb342899549c7c76a99c6c56))
|
|
19
|
+
|
|
20
|
+
## 0.35.0 (2025-09-12)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **cli:** expected test fixtures ([0edb940](https://bitbucket.org/microtronics-core/vscode-studio/commits/0edb940c79aacb0cc631786f141e3cb28ff5cb78))
|
|
8
25
|
* **cli:** replaced shallow clones with structured clones for API method objects ([f8b3a88](https://bitbucket.org/microtronics-core/vscode-studio/commits/f8b3a88b5a81ad3aa5d422a7f36ea1055068b921))
|
|
9
26
|
|
|
10
27
|
## 0.34.0 (2025-09-12)
|
package/dist/studio-cli.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Document as Document_2 } from 'yaml';
|
|
1
2
|
import { LineCounter } from 'yaml';
|
|
3
|
+
import { ParsedNode } from 'yaml';
|
|
2
4
|
import { Range as Range_2 } from 'yaml';
|
|
3
5
|
import { SemVer } from 'semver';
|
|
4
6
|
import { URI } from 'vscode-uri';
|
|
@@ -203,7 +205,7 @@ declare interface components {
|
|
|
203
205
|
allowedApplications?: ("*" | string[]) | null;
|
|
204
206
|
};
|
|
205
207
|
/** @enum {string} */
|
|
206
|
-
ApplicationType: "app" | "addon";
|
|
208
|
+
ApplicationType: "app" | "addon" | "analytics";
|
|
207
209
|
ApplicationInformationBase: {
|
|
208
210
|
version: components["parameters"]["ApplicationVersion"];
|
|
209
211
|
publisherId: components["parameters"]["PublisherId"];
|
|
@@ -1174,7 +1176,7 @@ export declare namespace DDE {
|
|
|
1174
1176
|
* Generate the needed xml for the myDatanet application
|
|
1175
1177
|
* @param ddeJSON
|
|
1176
1178
|
*/
|
|
1177
|
-
export function generateMyDatanetXML(ddeJSON: DDEJson): string;
|
|
1179
|
+
export function generateMyDatanetXML(manifest: Manifest.Manifest, ddeJSON: DDEJson): string;
|
|
1178
1180
|
/**
|
|
1179
1181
|
* Generate the xml dde notation and write it to the correct dist directory
|
|
1180
1182
|
* @param cwd
|
|
@@ -1844,7 +1846,7 @@ declare class DloPreCompiler {
|
|
|
1844
1846
|
private dloFileSequencer;
|
|
1845
1847
|
constructor();
|
|
1846
1848
|
get pragmaDynamicFlag(): string | null;
|
|
1847
|
-
preCompileDloFile(cwd: URI, manifest: Manifest.Manifest, fileUri: URI, fileBlob: string[]): {
|
|
1849
|
+
preCompileDloFile(cwd: URI, logger: Log.Logger, manifest: Manifest.Manifest, fileUri: URI, fileBlob: string[]): {
|
|
1848
1850
|
diagnostics: Diagnostics.File[];
|
|
1849
1851
|
data: string;
|
|
1850
1852
|
};
|
|
@@ -4727,6 +4729,7 @@ declare namespace YamlPreCompiler {
|
|
|
4727
4729
|
private readonly usedContainerNames;
|
|
4728
4730
|
private fileDiagnostics;
|
|
4729
4731
|
private readonly libraryDDE;
|
|
4732
|
+
private libraryYaml;
|
|
4730
4733
|
constructor(manifest: Manifest.Manifest, libraryFiles: DDE_Core.LibraryFile[], ddeHistory: DDE.HistoryJson | null);
|
|
4731
4734
|
/**
|
|
4732
4735
|
* Parse the given library files and return the diagnostics
|
|
@@ -4747,8 +4750,9 @@ declare namespace YamlPreCompiler {
|
|
|
4747
4750
|
* @return An object containing the parsed DDE JSON and an array of diagnostic messages related to the file.
|
|
4748
4751
|
*/
|
|
4749
4752
|
parseYamlFile(filePath: URI, yaml: string, libraryName?: string): {
|
|
4750
|
-
parsedDDE: DDEJson;
|
|
4753
|
+
parsedDDE: DDE_Core.DDEJson;
|
|
4751
4754
|
diagnostics: Diagnostics.File[];
|
|
4755
|
+
parsedYaml: null | Document_2.Parsed<ParsedNode, true>;
|
|
4752
4756
|
};
|
|
4753
4757
|
private yamlDocToDdeJson;
|
|
4754
4758
|
private getRealContainerInformation;
|
|
@@ -173,8 +173,8 @@ var DDE_Core;
|
|
|
173
173
|
ContainerName.config9
|
|
174
174
|
];
|
|
175
175
|
DDE_Core.SERVER_CONTAINER = [ContainerName.configA, ContainerName.configB, ContainerName.configC];
|
|
176
|
-
// relation
|
|
177
|
-
DDE_Core.regexRelation =
|
|
176
|
+
// check if the given string is a relation to an app container or library container
|
|
177
|
+
DDE_Core.regexRelation = /^(@[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?(\.[a-zA-Z_][a-zA-Z0-9_]*)*|lib:[a-zA-Z0-9_-]+@[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?(\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
|
|
178
178
|
const STRING_TYPES = ['astring', 'nstring', 'cstring', 'wstring', 'ustring'];
|
|
179
179
|
const NUMBER_TYPES = [
|
|
180
180
|
'int8',
|
|
@@ -225,7 +225,7 @@ var DDE_Core;
|
|
|
225
225
|
if (DDE_Core.regexRelation.exec(`${currentAttributeValue}`)) {
|
|
226
226
|
const isSetPoint = attribute === 'chartSetPoint';
|
|
227
227
|
const [root, ...containerFields] = currentAttributeValue.split('.');
|
|
228
|
-
const containerTitle = root.
|
|
228
|
+
const [, /*libraryRelation*/ containerTitle] = root.split('@'); //remove the @
|
|
229
229
|
const realContainer = Object.values(ddeMap.containers).find(container => container.title === containerTitle);
|
|
230
230
|
const containerField = containerFields.join('.');
|
|
231
231
|
const delimeter = isSetPoint ? ';' : '%';
|
package/out/dde/dde.js
CHANGED
|
@@ -148,8 +148,8 @@ var DDE;
|
|
|
148
148
|
* Generate the needed xml for the myDatanet application
|
|
149
149
|
* @param ddeJSON
|
|
150
150
|
*/
|
|
151
|
-
function generateMyDatanetXML(ddeJSON) {
|
|
152
|
-
return (0, xml_1.generateXMLFromMap)(ddeJSON);
|
|
151
|
+
function generateMyDatanetXML(manifest, ddeJSON) {
|
|
152
|
+
return (0, xml_1.generateXMLFromMap)(manifest, ddeJSON);
|
|
153
153
|
}
|
|
154
154
|
DDE.generateMyDatanetXML = generateMyDatanetXML;
|
|
155
155
|
/**
|
|
@@ -159,7 +159,8 @@ var DDE;
|
|
|
159
159
|
* @param ddeJSON
|
|
160
160
|
*/
|
|
161
161
|
async function exportMyDatanetXML(cwd, fs, logger, ddeJSON) {
|
|
162
|
-
const
|
|
162
|
+
const manifest = await manifest_1.Manifest.read(cwd, fs);
|
|
163
|
+
const xml = (0, xml_1.generateXMLFromMap)(manifest, ddeJSON);
|
|
163
164
|
const distFile = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.ddeXmlPath);
|
|
164
165
|
await fs.writeFile(distFile, xml);
|
|
165
166
|
logger.log('Generated', defaultFiles_1.DefaultFiles.filePaths.dist.ddeXmlPath);
|
|
@@ -805,14 +805,14 @@
|
|
|
805
805
|
"relationLinkPattern": {
|
|
806
806
|
"anyOf": [
|
|
807
807
|
{
|
|
808
|
-
"pattern": "
|
|
808
|
+
"pattern": "^(@[a-zA-Z_][a-zA-Z0-9_]*\\.[a-zA-Z_][a-zA-Z0-9_]*(\\[[^\\]]+\\])?(\\.[a-zA-Z_][a-zA-Z0-9_]*)*|lib:[a-zA-Z0-9_-]+@[a-zA-Z_][a-zA-Z0-9_]*\\.[a-zA-Z_][a-zA-Z0-9_]*(\\[[^\\]]+\\])?(\\.[a-zA-Z_][a-zA-Z0-9_]*)*)$"
|
|
809
809
|
}
|
|
810
810
|
]
|
|
811
811
|
},
|
|
812
812
|
"setPointRelationPattern": {
|
|
813
813
|
"anyOf": [
|
|
814
814
|
{
|
|
815
|
-
"pattern": "
|
|
815
|
+
"pattern": "^(@[a-zA-Z_][a-zA-Z0-9_]*\\.[a-zA-Z_][a-zA-Z0-9_]*(\\[[^\\]]+\\])?(\\.[a-zA-Z_][a-zA-Z0-9_]*)*|lib:[a-zA-Z0-9_-]+@[a-zA-Z_][a-zA-Z0-9_]*\\.[a-zA-Z_][a-zA-Z0-9_]*(\\[[^\\]]+\\])?(\\.[a-zA-Z_][a-zA-Z0-9_]*)*)$"
|
|
816
816
|
},
|
|
817
817
|
{
|
|
818
818
|
"const": "\"@setting.\"",
|
|
@@ -8,8 +8,9 @@ var parseXMLBitmask = coreDefinitions_1.DDE_Core.parseXMLBitmask;
|
|
|
8
8
|
var parseXMLDefaultValue = coreDefinitions_1.DDE_Core.parseXMLDefaultValue;
|
|
9
9
|
var fieldTypeDefinitions = coreDefinitions_1.DDE_Core.fieldTypeDefinitions;
|
|
10
10
|
const helper_1 = require("../../helper");
|
|
11
|
+
const manifest_1 = require("../../manifest");
|
|
11
12
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
12
|
-
function generateXMLFromMap(ddeMap) {
|
|
13
|
+
function generateXMLFromMap(manifest, ddeMap) {
|
|
13
14
|
const indent = '';
|
|
14
15
|
const xml_ = [];
|
|
15
16
|
function xml(s, condition = true) {
|
|
@@ -67,8 +68,8 @@ function generateXMLFromMap(ddeMap) {
|
|
|
67
68
|
xmlAttr('download', '0');
|
|
68
69
|
}
|
|
69
70
|
// set edit=99 on upward containers to reject write access via API
|
|
70
|
-
if (
|
|
71
|
-
|
|
71
|
+
if ((manifest_1.Manifest.isApp(manifest) || manifest_1.Manifest.isLibrary(manifest)) &&
|
|
72
|
+
[TransferDirection.up, TransferDirection.upPlus].includes(containerDefinition.transferDirection)) {
|
|
72
73
|
xmlAttr('edit', '99');
|
|
73
74
|
}
|
|
74
75
|
//insert fields:
|
|
@@ -29,6 +29,7 @@ var YamlPreCompiler;
|
|
|
29
29
|
usedContainerNames = {};
|
|
30
30
|
fileDiagnostics = [];
|
|
31
31
|
libraryDDE = [];
|
|
32
|
+
libraryYaml = {};
|
|
32
33
|
constructor(manifest, libraryFiles, ddeHistory) {
|
|
33
34
|
this.manifest = manifest;
|
|
34
35
|
this.libraryFiles = libraryFiles;
|
|
@@ -41,9 +42,10 @@ var YamlPreCompiler;
|
|
|
41
42
|
this.libraryDDE.length = 0;
|
|
42
43
|
const libDiagnostics = [];
|
|
43
44
|
this.libraryFiles.forEach(file => {
|
|
44
|
-
const { parsedDDE, diagnostics } = this.parseYamlFile(file.path, file.yaml, file.libraryName);
|
|
45
|
+
const { parsedDDE, diagnostics, parsedYaml } = this.parseYamlFile(file.path, file.yaml, file.libraryName);
|
|
45
46
|
libDiagnostics.push(...diagnostics);
|
|
46
47
|
this.libraryDDE.push(parsedDDE);
|
|
48
|
+
this.libraryYaml[file.libraryName] = parsedYaml;
|
|
47
49
|
});
|
|
48
50
|
return libDiagnostics;
|
|
49
51
|
}
|
|
@@ -84,7 +86,8 @@ var YamlPreCompiler;
|
|
|
84
86
|
containers: {},
|
|
85
87
|
setPointList: {}
|
|
86
88
|
},
|
|
87
|
-
diagnostics: []
|
|
89
|
+
diagnostics: [],
|
|
90
|
+
parsedYaml: null
|
|
88
91
|
};
|
|
89
92
|
}
|
|
90
93
|
const docContent = yamlDoc.contents || new yaml_1.YAMLMap();
|
|
@@ -96,7 +99,8 @@ var YamlPreCompiler;
|
|
|
96
99
|
// mapAsMap is used to keep order of fields:
|
|
97
100
|
return {
|
|
98
101
|
parsedDDE: this.yamlDocToDdeJson(yamlDoc.toJS({ mapAsMap: true }), libraryName),
|
|
99
|
-
diagnostics: [...this.fileDiagnostics]
|
|
102
|
+
diagnostics: [...this.fileDiagnostics],
|
|
103
|
+
parsedYaml: yamlDoc
|
|
100
104
|
};
|
|
101
105
|
}
|
|
102
106
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
@@ -594,8 +598,10 @@ var YamlPreCompiler;
|
|
|
594
598
|
validateContainerRelation(itemType, itemValue, yamlDoc, sourceUri, lineCounter) {
|
|
595
599
|
//validate if the relation exist
|
|
596
600
|
const [root, fieldRef, arrayField] = itemValue.value.split('.', 3);
|
|
597
|
-
const containerName = root.
|
|
598
|
-
const
|
|
601
|
+
const [libraryRelation, containerName] = root.split('@');
|
|
602
|
+
const libraryName = libraryRelation ? libraryRelation.split(':')[1] : null;
|
|
603
|
+
const yamlContentToSearch = libraryName && this.libraryYaml[libraryName] ? this.libraryYaml[libraryName] : yamlDoc;
|
|
604
|
+
const containerExist = yamlContentToSearch.contents?.get(containerName);
|
|
599
605
|
const referencedField = fieldRef.split('[')[0];
|
|
600
606
|
let relatedField = null;
|
|
601
607
|
if (containerExist) {
|
|
@@ -631,6 +637,14 @@ var YamlPreCompiler;
|
|
|
631
637
|
});
|
|
632
638
|
}
|
|
633
639
|
}
|
|
640
|
+
else if (libraryName && !this.libraryYaml[libraryName]) {
|
|
641
|
+
this.fileDiagnostics.push({
|
|
642
|
+
file: sourceUri,
|
|
643
|
+
level: 'error',
|
|
644
|
+
message: `Related library "${libraryName}" does not exist.`,
|
|
645
|
+
...yamlRangeToLineInformation(lineCounter, itemValue.range)
|
|
646
|
+
});
|
|
647
|
+
}
|
|
634
648
|
else {
|
|
635
649
|
this.fileDiagnostics.push({
|
|
636
650
|
file: sourceUri,
|
package/out/dlo/CustomWasmFS.js
CHANGED
|
@@ -41,7 +41,7 @@ const MODE_FILE = S_IFREG | DEFAULT_FILE_MODE;
|
|
|
41
41
|
const preCompiler = new preCompiler_1.DloPreCompiler();
|
|
42
42
|
const modifiedFileCache = {};
|
|
43
43
|
exports.precompilerDiagnostics = [];
|
|
44
|
-
const CUSTOM_WASM_FS = (FS, cwd, manifest) => {
|
|
44
|
+
const CUSTOM_WASM_FS = (FS, cwd, manifest, logger) => {
|
|
45
45
|
// clear all cached artifacts during FS setup ( this is needed when loaded in vscode context )
|
|
46
46
|
exports.precompilerDiagnostics.length = 0;
|
|
47
47
|
Object.keys(modifiedFileCache).forEach(key => delete modifiedFileCache[key]);
|
|
@@ -52,7 +52,7 @@ const CUSTOM_WASM_FS = (FS, cwd, manifest) => {
|
|
|
52
52
|
if (!nodeFs.existsSync(fsPath)) {
|
|
53
53
|
throw new FS.ErrnoError(44 /* ENOENT */);
|
|
54
54
|
}
|
|
55
|
-
const modifiedFileContent = getUpdateModifiedFileCache(cwd, manifest, path);
|
|
55
|
+
const modifiedFileContent = getUpdateModifiedFileCache(cwd, logger, manifest, path);
|
|
56
56
|
const stat = nodeFs.statSync(fsPath);
|
|
57
57
|
const size = modifiedFileContent?.length || stat.size;
|
|
58
58
|
return {
|
|
@@ -131,7 +131,7 @@ const CUSTOM_WASM_FS = (FS, cwd, manifest) => {
|
|
|
131
131
|
const streamOps = {
|
|
132
132
|
open(stream) {
|
|
133
133
|
const path = vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.parse(stream.node.mount.opts.root), FS.getPath(stream.node));
|
|
134
|
-
stream.modifiedContent = getUpdateModifiedFileCache(cwd, manifest, path);
|
|
134
|
+
stream.modifiedContent = getUpdateModifiedFileCache(cwd, logger, manifest, path);
|
|
135
135
|
if (!stream.modifiedContent) {
|
|
136
136
|
stream.nfd = nodeFs.openSync(path.fsPath, flagsToMode(stream.flags));
|
|
137
137
|
}
|
|
@@ -232,18 +232,18 @@ function copyToBuffer(source, target, targetOffset, sourceStart, sourceEnd) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function getUpdateModifiedFileCache(cwd, manifest, filePath) {
|
|
235
|
+
function getUpdateModifiedFileCache(cwd, logger, manifest, filePath) {
|
|
236
236
|
const fsPath = filePath.fsPath;
|
|
237
237
|
if (!modifiedFileCache[fsPath] && (fsPath.endsWith('.dlo') || fsPath.endsWith('.inc'))) {
|
|
238
|
-
modifiedFileCache[fsPath] = precompileRequestedDloFile(cwd, manifest, filePath);
|
|
238
|
+
modifiedFileCache[fsPath] = precompileRequestedDloFile(cwd, logger, manifest, filePath);
|
|
239
239
|
}
|
|
240
240
|
return modifiedFileCache[fsPath];
|
|
241
241
|
}
|
|
242
|
-
function precompileRequestedDloFile(cwd, manifest, filePath) {
|
|
242
|
+
function precompileRequestedDloFile(cwd, logger, manifest, filePath) {
|
|
243
243
|
// Simple example: convert buffer content to a string, modify and convert back
|
|
244
244
|
const originalContent = nodeFs.readFileSync(filePath.fsPath);
|
|
245
245
|
const fileBlob = convertBlobToStringArray(originalContent);
|
|
246
|
-
const preCompiled = preCompiler.preCompileDloFile(cwd, manifest, filePath, fileBlob);
|
|
246
|
+
const preCompiled = preCompiler.preCompileDloFile(cwd, logger, manifest, filePath, fileBlob);
|
|
247
247
|
exports.precompilerDiagnostics.push(...preCompiled.diagnostics);
|
|
248
248
|
return iconv.encode(preCompiled.data, 'cp1252');
|
|
249
249
|
}
|
package/out/dlo/compiler.js
CHANGED
|
@@ -51,7 +51,7 @@ class DloCompiler {
|
|
|
51
51
|
const FS = this.dloCC.FS;
|
|
52
52
|
const manifest = await manifest_1.Manifest.read(this.cwd, this.fs);
|
|
53
53
|
// Register our new FS type under a name
|
|
54
|
-
FS.filesystems.NODEFS_TS = (0, CustomWasmFS_1.CUSTOM_WASM_FS)(FS, this.cwd, manifest);
|
|
54
|
+
FS.filesystems.NODEFS_TS = (0, CustomWasmFS_1.CUSTOM_WASM_FS)(FS, this.cwd, manifest, this.logger);
|
|
55
55
|
FS.mkdir(rootDir);
|
|
56
56
|
FS.mount(FS.filesystems.NODEFS_TS, { root: '/' }, rootDir);
|
|
57
57
|
// Set the current working directory to the root directory
|
package/out/dlo/preCompiler.js
CHANGED
|
@@ -87,23 +87,22 @@ class DloPreCompiler {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
90
|
-
preCompileDloFile(cwd, manifest, fileUri, fileBlob) {
|
|
90
|
+
preCompileDloFile(cwd, logger, manifest, fileUri, fileBlob) {
|
|
91
91
|
this.dloFileSequencer.workspacePath = cwd;
|
|
92
92
|
const fileDiagnostics = [];
|
|
93
93
|
const filePath = fileUri.path;
|
|
94
94
|
let mangleDDEFunctions = false;
|
|
95
95
|
const baseName = vscode_uri_1.Utils.basename(fileUri);
|
|
96
96
|
// look for autogenerated xxx-dde.inc files
|
|
97
|
-
if (filePath.includes(defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.path)
|
|
97
|
+
if (filePath.includes(defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.path)) {
|
|
98
98
|
const ddeIncSource = baseName.substring(0, baseName.length - 8);
|
|
99
|
-
if (!['app', 'main'].includes(ddeIncSource)) {
|
|
99
|
+
if (!['app', 'main'].includes(ddeIncSource) && baseName.endsWith('-dde.inc')) {
|
|
100
100
|
// this is a library specific file!
|
|
101
101
|
mangleDDEFunctions = helper_1.Helper.generateHashForLibraryName(ddeIncSource);
|
|
102
102
|
// console.log('MANGLED LIB DDE', baseName, ddeIncSource, mangleDDEFunctions);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
if (filePath.includes(defaultFiles_1.DefaultFiles.filePaths.studio.libdeps)) {
|
|
105
|
+
else if (filePath.includes(defaultFiles_1.DefaultFiles.filePaths.studio.libdeps)) {
|
|
107
106
|
const libPath = filePath.split('libdeps/')[1];
|
|
108
107
|
const [libName] = libPath.split('/');
|
|
109
108
|
if (!['dlo-core'].includes(libName)) {
|
|
@@ -111,9 +110,16 @@ class DloPreCompiler {
|
|
|
111
110
|
// console.log('MANGLED LIB', baseName, mangleDDEFunctions);
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
else if (manifest_1.Manifest.isLibrary(manifest)
|
|
115
|
-
|
|
116
|
-
//
|
|
113
|
+
else if (manifest_1.Manifest.isLibrary(manifest)) {
|
|
114
|
+
// mangle dde functions within the project files if the current project is a library project
|
|
115
|
+
// exclude main.dlo and /example and /test folder
|
|
116
|
+
if (baseName.endsWith('.dlo') || filePath.includes('/dlo/examples/') || filePath.includes('/dlo/test/')) {
|
|
117
|
+
logger.log('Skipping dde mangling for project file', baseName);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
mangleDDEFunctions = helper_1.Helper.generateHashForLibraryName(manifest.name);
|
|
121
|
+
// console.log('MANGLED PROJECT LIB', baseName, mangleDDEFunctions);
|
|
122
|
+
}
|
|
117
123
|
}
|
|
118
124
|
if (filePath.endsWith('.auto/default.inc')) {
|
|
119
125
|
return {
|
package/out/main.js
CHANGED
|
@@ -22,11 +22,14 @@ const devPath = () => {
|
|
|
22
22
|
return './dev/app';
|
|
23
23
|
}
|
|
24
24
|
else if (process.env.NODE_ENV === 'local-dev-lib') {
|
|
25
|
-
return './dev/
|
|
25
|
+
return './dev/modbus-master';
|
|
26
26
|
}
|
|
27
27
|
else if (process.env.NODE_ENV === 'local-dev-addon') {
|
|
28
28
|
return './dev/addon';
|
|
29
29
|
}
|
|
30
|
+
else if (process.env.NODE_ENV === 'local-dev-analytics') {
|
|
31
|
+
return './dev/analytics';
|
|
32
|
+
}
|
|
30
33
|
return '';
|
|
31
34
|
};
|
|
32
35
|
const cwd = vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.file(process.cwd()), devPath());
|
package/out/manifest.js
CHANGED
package/package.json
CHANGED
package/studio-cli-addon
DELETED