@microtronics/studio-cli 0.15.1 → 0.17.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 CHANGED
@@ -1,5 +1,33 @@
1
1
 
2
2
 
3
+ ## 0.17.0 (2025-02-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * **studio-cli:** added function to validate if a given apm part is enabled or not ([1dce992](https://bitbucket.org/microtronics-core/vscode-studio/commits/1dce99291f0629aed450af5413b128b0b80f29eb))
9
+ * **studio-cli:** allow set the `MYDATANET_CUSTOMER` env ([a34297a](https://bitbucket.org/microtronics-core/vscode-studio/commits/a34297ae1e670ef665b5991d065f74e6401466e3))
10
+ * **studio-cli:** make `ENV` namespace available ([09a8b80](https://bitbucket.org/microtronics-core/vscode-studio/commits/09a8b80a1b0f99eada300e273bb84029d28132bb))
11
+ * **studio-cli:** only add dlo binarys if the dlo part is enabled ([6d106ab](https://bitbucket.org/microtronics-core/vscode-studio/commits/6d106ab411c44057ca71e04d301d1c984a6b253b))
12
+ * **studio-cli:** only start compiler if the apm part is enabled ([dfbc701](https://bitbucket.org/microtronics-core/vscode-studio/commits/dfbc70173abf81eb5635a6d360d89a2f8734868a))
13
+ * **studio-cli:** support to read `.env.local` to support local build settings ([3376dbf](https://bitbucket.org/microtronics-core/vscode-studio/commits/3376dbf16f757f06829556eb2fc1d92d628253c1))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **studio-cli:** only return boolean for `isApmPartEnabled` function ([c80468a](https://bitbucket.org/microtronics-core/vscode-studio/commits/c80468ae245b49fb1f5209fbf5a948df9f5bc7d2))
19
+ * **studio-cli:** validate if `.env.local` file exist ([eeea393](https://bitbucket.org/microtronics-core/vscode-studio/commits/eeea3932bc28a259975c4755a4f5a6a107ab34b7))
20
+
21
+ ## 0.16.0 (2025-02-07)
22
+
23
+
24
+ ### Features
25
+
26
+ * **studio-cli:** add the `history.json` to the store tag ([70086be](https://bitbucket.org/microtronics-core/vscode-studio/commits/70086be5ef2100ba6bf0e699d242bf9d02d7e347))
27
+ * **studio-cli:** add the `studio.json` to the store tag ([6e23a79](https://bitbucket.org/microtronics-core/vscode-studio/commits/6e23a793f8d7c7ebc8a5044d86002d965ac484eb))
28
+ * **studio-cli:** introduced new manifest property `type` ([edbd5cb](https://bitbucket.org/microtronics-core/vscode-studio/commits/edbd5cbb11198f6659be42560642676258c6ca66))
29
+ * **studio-cli:** prevent generating `history.json` for library projects ([00e45c0](https://bitbucket.org/microtronics-core/vscode-studio/commits/00e45c02b07147a157b0c3fedb3217988c0ea225))
30
+
3
31
  ## 0.15.1 (2025-01-31)
4
32
 
5
33
 
@@ -1782,6 +1782,23 @@ declare class DloPreCompiler {
1782
1782
  }>;
1783
1783
  }
1784
1784
 
1785
+ export declare namespace ENV {
1786
+ /**
1787
+ *
1788
+ */
1789
+ export interface ENV {
1790
+ MYDATANET_HOST?: string;
1791
+ MYDATANET_API_TOKEN?: string;
1792
+ MYDATANET_CUSTOMER?: string;
1793
+ }
1794
+ /**
1795
+ * Read/parse the supported .env file
1796
+ * @param cwd
1797
+ * @param fs
1798
+ */
1799
+ export function read(cwd: URI, fs: LocalFS): Promise<ENV.ENV>;
1800
+ }
1801
+
1785
1802
  /**
1786
1803
  * Permissions of a file.
1787
1804
  */
@@ -2021,12 +2038,24 @@ declare interface LocalFS {
2021
2038
  }
2022
2039
 
2023
2040
  export declare namespace Manifest {
2041
+ /**
2042
+ * The source filename where the information is stored in
2043
+ */
2044
+ const fileName = "studio.json";
2024
2045
  export type DeviceProfiles = 'm22x' | 'm23x' | 'nrf91' | 'm2blegw' | 'm2easyv3' | 'm2easyiot';
2046
+ /**
2047
+ * Type of the iot app project
2048
+ */
2049
+ export enum ProjectTypes {
2050
+ app = "app",
2051
+ library = "library"
2052
+ }
2025
2053
  export interface Manifest {
2026
2054
  version: string;
2027
2055
  name: string;
2028
2056
  publisher: string;
2029
2057
  description: string;
2058
+ type: ProjectTypes;
2030
2059
  legacyProject?: boolean;
2031
2060
  icon?: string;
2032
2061
  dpid: DeviceProfiles;
@@ -2035,6 +2064,9 @@ export declare namespace Manifest {
2035
2064
  hwfw?: string[];
2036
2065
  productId?: string[];
2037
2066
  };
2067
+ /**
2068
+ * @deprecated
2069
+ */
2038
2070
  library?: boolean;
2039
2071
  libraryDependencies?: Dependencies;
2040
2072
  libraryDevDependencies?: Dependencies;
@@ -2098,7 +2130,7 @@ export declare namespace Manifest {
2098
2130
  /**
2099
2131
  * Check if the current project is a library project
2100
2132
  */
2101
- export function isLibraryProject(manifest: Manifest.Manifest): boolean;
2133
+ export function isLibrary(manifest: Manifest.Manifest): boolean;
2102
2134
  /**
2103
2135
  * Validates if the properties within
2104
2136
  * @param cwd
@@ -2115,6 +2147,14 @@ export declare namespace Manifest {
2115
2147
  export function validateRegistryAllowedBackends(allowedBackends: undefined | null | string | string[]): Promise<string | null>;
2116
2148
  export function validateApplicationIcon(cwd: URI, fs: LocalFS, manifest: Manifest.Manifest): Promise<void>;
2117
2149
  export function validateEngineSettings(manifest: Manifest.Manifest): void;
2150
+ /**
2151
+ * Validate if the given apm part is used
2152
+ * @param cwd
2153
+ * @param fs
2154
+ * @param apmPart
2155
+ * @param manifest
2156
+ */
2157
+ export function isApmPartEnabled(cwd: URI, fs: LocalFS, apmPart: APM.Part, manifest?: Manifest.Manifest): Promise<boolean>;
2118
2158
  }
2119
2159
 
2120
2160
  export declare namespace Package {
package/out/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DFILES = exports.Library = 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;
3
+ exports.ENV = exports.DFILES = exports.Library = 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");
@@ -31,4 +31,6 @@ const library_1 = require("./package/library");
31
31
  Object.defineProperty(exports, "Library", { enumerable: true, get: function () { return library_1.Library; } });
32
32
  const dfiles_1 = require("./dfiles/dfiles");
33
33
  Object.defineProperty(exports, "DFILES", { enumerable: true, get: function () { return dfiles_1.DFILES; } });
34
+ const dotenv_1 = require("./dotenv");
35
+ Object.defineProperty(exports, "ENV", { enumerable: true, get: function () { return dotenv_1.ENV; } });
34
36
  //# sourceMappingURL=api.js.map
package/out/dde/dde.js CHANGED
@@ -275,7 +275,7 @@ var DDE;
275
275
  */
276
276
  async function exportOpenApi(cwd, fs, ddeMap) {
277
277
  const manifest = await manifest_1.Manifest.read(cwd, fs);
278
- const isLibrary = manifest.library;
278
+ const isLibrary = manifest_1.Manifest.isLibrary(manifest);
279
279
  // remove previous api description:
280
280
  const previousOpenAPIFileName = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.path, 'dde-api.yaml');
281
281
  await fs.rm(previousOpenAPIFileName).catch(() => { });
@@ -330,7 +330,7 @@ async function getDependencies(cwd, fs, manifest) {
330
330
  }
331
331
  }
332
332
  // push library projects dde file also into the list
333
- if (manifest_1.Manifest.isLibraryProject(manifest)) {
333
+ if (manifest_1.Manifest.isLibrary(manifest)) {
334
334
  const projectLibPath = vscode_uri_1.Utils.joinPath(cwd, `/${exports.DDE_PATH}/${manifest.name}.dde`);
335
335
  if (await fs.stat(projectLibPath)) {
336
336
  ddeFiles.push({
@@ -62,7 +62,7 @@ function getPawnTypeDefinition(field) {
62
62
  }
63
63
  const MICROTRONICS_DLO_CORE = 'Microtronics/dlo-core';
64
64
  function getRequiredDloCoreVersion(manifest) {
65
- if (manifest_1.Manifest.isLibraryProject(manifest) && manifest.name === 'dlo-core') {
65
+ if (manifest_1.Manifest.isLibrary(manifest) && manifest.name === 'dlo-core') {
66
66
  return manifest.version;
67
67
  }
68
68
  else if (manifest.libraryDependencies && Object.hasOwn(manifest.libraryDependencies, MICROTRONICS_DLO_CORE)) {
@@ -35,7 +35,6 @@ const pako = require('pako');
35
35
  exports.LIB_DEPS_PATH = '.studio/libdeps';
36
36
  var Dependencies;
37
37
  (function (Dependencies) {
38
- var isLibraryProject = manifest_1.Manifest.isLibraryProject;
39
38
  /**
40
39
  * Just combine all dependencies in one object
41
40
  * Optional devDependencies can be excluded
@@ -323,7 +322,7 @@ var Dependencies;
323
322
  }
324
323
  }
325
324
  // add current project file if it is a library project
326
- if (isLibraryProject(manifest)) {
325
+ if (manifest_1.Manifest.isLibrary(manifest)) {
327
326
  const incPath = vscode_uri_1.Utils.joinPath(cwd, defaultApmPath, `${manifest.name}.${includeExtension}`);
328
327
  if (await fs.stat(incPath)) {
329
328
  apmDependencies.push({
@@ -65,6 +65,15 @@ class DloCompiler {
65
65
  }
66
66
  async compile(cwd, fs) {
67
67
  const manifest = await manifest_1.Manifest.read(cwd, fs);
68
+ if (!(await manifest_1.Manifest.isApmPartEnabled(cwd, fs, apm_1.APM.Part.dlo, manifest))) {
69
+ console.log('DLO not enabled. Skipped.');
70
+ return {
71
+ code: 0,
72
+ stdout: [],
73
+ stderr: [],
74
+ diagnostics: []
75
+ };
76
+ }
68
77
  await this.initDloCC();
69
78
  const precompilerDiagnostics = await this.persistDloFiles(cwd, fs, manifest);
70
79
  const mainFile = vscode_uri_1.Utils.joinPath(cwd, manifest.dlo?.mainFile || defaultFiles_1.DefaultFiles.filePaths.dlo.mainDLO);
@@ -111,7 +111,7 @@ class DloPreCompiler {
111
111
  // console.log('MANGLED LIB', baseName, mangleDDEFunctions);
112
112
  }
113
113
  }
114
- else if (manifest_1.Manifest.isLibraryProject(manifest) && baseName === `${manifest.name}.inc`) {
114
+ else if (manifest_1.Manifest.isLibrary(manifest) && baseName === `${manifest.name}.inc`) {
115
115
  mangleDDEFunctions = helper_1.Helper.generateHashForLibraryName(manifest.name);
116
116
  // console.log('MANGLED PROJECT LIB', baseName, mangleDDEFunctions);
117
117
  }
package/out/dotenv.js ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ENV = void 0;
7
+ const dotenv_1 = __importDefault(require("dotenv"));
8
+ const vscode_uri_1 = require("vscode-uri");
9
+ const helper_1 = require("./helper");
10
+ const envLocalFile = '.env.local';
11
+ var ENV;
12
+ (function (ENV) {
13
+ /**
14
+ * Read/parse the supported .env file
15
+ * @param cwd
16
+ * @param fs
17
+ */
18
+ async function read(cwd, fs) {
19
+ const envPath = vscode_uri_1.Utils.joinPath(cwd, envLocalFile);
20
+ if (await fs.stat(envPath)) {
21
+ const envData = await fs.readFile(envPath);
22
+ return dotenv_1.default.parse(helper_1.Helper.convertBlobToString(envData));
23
+ }
24
+ return {};
25
+ }
26
+ ENV.read = read;
27
+ })(ENV || (exports.ENV = ENV = {}));
28
+ //# sourceMappingURL=dotenv.js.map
package/out/globals.js CHANGED
@@ -63,7 +63,7 @@ var Globals;
63
63
  }
64
64
  }
65
65
  // load the library projects specific ini file
66
- if (manifest_1.Manifest.isLibraryProject(manifest)) {
66
+ if (manifest_1.Manifest.isLibrary(manifest)) {
67
67
  const libIni = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dlo.path, `${manifest.name}.ini`);
68
68
  if (await fs.stat(libIni)) {
69
69
  const iniContent = await readIniFile(fs, libIni);
package/out/manifest.js CHANGED
@@ -13,7 +13,7 @@ const globals_1 = require("./globals");
13
13
  const preload_1 = __importDefault(require("semver/preload"));
14
14
  const DeviceProfiles_1 = require("./DeviceProfiles");
15
15
  var isNumeric = helper_1.Helper.isNumeric;
16
- const STUDIO_JSON_NAME = 'studio.json';
16
+ const apm_1 = require("./package/apm");
17
17
  // Cache to reduce the disk read requests
18
18
  const manifestCache = {
19
19
  _manifest: null,
@@ -39,6 +39,18 @@ const manifestCache = {
39
39
  var Manifest;
40
40
  (function (Manifest) {
41
41
  var convertBlobToString = helper_1.Helper.convertBlobToString;
42
+ /**
43
+ * The source filename where the information is stored in
44
+ */
45
+ Manifest.fileName = 'studio.json';
46
+ /**
47
+ * Type of the iot app project
48
+ */
49
+ let ProjectTypes;
50
+ (function (ProjectTypes) {
51
+ ProjectTypes["app"] = "app";
52
+ ProjectTypes["library"] = "library";
53
+ })(ProjectTypes = Manifest.ProjectTypes || (Manifest.ProjectTypes = {}));
42
54
  let BloAccessLevel;
43
55
  (function (BloAccessLevel) {
44
56
  BloAccessLevel["restricted"] = "restricted";
@@ -55,7 +67,7 @@ var Manifest;
55
67
  * @param fs
56
68
  */
57
69
  async function read(cwd, fs) {
58
- const manifestUri = vscode_uri_1.Utils.joinPath(cwd, STUDIO_JSON_NAME);
70
+ const manifestUri = vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName);
59
71
  const manifestStat = await fs.stat(manifestUri);
60
72
  // if the manifest was modified, reload the cache
61
73
  if (manifestCache.manifest === null ||
@@ -77,7 +89,7 @@ var Manifest;
77
89
  * @param fs
78
90
  */
79
91
  async function readAsBlob(cwd, fs) {
80
- return await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, STUDIO_JSON_NAME));
92
+ return await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName));
81
93
  }
82
94
  Manifest.readAsBlob = readAsBlob;
83
95
  /**
@@ -91,16 +103,21 @@ var Manifest;
91
103
  // patch the options if they are not valid for a specific device profile
92
104
  patchDloCompileOptionsBasedOnDpid(manifest);
93
105
  removeDeprecatedOptions(manifest);
94
- return fs.writeFile(vscode_uri_1.Utils.joinPath(cwd, STUDIO_JSON_NAME), JSON.stringify(manifest, null, '\t'));
106
+ return fs.writeFile(vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName), JSON.stringify(manifest, null, '\t'));
95
107
  }
96
108
  Manifest.write = write;
97
109
  /**
98
110
  * Check if the current project is a library project
99
111
  */
100
- function isLibraryProject(manifest) {
101
- return !!manifest.library;
112
+ function isLibrary(manifest) {
113
+ if (manifest.library !== undefined) {
114
+ return manifest.library;
115
+ }
116
+ else {
117
+ return manifest.type === ProjectTypes.library;
118
+ }
102
119
  }
103
- Manifest.isLibraryProject = isLibraryProject;
120
+ Manifest.isLibrary = isLibrary;
104
121
  /**
105
122
  * Validates if the properties within
106
123
  * @param cwd
@@ -247,6 +264,33 @@ var Manifest;
247
264
  validateHwFwOrProductId(manifest);
248
265
  }
249
266
  Manifest.validateEngineSettings = validateEngineSettings;
267
+ /**
268
+ * Validate if the given apm part is used
269
+ * @param cwd
270
+ * @param fs
271
+ * @param apmPart
272
+ * @param manifest
273
+ */
274
+ async function isApmPartEnabled(cwd, fs, apmPart, manifest) {
275
+ if (!manifest) {
276
+ manifest = await Manifest.read(cwd, fs);
277
+ }
278
+ switch (apmPart) {
279
+ case apm_1.APM.Part.dlo:
280
+ return !!manifest?.dlo?.mainFile;
281
+ case apm_1.APM.Part.blo:
282
+ return !!(manifest.blo?.buildCommand && manifest.blo?.workingPath);
283
+ case apm_1.APM.Part.pov:
284
+ return !!(manifest.pov?.details?.buildCommand && manifest.pov.details.workingPath);
285
+ // dde and dfiles are always enabled
286
+ case apm_1.APM.Part.dde:
287
+ case apm_1.APM.Part.dfiles:
288
+ return true;
289
+ default:
290
+ return false;
291
+ }
292
+ }
293
+ Manifest.isApmPartEnabled = isApmPartEnabled;
250
294
  })(Manifest || (exports.Manifest = Manifest = {}));
251
295
  function validatePOVSettings(manifest) {
252
296
  const { pov } = manifest;
@@ -295,7 +339,7 @@ function validateHwFwOrProductId(manifest) {
295
339
  * @param env
296
340
  */
297
341
  function validateProjectVersion(manifest, env) {
298
- if (env === globals_1.Globals.ENV.lucky || Manifest.isLibraryProject(manifest)) {
342
+ if (env === globals_1.Globals.ENV.lucky || Manifest.isLibrary(manifest)) {
299
343
  if (!preload_1.default.valid(manifest.version)) {
300
344
  throw new Error('"version" has to be a semantic version string!"');
301
345
  }
@@ -96,10 +96,9 @@ var APM;
96
96
  async function createBuffer(cwd, fs, manifest, tagHeader) {
97
97
  const apmBuffer = new FormData();
98
98
  apmBuffer.append('tag', JSON.stringify(tagHeader));
99
+ apmBuffer.append(`src/${manifest_1.Manifest.fileName}`, new Blob([await manifest_1.Manifest.readAsBlob(cwd, fs)]));
99
100
  const xmlBlob = new Blob([await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.ddeXmlPath))]);
100
101
  apmBuffer.append('bin/dde/xml', xmlBlob);
101
- const amxBlob = new Blob([await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.mainAmxPath))]);
102
- apmBuffer.append('bin/dlo/amx', amxBlob);
103
102
  if (manifest.icon) {
104
103
  const appIcon = await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, manifest.icon));
105
104
  const base64 = bufferToBase64(appIcon);
@@ -112,8 +111,12 @@ var APM;
112
111
  apmBuffer.append(`previews/README.md`, new Blob([readme]));
113
112
  apmBuffer.append(`previews/CHANGELOG.md`, new Blob([changelog]));
114
113
  }
114
+ if (await manifest_1.Manifest.isApmPartEnabled(cwd, fs, APM.Part.dlo)) {
115
+ const amxBlob = new Blob([await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.mainAmxPath))]);
116
+ apmBuffer.append('bin/dlo/amx', amxBlob);
117
+ }
115
118
  // handle pov binaries
116
- if (manifest.pov?.details) {
119
+ if (await manifest_1.Manifest.isApmPartEnabled(cwd, fs, APM.Part.pov, manifest)) {
117
120
  // get files in details dir
118
121
  await insertRelativePathFilesToBuffer(cwd, fs, apmBuffer, defaultFiles_1.DefaultFiles.filePaths.dist.povDetailsPath, 'bin/pov/details');
119
122
  //site list not supported yet -> add an empty index.html
@@ -127,7 +130,7 @@ var APM;
127
130
  apmBuffer.append(`bin/dfiles/${vscode_uri_1.Utils.basename(fileName)}`, dfileBlob);
128
131
  }
129
132
  // handle blo files
130
- if (manifest.blo) {
133
+ if (await manifest_1.Manifest.isApmPartEnabled(cwd, fs, APM.Part.pov, manifest)) {
131
134
  // get files in blo dir
132
135
  await insertRelativePathFilesToBuffer(cwd, fs, apmBuffer, defaultFiles_1.DefaultFiles.filePaths.dist.bloPath, 'bin/blo');
133
136
  }
@@ -257,5 +260,7 @@ async function addAdditionalFiles(cwd, fs, apmBuffer) {
257
260
  const reportTemplateBlob = new Blob([await fs.readFile(reportTemplate)]);
258
261
  apmBuffer.append(`bin/pov/mdn_report_template.json`, reportTemplateBlob);
259
262
  }
263
+ const historyPath = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.historyJson);
264
+ apmBuffer.append(`src/dde/${manifest_1.Manifest.fileName}`, new Blob([await fs.readFile(historyPath)]));
260
265
  }
261
266
  //# sourceMappingURL=apm.js.map
@@ -51,7 +51,7 @@ var Package;
51
51
  */
52
52
  async function release(cwd, fs, token, releasePhase, env = globals_1.Globals.ENV.production) {
53
53
  const manifest = await manifest_1.Manifest.read(cwd, fs);
54
- if (manifest_1.Manifest.isLibraryProject(manifest)) {
54
+ if (manifest_1.Manifest.isLibrary(manifest)) {
55
55
  await releaseLibrary(cwd, fs, token, env);
56
56
  }
57
57
  else {
@@ -155,7 +155,7 @@ var Package;
155
155
  async function validatePublishSettings(cwd, fs, token) {
156
156
  const manifest = await manifest_1.Manifest.read(cwd, fs);
157
157
  const { name, publisher, description } = manifest;
158
- const invalidName = manifest_1.Manifest.validateProjectName(name, manifest_1.Manifest.isLibraryProject(manifest));
158
+ const invalidName = manifest_1.Manifest.validateProjectName(name, manifest_1.Manifest.isLibrary(manifest));
159
159
  if (invalidName) {
160
160
  throw new Error(`name: ${invalidName}`);
161
161
  }
@@ -168,7 +168,7 @@ var Package;
168
168
  throw new Error(`publisher: ${invalidPublisher}`);
169
169
  }
170
170
  // only validate if the project is not a library project
171
- if (!manifest_1.Manifest.isLibraryProject(manifest)) {
171
+ if (!manifest_1.Manifest.isLibrary(manifest)) {
172
172
  await manifest_1.Manifest.validateApplicationIcon(cwd, fs, manifest);
173
173
  manifest_1.Manifest.validateEngineSettings(manifest);
174
174
  }
@@ -198,7 +198,11 @@ async function buildDDE(cwd, fs) {
198
198
  throwIfDiagnosticsHaveError(apm_1.APM.Part.dde, result.diagnostics);
199
199
  if (result.ddeJSON) {
200
200
  await dde_1.DDE.exportMyDatanetXML(cwd, fs, result.ddeJSON);
201
- await dde_1.DDE.exportHistoryJson(cwd, fs, result.ddeJSON);
201
+ const manifest = await manifest_1.Manifest.read(cwd, fs);
202
+ // a library does not need a history.json
203
+ if (!manifest_1.Manifest.isLibrary(manifest)) {
204
+ await dde_1.DDE.exportHistoryJson(cwd, fs, result.ddeJSON);
205
+ }
202
206
  await dde_1.DDE.exportOpenApi(cwd, fs, result.ddeJSON);
203
207
  await dde_1.DDE.exportAutoDloFiles(cwd, fs, result.ddeJSON);
204
208
  await dlo_1.DLO.exportDloConfig(cwd, fs);
@@ -37,7 +37,7 @@ var Shell;
37
37
  */
38
38
  async function tryBuildPov(cwd, fs) {
39
39
  const manifest = await manifest_1.Manifest.read(cwd, fs);
40
- if (manifest.pov?.details?.buildCommand && manifest.pov.details.workingPath) {
40
+ if (await manifest_1.Manifest.isApmPartEnabled(cwd, fs, apm_1.APM.Part.pov)) {
41
41
  console.log('Executing POV build script', manifest.pov?.details.buildCommand);
42
42
  const { buildCommand, workingPath } = manifest.pov.details;
43
43
  const povDir = vscode_uri_1.Utils.joinPath(cwd, workingPath);
@@ -62,7 +62,7 @@ var Shell;
62
62
  */
63
63
  async function tryBuildBlo(cwd, fs) {
64
64
  const manifest = await manifest_1.Manifest.read(cwd, fs);
65
- if (manifest.blo?.buildCommand && manifest.blo?.workingPath) {
65
+ if (await manifest_1.Manifest.isApmPartEnabled(cwd, fs, apm_1.APM.Part.blo, manifest)) {
66
66
  console.log('Executing BLO build script', manifest.blo?.buildCommand);
67
67
  const { buildCommand, workingPath } = manifest.blo;
68
68
  const bloDir = vscode_uri_1.Utils.joinPath(cwd, workingPath);
package/package.json CHANGED
@@ -1,76 +1,77 @@
1
- {
2
- "name": "@microtronics/studio-cli",
3
- "version": "0.15.1",
4
- "description": "Microtronics Studio CLI Tool",
5
- "main": "./out/api.js",
6
- "typings": "./dist/studio-cli.d.ts",
7
- "bin": {
8
- "studio-cli": "studio-cli"
9
- },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "scripts": {
14
- "release": "release-it --ci",
15
- "compile": "npm run build:registryApiTypings && tsc",
16
- "api": "api-extractor run --local --verbose",
17
- "build": "npm run compile && npm run api",
18
- "watch:build": "npm run compile -- --watch",
19
- "test": "cross-env STUDIO_ENV=lucky mocha",
20
- "test-ci": "cross-env STUDIO_ENV=lucky mocha --reporter mocha-junit-reporter",
21
- "watch:test": "npm run test -- --watch",
22
- "prepublishOnly": "npm run build",
23
- "build:registryApiTypings": "npx openapi-typescript https://api.registry.stage.microtronics.com/v1/openapi.yaml -o ./src/typings/registry.ts"
24
- },
25
- "author": "Microtronics",
26
- "license": "ISC",
27
- "dependencies": {
28
- "ajv": "^8.17.1",
29
- "ajv-formats": "^3.0.1",
30
- "ajv-keywords": "^5.1.0",
31
- "commander": "^12.1.0",
32
- "cross-fetch": "^4.0.0",
33
- "glob": "^11.0.1",
34
- "iconv-lite": "^0.6.3",
35
- "minimatch": "^10.0.1",
36
- "ini": "^5.0.0",
37
- "openapi-fetch": "^0.13.0",
38
- "pako": "^2.1.0",
39
- "semver": "^7.6.3",
40
- "tarballjs": "github:ankitrohatgi/tarballjs",
41
- "tinytar-fix": "^0.1.1",
42
- "vscode-uri": "^3.0.8",
43
- "yaml": "^2.6.1",
44
- "image-dimensions": "^2.3.0",
45
- "file-type-checker": "^1.1.2"
46
- },
47
- "engines": {
48
- "node": ">= 22"
49
- },
50
- "devDependencies": {
51
- "@microsoft/api-extractor": "^7.47.11",
52
- "@types/chai": "^4.3.6",
53
- "@types/chai-as-promised": "^7.1.5",
54
- "@types/ini": "^4.1.1",
55
- "@types/mocha": "^10.0.9",
56
- "@types/node": "^22.9.1",
57
- "@types/semver": "^7.5.6",
58
- "@types/vscode": "^1.86.2",
59
- "chai": "^4.3.8",
60
- "chai-as-promised": "^7.1.2",
61
- "cross-env": "^7.0.3",
62
- "mocha": "^10.8.2",
63
- "mocha-junit-reporter": "^2.2.1",
64
- "openapi-typescript": "^7.6.0",
65
- "ts-node": "^10.9.2",
66
- "typescript": "^5.6.3"
67
- },
68
- "mocha": {
69
- "require": [
70
- "ts-node/register"
71
- ],
72
- "watch-files": "src/**",
73
- "spec": "./test/**/*.spec.ts",
74
- "recursive": true
75
- }
76
- }
1
+ {
2
+ "name": "@microtronics/studio-cli",
3
+ "version": "0.17.0",
4
+ "description": "Microtronics Studio CLI Tool",
5
+ "main": "./out/api.js",
6
+ "typings": "./dist/studio-cli.d.ts",
7
+ "bin": {
8
+ "studio-cli": "studio-cli"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "release": "release-it --ci",
15
+ "compile": "npm run build:registryApiTypings && tsc",
16
+ "api": "api-extractor run --local --verbose",
17
+ "build": "npm run compile && npm run api",
18
+ "watch:build": "npm run compile -- --watch",
19
+ "test": "cross-env STUDIO_ENV=lucky mocha",
20
+ "test-ci": "cross-env STUDIO_ENV=lucky mocha --reporter mocha-junit-reporter",
21
+ "watch:test": "npm run test -- --watch",
22
+ "prepublishOnly": "npm run build",
23
+ "build:registryApiTypings": "npx openapi-typescript https://api.registry.stage.microtronics.com/v1/openapi.yaml -o ./src/typings/registry.ts"
24
+ },
25
+ "author": "Microtronics",
26
+ "license": "ISC",
27
+ "dependencies": {
28
+ "ajv": "^8.17.1",
29
+ "ajv-formats": "^3.0.1",
30
+ "ajv-keywords": "^5.1.0",
31
+ "commander": "^12.1.0",
32
+ "cross-fetch": "^4.0.0",
33
+ "dotenv": "^16.4.7",
34
+ "file-type-checker": "^1.1.2",
35
+ "glob": "^11.0.1",
36
+ "iconv-lite": "^0.6.3",
37
+ "image-dimensions": "^2.3.0",
38
+ "ini": "^5.0.0",
39
+ "minimatch": "^10.0.1",
40
+ "openapi-fetch": "^0.13.0",
41
+ "pako": "^2.1.0",
42
+ "semver": "^7.6.3",
43
+ "tarballjs": "github:ankitrohatgi/tarballjs",
44
+ "tinytar-fix": "^0.1.1",
45
+ "vscode-uri": "^3.0.8",
46
+ "yaml": "^2.6.1"
47
+ },
48
+ "engines": {
49
+ "node": ">= 22"
50
+ },
51
+ "devDependencies": {
52
+ "@microsoft/api-extractor": "^7.47.11",
53
+ "@types/chai": "^4.3.6",
54
+ "@types/chai-as-promised": "^7.1.5",
55
+ "@types/ini": "^4.1.1",
56
+ "@types/mocha": "^10.0.9",
57
+ "@types/node": "^22.9.1",
58
+ "@types/semver": "^7.5.6",
59
+ "@types/vscode": "^1.86.2",
60
+ "chai": "^4.3.8",
61
+ "chai-as-promised": "^7.1.2",
62
+ "cross-env": "^7.0.3",
63
+ "mocha": "^10.8.2",
64
+ "mocha-junit-reporter": "^2.2.1",
65
+ "openapi-typescript": "^7.6.0",
66
+ "ts-node": "^10.9.2",
67
+ "typescript": "^5.6.3"
68
+ },
69
+ "mocha": {
70
+ "require": [
71
+ "ts-node/register"
72
+ ],
73
+ "watch-files": "src/**",
74
+ "spec": "./test/**/*.spec.ts",
75
+ "recursive": true
76
+ }
77
+ }