@microtronics/studio-cli 0.40.0 → 0.41.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,9 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 0.40.0 (2025-11-11)
3
+ ## 0.41.0 (2026-01-12)
4
4
 
5
5
  ### Features
6
6
 
7
+ * add validation for maxInstancesPerSite manifest property ([065dc98](https://bitbucket.org/microtronics-core/vscode-studio/commits/065dc9809e8dccb75b74c5b52a58ce4ec15b5860))
8
+ * use manifest maxInstancesPerSite for addon package header ([0350d2a](https://bitbucket.org/microtronics-core/vscode-studio/commits/0350d2af8ee3aae0ddbb00d7af5cd0b1c2c4cdd5))
9
+ * validate manifest before building package ([e70fc0e](https://bitbucket.org/microtronics-core/vscode-studio/commits/e70fc0ef9c89849ce2c19ec0a9bb575a764a3b07))
10
+
11
+ ## 0.40.0 (2025-11-11)
12
+
13
+ ### Features
14
+
7
15
  * add lowercase property mapping for timeseries containers ([24f575e](https://bitbucket.org/microtronics-core/vscode-studio/commits/24f575efa418417c5fd612e55bd17f5fb80972cf))
8
16
 
9
17
  ## 0.39.0 (2025-11-10)
@@ -2183,6 +2183,7 @@ export declare namespace Manifest {
2183
2183
  description: string;
2184
2184
  type: ProjectTypes;
2185
2185
  legacyProject?: boolean;
2186
+ maxInstancesPerSite?: number;
2186
2187
  icon?: string;
2187
2188
  dpid?: DeviceProfiles;
2188
2189
  engines?: {
package/out/api.js CHANGED
@@ -50,19 +50,14 @@ Object.defineProperty(exports, "Log", { enumerable: true, get: function () { ret
50
50
  * @return {Promise<void>} A promise that resolves when the installation process completes successfully or logs an error if it fails.
51
51
  */
52
52
  async function install(cwd, fs, env, apiToken, dependencies) {
53
- try {
54
- if (dependencies.length > 0) {
55
- for (const dependency of dependencies) {
56
- const [libraryId, version] = dependency.split('@');
57
- await dependencies_1.Dependencies.installDependency(cwd, fs, env, apiToken, libraryId, version || null);
58
- }
59
- }
60
- else {
61
- return await dependencies_1.Dependencies.installDependencies(cwd, fs, env, apiToken);
53
+ if (dependencies.length > 0) {
54
+ for (const dependency of dependencies) {
55
+ const [libraryId, version] = dependency.split('@');
56
+ await dependencies_1.Dependencies.installDependency(cwd, fs, env, apiToken, libraryId, version || null);
62
57
  }
63
58
  }
64
- catch (e) {
65
- console.error(e);
59
+ else {
60
+ return await dependencies_1.Dependencies.installDependencies(cwd, fs, env, apiToken);
66
61
  }
67
62
  }
68
63
  /**
@@ -78,6 +73,7 @@ async function install(cwd, fs, env, apiToken, dependencies) {
78
73
  * @return {Promise<Object>} A promise resolved with an object containing diagnostics information for the specified project parts: `dde`, `dlo`, and `dfiles`.
79
74
  */
80
75
  async function build(cwd, fs, logger, env, apiToken = null, selectedParts = true, errorWithDiagnostics) {
76
+ await manifest_1.Manifest.validateBasicManifest(cwd, fs, null);
81
77
  return package_1.Package.buildAll(cwd, fs, logger, env, apiToken, selectedParts, errorWithDiagnostics);
82
78
  }
83
79
  /**
package/out/manifest.js CHANGED
@@ -183,6 +183,7 @@ var Manifest;
183
183
  validateProjectVersion(manifest);
184
184
  validatePOVSettings(manifest);
185
185
  validateBLOSettings(manifest);
186
+ validateMaxInstancesPerSite(manifest);
186
187
  }
187
188
  Manifest.validateBasicManifest = validateBasicManifest;
188
189
  function validateLibraryName(libraryName) {
@@ -433,6 +434,27 @@ function validateAddonOrAnalyticsSupported(manifest) {
433
434
  throw new Error(`For project type "${manifest.type}", "dpid" is not supported!"`);
434
435
  }
435
436
  }
437
+ function validateMaxInstancesPerSite(manifest) {
438
+ const { maxInstancesPerSite } = manifest;
439
+ // If maxInstancesPerSite is not defined, check if it's required
440
+ if (maxInstancesPerSite === undefined) {
441
+ if (Manifest.isAddon(manifest)) {
442
+ throw new Error('Property "maxInstancesPerSite" is required for addon projects!');
443
+ }
444
+ return;
445
+ }
446
+ // If maxInstancesPerSite is defined, validate it's only allowed for addon projects
447
+ if (!Manifest.isAddon(manifest)) {
448
+ throw new Error(`Property "maxInstancesPerSite" is only allowed for addon projects!`);
449
+ }
450
+ // Validate the value
451
+ if (!Number.isInteger(maxInstancesPerSite)) {
452
+ throw new Error('Property "maxInstancesPerSite" must be an integer!');
453
+ }
454
+ if (maxInstancesPerSite < 1 || maxInstancesPerSite > 100) {
455
+ throw new Error('Property "maxInstancesPerSite" must be between 1 and 100!');
456
+ }
457
+ }
436
458
  /**
437
459
  * Check based on the current env if the given version string is correct
438
460
  * @param manifest
@@ -54,7 +54,7 @@ var APM;
54
54
  tagHeader.required_hwfw = undefined;
55
55
  tagHeader.required_productcode = undefined;
56
56
  tagHeader.addon_max_sources = 1;
57
- tagHeader.addon_max_per_site = 1;
57
+ tagHeader.addon_max_per_site = manifest.maxInstancesPerSite;
58
58
  }
59
59
  return tagHeader;
60
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microtronics/studio-cli",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Microtronics Studio CLI Tool",
5
5
  "main": "./out/api.js",
6
6
  "typings": "./dist/studio-cli.d.ts",