lucid-package 0.0.6 → 0.0.7
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
package/src/editorextension.js
CHANGED
|
@@ -7,6 +7,7 @@ const package_1 = require("./package");
|
|
|
7
7
|
const express = require("express");
|
|
8
8
|
const child_process = require("child_process");
|
|
9
9
|
const shapelibrary_1 = require("./shapelibrary");
|
|
10
|
+
const packagemanifest_1 = require("./packagemanifest");
|
|
10
11
|
const WebPackCLI = require('webpack-cli');
|
|
11
12
|
async function createEditorExtension(name, isInternalTesting) {
|
|
12
13
|
console.log('Creating empty editor extension in editorextensions/' + name);
|
|
@@ -59,6 +60,11 @@ async function debugEditorExtension(name) {
|
|
|
59
60
|
app.get('/extension.js', async (req, res) => {
|
|
60
61
|
res.send((await fs.readFile('bin/extension.js')).toString());
|
|
61
62
|
});
|
|
63
|
+
app.get('/scopes', async (req, res) => {
|
|
64
|
+
var _a;
|
|
65
|
+
const manifest = await (0, packagemanifest_1.readManifest)('../../');
|
|
66
|
+
res.send(JSON.stringify((_a = manifest['extensions'].find((extension) => extension['name'] === name)) === null || _a === void 0 ? void 0 : _a.scopes));
|
|
67
|
+
});
|
|
62
68
|
app.listen(9900, () => {
|
|
63
69
|
console.log('Listening at http://localhost:9900/extension.js');
|
|
64
70
|
});
|
package/src/packagemanifest.d.ts
CHANGED
package/src/shapelibrary.js
CHANGED
|
@@ -18,7 +18,7 @@ async function createEmptyShapeLibrary(name) {
|
|
|
18
18
|
await (0, package_1.modifyManifest)((manifest) => {
|
|
19
19
|
manifest['shapeLibraries'].push({
|
|
20
20
|
'name': name,
|
|
21
|
-
'
|
|
21
|
+
'product': 'chart',
|
|
22
22
|
'lcszPath': `shapelibraries/${name}.lcsz`,
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -147,7 +147,9 @@ async function debugShapeLibraries(packagePath = '.') {
|
|
|
147
147
|
var _a;
|
|
148
148
|
const manifest = await (0, packagemanifest_1.readManifest)(packagePath + '/');
|
|
149
149
|
const libraries = (_a = manifest['shapeLibraries']) !== null && _a !== void 0 ? _a : [];
|
|
150
|
-
|
|
150
|
+
const output = await Promise.all(libraries.map(async (libraryManifest) => {
|
|
151
|
+
const libraryDefinitionContent = await fs.readFile(packagePath + '/shapelibraries/' + libraryManifest['name'] + '/library.manifest');
|
|
152
|
+
const libraryDefinition = JSON.parse(libraryDefinitionContent.toString());
|
|
151
153
|
return {
|
|
152
154
|
'uri': 'http://localhost:9901/shapeLibraries/' +
|
|
153
155
|
encodeURIComponent(libraryManifest['name']) +
|
|
@@ -155,7 +157,7 @@ async function debugShapeLibraries(packagePath = '.') {
|
|
|
155
157
|
shapeLibraryVersion,
|
|
156
158
|
'user': '',
|
|
157
159
|
'created': new Date().toISOString(),
|
|
158
|
-
'name':
|
|
160
|
+
'name': libraryDefinition['name'],
|
|
159
161
|
'size': 0,
|
|
160
162
|
'shapes': 'http://localhost:9901/shapeLibraries/' +
|
|
161
163
|
encodeURIComponent(libraryManifest['name']) +
|
|
@@ -164,7 +166,8 @@ async function debugShapeLibraries(packagePath = '.') {
|
|
|
164
166
|
'team-edit': false,
|
|
165
167
|
'encryption': '',
|
|
166
168
|
};
|
|
167
|
-
}))
|
|
169
|
+
}));
|
|
170
|
+
res.send(JSON.stringify(output));
|
|
168
171
|
});
|
|
169
172
|
app.get('/shapeLibraries/:libraryName/shapes', async (req, res) => {
|
|
170
173
|
//Find all the shapes in the given shape library, and produce JSON for the client
|