@microtronics/studio-cli 0.15.1 → 0.16.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 +10 -0
- package/dist/studio-cli.d.ts +16 -1
- package/out/dde/dde.js +2 -2
- package/out/dde/fileGenerators/dlo.js +1 -1
- package/out/dependencies.js +1 -2
- package/out/dlo/preCompiler.js +1 -1
- package/out/globals.js +1 -1
- package/out/manifest.js +24 -8
- package/out/package/apm.js +3 -0
- package/out/package/package.js +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## 0.16.0 (2025-02-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **studio-cli:** add the `history.json` to the store tag ([70086be](https://bitbucket.org/microtronics-core/vscode-studio/commits/70086be5ef2100ba6bf0e699d242bf9d02d7e347))
|
|
9
|
+
* **studio-cli:** add the `studio.json` to the store tag ([6e23a79](https://bitbucket.org/microtronics-core/vscode-studio/commits/6e23a793f8d7c7ebc8a5044d86002d965ac484eb))
|
|
10
|
+
* **studio-cli:** introduced new manifest property `type` ([edbd5cb](https://bitbucket.org/microtronics-core/vscode-studio/commits/edbd5cbb11198f6659be42560642676258c6ca66))
|
|
11
|
+
* **studio-cli:** prevent generating `history.json` for library projects ([00e45c0](https://bitbucket.org/microtronics-core/vscode-studio/commits/00e45c02b07147a157b0c3fedb3217988c0ea225))
|
|
12
|
+
|
|
3
13
|
## 0.15.1 (2025-01-31)
|
|
4
14
|
|
|
5
15
|
|
package/dist/studio-cli.d.ts
CHANGED
|
@@ -2021,12 +2021,24 @@ declare interface LocalFS {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
|
|
2023
2023
|
export declare namespace Manifest {
|
|
2024
|
+
/**
|
|
2025
|
+
* The source filename where the information is stored in
|
|
2026
|
+
*/
|
|
2027
|
+
const fileName = "studio.json";
|
|
2024
2028
|
export type DeviceProfiles = 'm22x' | 'm23x' | 'nrf91' | 'm2blegw' | 'm2easyv3' | 'm2easyiot';
|
|
2029
|
+
/**
|
|
2030
|
+
* Type of the iot app project
|
|
2031
|
+
*/
|
|
2032
|
+
export enum ProjectTypes {
|
|
2033
|
+
app = "app",
|
|
2034
|
+
library = "library"
|
|
2035
|
+
}
|
|
2025
2036
|
export interface Manifest {
|
|
2026
2037
|
version: string;
|
|
2027
2038
|
name: string;
|
|
2028
2039
|
publisher: string;
|
|
2029
2040
|
description: string;
|
|
2041
|
+
type: ProjectTypes;
|
|
2030
2042
|
legacyProject?: boolean;
|
|
2031
2043
|
icon?: string;
|
|
2032
2044
|
dpid: DeviceProfiles;
|
|
@@ -2035,6 +2047,9 @@ export declare namespace Manifest {
|
|
|
2035
2047
|
hwfw?: string[];
|
|
2036
2048
|
productId?: string[];
|
|
2037
2049
|
};
|
|
2050
|
+
/**
|
|
2051
|
+
* @deprecated
|
|
2052
|
+
*/
|
|
2038
2053
|
library?: boolean;
|
|
2039
2054
|
libraryDependencies?: Dependencies;
|
|
2040
2055
|
libraryDevDependencies?: Dependencies;
|
|
@@ -2098,7 +2113,7 @@ export declare namespace Manifest {
|
|
|
2098
2113
|
/**
|
|
2099
2114
|
* Check if the current project is a library project
|
|
2100
2115
|
*/
|
|
2101
|
-
export function
|
|
2116
|
+
export function isLibrary(manifest: Manifest.Manifest): boolean;
|
|
2102
2117
|
/**
|
|
2103
2118
|
* Validates if the properties within
|
|
2104
2119
|
* @param cwd
|
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
|
|
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.
|
|
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.
|
|
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)) {
|
package/out/dependencies.js
CHANGED
|
@@ -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 (
|
|
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({
|
package/out/dlo/preCompiler.js
CHANGED
|
@@ -111,7 +111,7 @@ class DloPreCompiler {
|
|
|
111
111
|
// console.log('MANGLED LIB', baseName, mangleDDEFunctions);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
else if (manifest_1.Manifest.
|
|
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/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.
|
|
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,6 @@ 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';
|
|
17
16
|
// Cache to reduce the disk read requests
|
|
18
17
|
const manifestCache = {
|
|
19
18
|
_manifest: null,
|
|
@@ -39,6 +38,18 @@ const manifestCache = {
|
|
|
39
38
|
var Manifest;
|
|
40
39
|
(function (Manifest) {
|
|
41
40
|
var convertBlobToString = helper_1.Helper.convertBlobToString;
|
|
41
|
+
/**
|
|
42
|
+
* The source filename where the information is stored in
|
|
43
|
+
*/
|
|
44
|
+
Manifest.fileName = 'studio.json';
|
|
45
|
+
/**
|
|
46
|
+
* Type of the iot app project
|
|
47
|
+
*/
|
|
48
|
+
let ProjectTypes;
|
|
49
|
+
(function (ProjectTypes) {
|
|
50
|
+
ProjectTypes["app"] = "app";
|
|
51
|
+
ProjectTypes["library"] = "library";
|
|
52
|
+
})(ProjectTypes = Manifest.ProjectTypes || (Manifest.ProjectTypes = {}));
|
|
42
53
|
let BloAccessLevel;
|
|
43
54
|
(function (BloAccessLevel) {
|
|
44
55
|
BloAccessLevel["restricted"] = "restricted";
|
|
@@ -55,7 +66,7 @@ var Manifest;
|
|
|
55
66
|
* @param fs
|
|
56
67
|
*/
|
|
57
68
|
async function read(cwd, fs) {
|
|
58
|
-
const manifestUri = vscode_uri_1.Utils.joinPath(cwd,
|
|
69
|
+
const manifestUri = vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName);
|
|
59
70
|
const manifestStat = await fs.stat(manifestUri);
|
|
60
71
|
// if the manifest was modified, reload the cache
|
|
61
72
|
if (manifestCache.manifest === null ||
|
|
@@ -77,7 +88,7 @@ var Manifest;
|
|
|
77
88
|
* @param fs
|
|
78
89
|
*/
|
|
79
90
|
async function readAsBlob(cwd, fs) {
|
|
80
|
-
return await fs.readFile(vscode_uri_1.Utils.joinPath(cwd,
|
|
91
|
+
return await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName));
|
|
81
92
|
}
|
|
82
93
|
Manifest.readAsBlob = readAsBlob;
|
|
83
94
|
/**
|
|
@@ -91,16 +102,21 @@ var Manifest;
|
|
|
91
102
|
// patch the options if they are not valid for a specific device profile
|
|
92
103
|
patchDloCompileOptionsBasedOnDpid(manifest);
|
|
93
104
|
removeDeprecatedOptions(manifest);
|
|
94
|
-
return fs.writeFile(vscode_uri_1.Utils.joinPath(cwd,
|
|
105
|
+
return fs.writeFile(vscode_uri_1.Utils.joinPath(cwd, Manifest.fileName), JSON.stringify(manifest, null, '\t'));
|
|
95
106
|
}
|
|
96
107
|
Manifest.write = write;
|
|
97
108
|
/**
|
|
98
109
|
* Check if the current project is a library project
|
|
99
110
|
*/
|
|
100
|
-
function
|
|
101
|
-
|
|
111
|
+
function isLibrary(manifest) {
|
|
112
|
+
if (manifest.library !== undefined) {
|
|
113
|
+
return manifest.library;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return manifest.type === ProjectTypes.library;
|
|
117
|
+
}
|
|
102
118
|
}
|
|
103
|
-
Manifest.
|
|
119
|
+
Manifest.isLibrary = isLibrary;
|
|
104
120
|
/**
|
|
105
121
|
* Validates if the properties within
|
|
106
122
|
* @param cwd
|
|
@@ -295,7 +311,7 @@ function validateHwFwOrProductId(manifest) {
|
|
|
295
311
|
* @param env
|
|
296
312
|
*/
|
|
297
313
|
function validateProjectVersion(manifest, env) {
|
|
298
|
-
if (env === globals_1.Globals.ENV.lucky || Manifest.
|
|
314
|
+
if (env === globals_1.Globals.ENV.lucky || Manifest.isLibrary(manifest)) {
|
|
299
315
|
if (!preload_1.default.valid(manifest.version)) {
|
|
300
316
|
throw new Error('"version" has to be a semantic version string!"');
|
|
301
317
|
}
|
package/out/package/apm.js
CHANGED
|
@@ -96,6 +96,7 @@ 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
102
|
const amxBlob = new Blob([await fs.readFile(vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.mainAmxPath))]);
|
|
@@ -257,5 +258,7 @@ async function addAdditionalFiles(cwd, fs, apmBuffer) {
|
|
|
257
258
|
const reportTemplateBlob = new Blob([await fs.readFile(reportTemplate)]);
|
|
258
259
|
apmBuffer.append(`bin/pov/mdn_report_template.json`, reportTemplateBlob);
|
|
259
260
|
}
|
|
261
|
+
const historyPath = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.historyJson);
|
|
262
|
+
apmBuffer.append(`src/dde/${manifest_1.Manifest.fileName}`, new Blob([await fs.readFile(historyPath)]));
|
|
260
263
|
}
|
|
261
264
|
//# sourceMappingURL=apm.js.map
|
package/out/package/package.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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
|
|
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);
|