@microtronics/studio-cli 0.19.2 → 0.21.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,20 @@
1
1
 
2
2
 
3
+ ## 0.21.0 (2025-02-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * **studio-cli:** added publish option `--allowedBackends` ([7cf0873](https://bitbucket.org/microtronics-core/vscode-studio/commits/7cf08737bbc994fd16a3a76604a6550f3284df60))
9
+
10
+ ## 0.20.0 (2025-02-25)
11
+
12
+
13
+ ### Features
14
+
15
+ * **studio-cli:** add wynni env to cli ([6864b8b](https://bitbucket.org/microtronics-core/vscode-studio/commits/6864b8ba5877efe577af799253e6c26ab71053d9))
16
+ * **studio-cli:** manifest support for `pov.details.lowLevel:boolean` ([9ae0dab](https://bitbucket.org/microtronics-core/vscode-studio/commits/9ae0dabe1dbacb4af3fe549ba767e712fc70be07))
17
+
3
18
  ## 0.19.2 (2025-02-21)
4
19
 
5
20
  ## 0.19.1 (2025-02-20)
@@ -2101,7 +2101,7 @@ export declare namespace Manifest {
2101
2101
  target?: Registry.ApiNewApplication['targetSystem'];
2102
2102
  };
2103
2103
  pov?: {
2104
- details?: ApmPartScripts;
2104
+ details?: PovDetails;
2105
2105
  };
2106
2106
  blo?: BloSettings;
2107
2107
  }
@@ -2112,6 +2112,9 @@ export declare namespace Manifest {
2112
2112
  buildCommand: string;
2113
2113
  workingPath: string;
2114
2114
  }
2115
+ export interface PovDetails extends ApmPartScripts {
2116
+ lowLevel?: boolean;
2117
+ }
2115
2118
  export enum BloAccessLevel {
2116
2119
  restricted = "restricted",
2117
2120
  global = "global"
@@ -2197,18 +2200,20 @@ export declare namespace Package {
2197
2200
  * @param fs
2198
2201
  * @param token
2199
2202
  * @param releasePhase
2203
+ * @param allowedBackends
2200
2204
  * @param env
2201
2205
  */
2202
- export function release(cwd: URI, fs: LocalFS, token: Registry.AuthToken, releasePhase: APM.TagPhase, env?: Globals.ENV): Promise<void>;
2206
+ export function release(cwd: URI, fs: LocalFS, token: Registry.AuthToken, releasePhase: APM.TagPhase, allowedBackends: Registry.ApiNewApplication['allowedBackends'], env?: Globals.ENV): Promise<void>;
2203
2207
  /**
2204
2208
  * Publish an application model tag
2205
2209
  * @param cwd
2206
2210
  * @param fs
2207
2211
  * @param token
2208
2212
  * @param releasePhase
2213
+ * @param allowedBackends
2209
2214
  * @param env
2210
2215
  */
2211
- export function releaseAPM(cwd: URI, fs: LocalFS, token: Registry.AuthToken, releasePhase: APM.TagPhase, env?: Globals.ENV): Promise<void>;
2216
+ export function releaseAPM(cwd: URI, fs: LocalFS, token: Registry.AuthToken, releasePhase: APM.TagPhase, allowedBackends?: Registry.ApiNewApplication['allowedBackends'], env?: Globals.ENV): Promise<void>;
2212
2217
  /**
2213
2218
  * Publish a library project
2214
2219
  * @param cwd
package/out/main.js CHANGED
@@ -13,6 +13,7 @@ var installDependency = dependencies_1.Dependencies.installDependency;
13
13
  const package_1 = require("./package/package");
14
14
  const apm_1 = require("./package/apm");
15
15
  const globals_1 = require("./globals");
16
+ const manifest_1 = require("./manifest");
16
17
  const program = new commander_1.Command();
17
18
  // dummy cwd
18
19
  const devPath = () => {
@@ -86,12 +87,21 @@ program
86
87
  .addOption(new commander_1.Option('-ph --phase <release phase>', 'specify a release phase')
87
88
  .choices(releasePhaseArguments)
88
89
  .default('release'))
90
+ .addOption(new commander_1.Option('--allowedBackends <null|*|server.xz;server.yz>', 'specify the allowedBackends deployment for this version.').default(null))
89
91
  .addOption(optionStudioEnv)
90
92
  .addOption(optionStudioToken)
91
93
  .action(async (opts) => {
92
94
  handleStudioEnv(opts.env);
93
95
  const token = getStudioApiToken(opts);
94
- await package_1.Package.release(cwd, cliFS_1.cliFS, token, opts.phase, opts.env);
96
+ let allowedBackends = null;
97
+ if (opts.allowedBackends) {
98
+ allowedBackends = opts.allowedBackends === '*' ? opts.allowedBackends : opts.allowedBackends.split(';');
99
+ const errorMessage = await manifest_1.Manifest.validateRegistryAllowedBackends(allowedBackends);
100
+ if (errorMessage) {
101
+ throw new Error(errorMessage);
102
+ }
103
+ }
104
+ await package_1.Package.release(cwd, cliFS_1.cliFS, token, opts.phase, allowedBackends, opts.env);
95
105
  });
96
106
  module.exports = function (argv) {
97
107
  program.parse(argv);
@@ -48,6 +48,7 @@ var APM;
48
48
  };
49
49
  if (pov && pov.details) {
50
50
  tagHeader.pov_location = manifest_1.Manifest.PovLocation.pure;
51
+ tagHeader.pov_details_lowlevel = !!pov.details.lowLevel;
51
52
  }
52
53
  if (projectType === 'addon') {
53
54
  tagHeader.required_hwfw = undefined;
@@ -10,6 +10,7 @@ const dde_1 = require("../dde/dde");
10
10
  const dlo_1 = require("../dlo/dlo");
11
11
  const compiler_1 = require("../dlo/compiler");
12
12
  const scriptRunner_1 = require("../scriptRunner");
13
+ const registryAPI_1 = require("../registryAPI");
13
14
  const manifest_1 = require("../manifest");
14
15
  const globals_1 = require("../globals");
15
16
  const library_1 = require("./library");
@@ -47,15 +48,16 @@ var Package;
47
48
  * @param fs
48
49
  * @param token
49
50
  * @param releasePhase
51
+ * @param allowedBackends
50
52
  * @param env
51
53
  */
52
- async function release(cwd, fs, token, releasePhase, env = globals_1.Globals.ENV.production) {
54
+ async function release(cwd, fs, token, releasePhase, allowedBackends, env = globals_1.Globals.ENV.production) {
53
55
  const manifest = await manifest_1.Manifest.read(cwd, fs);
54
56
  if (manifest_1.Manifest.isLibrary(manifest)) {
55
57
  await releaseLibrary(cwd, fs, token, env);
56
58
  }
57
59
  else {
58
- await releaseAPM(cwd, fs, token, releasePhase, env);
60
+ await releaseAPM(cwd, fs, token, releasePhase, allowedBackends, env);
59
61
  }
60
62
  }
61
63
  Package.release = release;
@@ -65,9 +67,10 @@ var Package;
65
67
  * @param fs
66
68
  * @param token
67
69
  * @param releasePhase
70
+ * @param allowedBackends
68
71
  * @param env
69
72
  */
70
- async function releaseAPM(cwd, fs, token, releasePhase, env = globals_1.Globals.ENV.production) {
73
+ async function releaseAPM(cwd, fs, token, releasePhase, allowedBackends = null, env = globals_1.Globals.ENV.production) {
71
74
  if (!Object.values(apm_1.APM.TagPhase).includes(releasePhase)) {
72
75
  throw new Error(`ReleasePhase: ${releasePhase} is not a valid release phase`);
73
76
  }
@@ -82,6 +85,14 @@ var Package;
82
85
  await apm_1.APM.updateProfile(cwd, fs, token, env);
83
86
  const tagContent = await apm_1.APM.createTag(cwd, fs, releasePhase);
84
87
  const newTag = await apm_1.APM.publishTag(cwd, fs, token, tagContent, env);
88
+ if (allowedBackends !== null) {
89
+ const manifest = await manifest_1.Manifest.read(cwd, fs);
90
+ // update tag with content
91
+ await registryAPI_1.Registry.updateExistingApplicationVersion(token, manifest.publisher, manifest.registry?.id, manifest.version, {
92
+ allowedBackends
93
+ }, globals_1.Globals.ENV.lucky);
94
+ console.log(`Tag "${newTag.version}" with phase "${newTag.phase}" shared with ${[...allowedBackends].join(';')}!`);
95
+ }
85
96
  console.log(`Tag "${newTag.version}" with phase "${newTag.phase}" published!`);
86
97
  }
87
98
  Package.releaseAPM = releaseAPM;
@@ -21,9 +21,14 @@ var Registry;
21
21
  * Get the actual api url based on the STUDIO_ENV
22
22
  */
23
23
  Registry.getAPIUrl = () => {
24
- const isLucky = process.env.STUDIO_ENV === 'lucky';
25
- const url = isLucky ? 'https://api.registry.stage.microtronics.com/v1' : 'https://api.registry.microtronics.com/v1';
26
- return { baseUrl: url };
24
+ let url = 'https://api.registry.microtronics.com';
25
+ if (process.env.STUDIO_ENV === 'lucky') {
26
+ url = 'https://api.registry.lucky.ci.microtronics.com';
27
+ }
28
+ else if (process.env.STUDIO_ENV === 'wynni') {
29
+ url = 'https://api.registry.wynni.ci.microtronics.com';
30
+ }
31
+ return { baseUrl: url + '/v1' };
27
32
  };
28
33
  /**
29
34
  * Fetch the library profile of the given library
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microtronics/studio-cli",
3
- "version": "0.19.2",
3
+ "version": "0.21.0",
4
4
  "description": "Microtronics Studio CLI Tool",
5
5
  "main": "./out/api.js",
6
6
  "typings": "./dist/studio-cli.d.ts",
@@ -20,7 +20,7 @@
20
20
  "test-ci": "cross-env STUDIO_ENV=lucky mocha --reporter mocha-junit-reporter",
21
21
  "watch:test": "npm run test -- --watch",
22
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"
23
+ "build:registryApiTypings": "npx openapi-typescript https://api.registry.wynni.ci.microtronics.com/v1/openapi.yaml -o ./src/typings/registry.ts"
24
24
  },
25
25
  "author": "Microtronics",
26
26
  "license": "ISC",