@qelos/plugins-cli 0.0.16 → 0.0.18
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/package.json +2 -2
- package/services/components.mjs +6 -4
- package/services/sdk.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qelos/plugins-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "CLI to manage QELOS plugins",
|
|
5
5
|
"main": "cli.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "David Meir-Levy <davidmeirlevy@gmail.com>",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@qelos/sdk": "^3.11.
|
|
17
|
+
"@qelos/sdk": "^3.11.1",
|
|
18
18
|
"cli-progress": "^3.12.0",
|
|
19
19
|
"cli-select": "^1.1.2",
|
|
20
20
|
"decompress-zip": "^0.3.3",
|
package/services/components.mjs
CHANGED
|
@@ -41,16 +41,18 @@ export async function pushComponents(sdk, path, options = {}) {
|
|
|
41
41
|
const componentName = file.replace('.vue', '');
|
|
42
42
|
const info = componentsJson[componentName] || {};
|
|
43
43
|
const content = fs.readFileSync(join(path, file), 'utf-8');
|
|
44
|
+
const targetIdentifier = info.identifier || componentName;
|
|
45
|
+
const targetDescription = info.description || 'Component description';
|
|
44
46
|
|
|
45
47
|
logger.step(`Pushing component: ${componentName}`);
|
|
46
48
|
|
|
47
49
|
const existingComponent = existingComponents.find(
|
|
48
|
-
component => component.identifier === componentName
|
|
50
|
+
component => component.identifier === targetIdentifier || component.componentName === componentName
|
|
49
51
|
);
|
|
50
52
|
|
|
51
53
|
if (existingComponent) {
|
|
52
54
|
await sdk.components.update(existingComponent._id, {
|
|
53
|
-
identifier:
|
|
55
|
+
identifier: targetIdentifier,
|
|
54
56
|
componentName: componentName,
|
|
55
57
|
content,
|
|
56
58
|
description: info.description || existingComponent.description || 'Component description'
|
|
@@ -58,10 +60,10 @@ export async function pushComponents(sdk, path, options = {}) {
|
|
|
58
60
|
logger.success(`Updated: ${componentName}`);
|
|
59
61
|
} else {
|
|
60
62
|
await sdk.components.create({
|
|
61
|
-
identifier:
|
|
63
|
+
identifier: targetIdentifier,
|
|
62
64
|
componentName: componentName,
|
|
63
65
|
content,
|
|
64
|
-
description:
|
|
66
|
+
description: targetDescription
|
|
65
67
|
});
|
|
66
68
|
logger.success(`Created: ${componentName}`);
|
|
67
69
|
}
|
package/services/sdk.mjs
CHANGED