lucid-package 0.0.10 → 0.0.13
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lucid-package",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -29,5 +29,8 @@
|
|
|
29
29
|
"webpack": "^5.64.4",
|
|
30
30
|
"webpack-cli": "^4.9.1",
|
|
31
31
|
"ws": "^8.5.0"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=14.0.0"
|
|
32
35
|
}
|
|
33
36
|
}
|
package/src/editorextension.js
CHANGED
|
@@ -21,7 +21,7 @@ async function createEditorExtension(name, isInternalTesting) {
|
|
|
21
21
|
'title': name,
|
|
22
22
|
'product': 'chart',
|
|
23
23
|
'codePath': `editorextensions/${name}/bin/extension.js`,
|
|
24
|
-
'scopes': ['READ', 'WRITE', 'DOWNLOAD', 'SHOW_MODAL', 'NETWORK'],
|
|
24
|
+
'scopes': ['READ', 'WRITE', 'DOWNLOAD', 'SHOW_MODAL', 'CUSTOM_UI', 'NETWORK'],
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
console.log(`Installing dependencies`);
|
|
@@ -90,7 +90,7 @@ async function debugEditorExtension(name) {
|
|
|
90
90
|
codeUrl: 'http://localhost:9900/extension.js',
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
-
app.listen(9900, () => {
|
|
93
|
+
app.listen(9900, 'localhost', () => {
|
|
94
94
|
console.log('Listening at http://localhost:9900/extension.js');
|
|
95
95
|
});
|
|
96
96
|
(0, shapelibrary_1.debugShapeLibraries)('../..');
|
package/src/package.js
CHANGED
|
@@ -18,7 +18,7 @@ function currentlyInPackage() {
|
|
|
18
18
|
return (fsOld.existsSync('editorextensions') && fsOld.existsSync('shapelibraries') && fsOld.existsSync('manifest.json'));
|
|
19
19
|
}
|
|
20
20
|
exports.currentlyInPackage = currentlyInPackage;
|
|
21
|
-
const allScopes = new Set(['DOWNLOAD', 'NETWORK', 'READ', 'SHOW_MODAL', 'WRITE']);
|
|
21
|
+
const allScopes = new Set(['DOWNLOAD', 'NETWORK', 'READ', 'SHOW_MODAL', 'CUSTOM_UI', 'WRITE']);
|
|
22
22
|
async function modifyManifest(callback) {
|
|
23
23
|
const manifest = await (0, packagemanifest_1.readManifest)();
|
|
24
24
|
await callback(manifest);
|
package/src/shapelibrary.js
CHANGED
|
@@ -38,10 +38,11 @@ const defaultNameMap = new Map([
|
|
|
38
38
|
//Produce JSON equivalent to the document service's
|
|
39
39
|
// /shapeLibraries/:name/shapes endpoint
|
|
40
40
|
async function getShapeListJson(name, packagePath) {
|
|
41
|
+
const packageManifest = await (0, packagemanifest_1.readManifest)(packagePath + '/');
|
|
41
42
|
const rawManifest = await fs.readFile(packagePath + `/shapelibraries/${name}/library.manifest`);
|
|
42
43
|
const manifest = hjson.parse(rawManifest.toString());
|
|
43
44
|
return JSON.stringify(await Promise.all(manifest['shapes'].map(async (shapeManifest, index) => {
|
|
44
|
-
var _a;
|
|
45
|
+
var _a, _b;
|
|
45
46
|
const rawShapeData = await fs.readFile(packagePath + `/shapelibraries/${name}/shapes/${shapeManifest['shape']}.shape`);
|
|
46
47
|
const shapeData = hjson.parse(rawShapeData.toString());
|
|
47
48
|
const properties = {
|
|
@@ -61,8 +62,8 @@ async function getShapeListJson(name, packagePath) {
|
|
|
61
62
|
'name': shapeManifest['name'],
|
|
62
63
|
'i18n': {},
|
|
63
64
|
'sourcePackage': {
|
|
64
|
-
'packageId': '__local__',
|
|
65
|
-
'version': '
|
|
65
|
+
'packageId': (_a = packageManifest['id']) !== null && _a !== void 0 ? _a : '__local__',
|
|
66
|
+
'version': packageManifest['version'],
|
|
66
67
|
'library': name,
|
|
67
68
|
'shape': shapeManifest['shape'],
|
|
68
69
|
},
|
|
@@ -98,7 +99,7 @@ async function getShapeListJson(name, packagePath) {
|
|
|
98
99
|
}
|
|
99
100
|
for (var key in shapeManifest['defaults']) {
|
|
100
101
|
if (key !== 'width' && key !== 'height') {
|
|
101
|
-
const outName = (
|
|
102
|
+
const outName = (_b = defaultNameMap.get(key)) !== null && _b !== void 0 ? _b : key;
|
|
102
103
|
properties[outName] = shapeManifest['defaults'][key];
|
|
103
104
|
}
|
|
104
105
|
}
|
|
@@ -199,7 +200,7 @@ async function debugShapeLibraries(packagePath = '.') {
|
|
|
199
200
|
socket.send('refresh');
|
|
200
201
|
}
|
|
201
202
|
});
|
|
202
|
-
server.listen(9901, () => {
|
|
203
|
+
server.listen(9901, 'localhost', () => {
|
|
203
204
|
console.log('Listening at http://localhost:9901/shapeLibraries');
|
|
204
205
|
});
|
|
205
206
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
/** @ignore */
|
|
1
2
|
declare namespace lucid {
|
|
2
3
|
export function executeCommand(name: string, params: any): any;
|
|
3
4
|
export function listen(msg: any): void;
|
|
5
|
+
export function getPackageId(): string;
|
|
6
|
+
export function getVersion(): string;
|
|
4
7
|
}
|
|
5
8
|
|
|
9
|
+
/** @ignore */
|
|
6
10
|
declare namespace console {
|
|
7
11
|
export function log(...args: any[]): void;
|
|
8
12
|
}
|