@supernova-studio/pulsar-core 1.0.4 → 1.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 +4 -5
- package/build/browser/pulsar.js +0 -141743
- package/build/browser/pulsar.min.js +0 -270
- package/build/main/browser-bundle.d.ts +0 -1
- package/build/main/browser-bundle.js +0 -17
- package/build/main/browser-bundle.js.map +0 -1
- package/build/main/engine/ExportEngine.d.ts +0 -17
- package/build/main/engine/ExportEngine.js +0 -122
- package/build/main/engine/ExportEngine.js.map +0 -1
- package/build/main/engine/configuration/ExportConfiguration.d.ts +0 -18
- package/build/main/engine/configuration/ExportConfiguration.js +0 -47
- package/build/main/engine/configuration/ExportConfiguration.js.map +0 -1
- package/build/main/engine/generation/ExportDataProducer.d.ts +0 -15
- package/build/main/engine/generation/ExportDataProducer.js +0 -100
- package/build/main/engine/generation/ExportDataProducer.js.map +0 -1
- package/build/main/engine/generation/queue/ExportDataQueue.d.ts +0 -16
- package/build/main/engine/generation/queue/ExportDataQueue.js +0 -72
- package/build/main/engine/generation/queue/ExportDataQueue.js.map +0 -1
- package/build/main/engine/generation/queue/ExportDataQueueOperation.d.ts +0 -6
- package/build/main/engine/generation/queue/ExportDataQueueOperation.js +0 -36
- package/build/main/engine/generation/queue/ExportDataQueueOperation.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.d.ts +0 -7
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js +0 -54
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.d.ts +0 -7
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js +0 -40
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataRequest.d.ts +0 -19
- package/build/main/engine/generation/requests/ExportDataRequest.js +0 -55
- package/build/main/engine/generation/requests/ExportDataRequest.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.d.ts +0 -16
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.js +0 -57
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.d.ts +0 -22
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.js +0 -86
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataRequestProducer.d.ts +0 -16
- package/build/main/engine/generation/requests/ExportDataRequestProducer.js +0 -162
- package/build/main/engine/generation/requests/ExportDataRequestProducer.js.map +0 -1
- package/build/main/engine/generation/requests/ExportDataResponse.d.ts +0 -13
- package/build/main/engine/generation/requests/ExportDataResponse.js +0 -30
- package/build/main/engine/generation/requests/ExportDataResponse.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.d.ts +0 -14
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js +0 -77
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.d.ts +0 -13
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js +0 -47
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.d.ts +0 -13
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js +0 -47
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.d.ts +0 -11
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js +0 -43
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.d.ts +0 -13
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js +0 -47
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.d.ts +0 -13
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js +0 -47
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js.map +0 -1
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.d.ts +0 -13
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js +0 -47
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js.map +0 -1
- package/build/main/engine/items/ExportItemProducer.d.ts +0 -14
- package/build/main/engine/items/ExportItemProducer.js +0 -70
- package/build/main/engine/items/ExportItemProducer.js.map +0 -1
- package/build/main/engine/items/construction/ExportItem.d.ts +0 -8
- package/build/main/engine/items/construction/ExportItem.js +0 -25
- package/build/main/engine/items/construction/ExportItem.js.map +0 -1
- package/build/main/engine/items/construction/ExportItemBuilder.d.ts +0 -9
- package/build/main/engine/items/construction/ExportItemBuilder.js +0 -47
- package/build/main/engine/items/construction/ExportItemBuilder.js.map +0 -1
- package/build/main/engine/items/queue/ExportItemQueue.d.ts +0 -16
- package/build/main/engine/items/queue/ExportItemQueue.js +0 -70
- package/build/main/engine/items/queue/ExportItemQueue.js.map +0 -1
- package/build/main/engine/items/queue/ExportItemQueueOperation.d.ts +0 -6
- package/build/main/engine/items/queue/ExportItemQueueOperation.js +0 -36
- package/build/main/engine/items/queue/ExportItemQueueOperation.js.map +0 -1
- package/build/main/engine/items/requests/ExportItemRequest.d.ts +0 -16
- package/build/main/engine/items/requests/ExportItemRequest.js +0 -68
- package/build/main/engine/items/requests/ExportItemRequest.js.map +0 -1
- package/build/main/engine/items/requests/ExportItemRequestProducer.d.ts +0 -8
- package/build/main/engine/items/requests/ExportItemRequestProducer.js +0 -24
- package/build/main/engine/items/requests/ExportItemRequestProducer.js.map +0 -1
- package/build/main/engine/items/requests/ExportItemResponse.d.ts +0 -9
- package/build/main/engine/items/requests/ExportItemResponse.js +0 -25
- package/build/main/engine/items/requests/ExportItemResponse.js.map +0 -1
- package/build/main/engine/items/requests/ExportItemResponseProducer.d.ts +0 -7
- package/build/main/engine/items/requests/ExportItemResponseProducer.js +0 -45
- package/build/main/engine/items/requests/ExportItemResponseProducer.js.map +0 -1
- package/build/main/engine/loaders/BlueprintLoader.d.ts +0 -9
- package/build/main/engine/loaders/BlueprintLoader.js +0 -55
- package/build/main/engine/loaders/BlueprintLoader.js.map +0 -1
- package/build/main/engine/writing/queue/ExportWriterQueue.d.ts +0 -16
- package/build/main/engine/writing/queue/ExportWriterQueue.js +0 -70
- package/build/main/engine/writing/queue/ExportWriterQueue.js.map +0 -1
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.d.ts +0 -6
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.js +0 -36
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.js.map +0 -1
- package/build/main/engine/writing/requests/ExportWriterRequest.d.ts +0 -14
- package/build/main/engine/writing/requests/ExportWriterRequest.js +0 -40
- package/build/main/engine/writing/requests/ExportWriterRequest.js.map +0 -1
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.d.ts +0 -8
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.js +0 -30
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.js.map +0 -1
- package/build/main/engine/writing/requests/ExportWriterResponse.d.ts +0 -9
- package/build/main/engine/writing/requests/ExportWriterResponse.js +0 -25
- package/build/main/engine/writing/requests/ExportWriterResponse.js.map +0 -1
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.d.ts +0 -7
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.js +0 -40
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.js.map +0 -1
- package/build/main/engine/writing/writers/ExportItemWriter.d.ts +0 -14
- package/build/main/engine/writing/writers/ExportItemWriter.js +0 -70
- package/build/main/engine/writing/writers/ExportItemWriter.js.map +0 -1
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.d.ts +0 -9
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js +0 -63
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js.map +0 -1
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.d.ts +0 -4
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.js +0 -29
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.js.map +0 -1
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.d.ts +0 -5
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js +0 -59
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js.map +0 -1
- package/build/main/engine/writing/writers/memory/ExportWriterStore.d.ts +0 -5
- package/build/main/engine/writing/writers/memory/ExportWriterStore.js +0 -33
- package/build/main/engine/writing/writers/memory/ExportWriterStore.js.map +0 -1
- package/build/main/exports.d.ts +0 -4
- package/build/main/exports.js +0 -13
- package/build/main/exports.js.map +0 -1
- package/build/main/index.d.ts +0 -1
- package/build/main/index.js +0 -14
- package/build/main/index.js.map +0 -1
- package/build/main/model/dsm/DSMReferenceStore.d.ts +0 -28
- package/build/main/model/dsm/DSMReferenceStore.js +0 -100
- package/build/main/model/dsm/DSMReferenceStore.js.map +0 -1
- package/build/main/model/exporters/Exporter.d.ts +0 -50
- package/build/main/model/exporters/Exporter.js +0 -88
- package/build/main/model/exporters/Exporter.js.map +0 -1
- package/build/main/model/maps/ExporterMapBlueprint.d.ts +0 -12
- package/build/main/model/maps/ExporterMapBlueprint.js +0 -39
- package/build/main/model/maps/ExporterMapBlueprint.js.map +0 -1
- package/build/main/model/sources/ExporterSource.d.ts +0 -25
- package/build/main/model/sources/ExporterSource.js +0 -58
- package/build/main/model/sources/ExporterSource.js.map +0 -1
- package/build/main/pulsar/Pulsar.d.ts +0 -105
- package/build/main/pulsar/Pulsar.js +0 -351
- package/build/main/pulsar/Pulsar.js.map +0 -1
- package/build/main/pulsar/PulsarInterface.d.ts +0 -152
- package/build/main/pulsar/PulsarInterface.js +0 -37
- package/build/main/pulsar/PulsarInterface.js.map +0 -1
- package/build/main/pulsar/PulsarStaticAnalysis.d.ts +0 -23
- package/build/main/pulsar/PulsarStaticAnalysis.js +0 -47
- package/build/main/pulsar/PulsarStaticAnalysis.js.map +0 -1
- package/build/main/pulsar/PulsarStaticAnalysisInterface.d.ts +0 -10
- package/build/main/pulsar/PulsarStaticAnalysisInterface.js +0 -10
- package/build/main/pulsar/PulsarStaticAnalysisInterface.js.map +0 -1
- package/build/main/pulsar/managers/PulsarBlueprintManager.d.ts +0 -16
- package/build/main/pulsar/managers/PulsarBlueprintManager.js +0 -76
- package/build/main/pulsar/managers/PulsarBlueprintManager.js.map +0 -1
- package/build/main/pulsar/managers/PulsarCIManager.d.ts +0 -25
- package/build/main/pulsar/managers/PulsarCIManager.js +0 -220
- package/build/main/pulsar/managers/PulsarCIManager.js.map +0 -1
- package/build/main/pulsar/managers/PulsarCodeManager.d.ts +0 -24
- package/build/main/pulsar/managers/PulsarCodeManager.js +0 -180
- package/build/main/pulsar/managers/PulsarCodeManager.js.map +0 -1
- package/build/main/pulsar/managers/PulsarConfigurationManager.d.ts +0 -16
- package/build/main/pulsar/managers/PulsarConfigurationManager.js +0 -48
- package/build/main/pulsar/managers/PulsarConfigurationManager.js.map +0 -1
- package/build/main/pulsar/managers/PulsarExporterManager.d.ts +0 -25
- package/build/main/pulsar/managers/PulsarExporterManager.js +0 -121
- package/build/main/pulsar/managers/PulsarExporterManager.js.map +0 -1
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.d.ts +0 -16
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js +0 -276
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js.map +0 -1
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.d.ts +0 -7
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js +0 -63
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js.map +0 -1
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.d.ts +0 -5
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js +0 -28
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js.map +0 -1
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.d.ts +0 -11
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js +0 -99
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js.map +0 -1
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.d.ts +0 -9
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js +0 -81
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js.map +0 -1
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.d.ts +0 -20
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js +0 -194
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js.map +0 -1
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.d.ts +0 -12
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js +0 -143
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js.map +0 -1
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.d.ts +0 -12
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js +0 -115
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js.map +0 -1
- package/build/main/tests/TestConfiguration.d.ts +0 -9
- package/build/main/tests/TestConfiguration.js +0 -25
- package/build/main/tests/TestConfiguration.js.map +0 -1
- package/build/main/tests/casebuilders/ci.d.ts +0 -12
- package/build/main/tests/casebuilders/ci.js +0 -38
- package/build/main/tests/casebuilders/ci.js.map +0 -1
- package/build/main/tests/casebuilders/configuration.d.ts +0 -5
- package/build/main/tests/casebuilders/configuration.js +0 -25
- package/build/main/tests/casebuilders/configuration.js.map +0 -1
- package/build/main/tests/casebuilders/dsm.d.ts +0 -7
- package/build/main/tests/casebuilders/dsm.js +0 -57
- package/build/main/tests/casebuilders/dsm.js.map +0 -1
- package/build/main/tests/casebuilders/modelObjects.d.ts +0 -13
- package/build/main/tests/casebuilders/modelObjects.js +0 -120
- package/build/main/tests/casebuilders/modelObjects.js.map +0 -1
- package/build/main/tools/Logger.d.ts +0 -27
- package/build/main/tools/Logger.js +0 -98
- package/build/main/tools/Logger.js.map +0 -1
- package/build/main/tools/LoggerDefaultMessages.d.ts +0 -13
- package/build/main/tools/LoggerDefaultMessages.js +0 -41
- package/build/main/tools/LoggerDefaultMessages.js.map +0 -1
- package/build/tsconfig.tsbuildinfo +0 -2829
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BLZAutocompleteEngineApplicationResult, BLZAutocompleteEngineSuggestion } from '@supernova-studio/pulsar-language/build/main/tools/autocomplete/AutocompleteEngine';
|
|
2
|
-
import { BLZHighlightEngineToken } from '@supernova-studio/pulsar-language';
|
|
3
|
-
export interface PLSPulsarStaticAnalysisInterface {
|
|
4
|
-
/** Suggest next characters, words or snippets to be inserted into blazar code as user types */
|
|
5
|
-
suggestNextFromBlueprintCode(code: string, selectionLocation: number, selectionLength: number): Array<BLZAutocompleteEngineSuggestion>;
|
|
6
|
-
/** Apply autocompletion result to specified blazar code */
|
|
7
|
-
applyAutocompletionResultToCode(code: string, selectionLocation: number, selectionLength: number, apply: BLZAutocompleteEngineSuggestion): BLZAutocompleteEngineApplicationResult;
|
|
8
|
-
/** Compute highlight tokens for the provided blazar code */
|
|
9
|
-
suggestHighlightFromBlueprintCode(code: string): Array<BLZHighlightEngineToken>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// PLSPulsarInterface.ts
|
|
4
|
-
// Supernova
|
|
5
|
-
//
|
|
6
|
-
// Created by Jiri Trecak.
|
|
7
|
-
// Copyright © 2020 Jiri Trecak. All rights reserved.
|
|
8
|
-
//
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
//# sourceMappingURL=PulsarStaticAnalysisInterface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PulsarStaticAnalysisInterface.js","sourceRoot":"","sources":["../../../src/pulsar/PulsarStaticAnalysisInterface.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,yBAAyB;AACzB,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PLSExporter } from './../../model/exporters/Exporter';
|
|
2
|
-
import { PLSExporterSource } from '../../model/sources/ExporterSource';
|
|
3
|
-
export declare class PLSPulsarSourceManager {
|
|
4
|
-
private exporter;
|
|
5
|
-
constructor(exporter: PLSExporter);
|
|
6
|
-
/** Get all sources associated with loaded exporter. Note that sources don't contain their code definitions, as those need to be requested separaterly */
|
|
7
|
-
getSources(): Array<PLSExporterSource>;
|
|
8
|
-
/** Get specific source associated with loaded exporter */
|
|
9
|
-
getSourceById(sourceId: string): PLSExporterSource;
|
|
10
|
-
/** Create new source for loaded exporter. Source comes with default name and code and uses generic context */
|
|
11
|
-
createNewSource(): PLSExporterSource;
|
|
12
|
-
/** Delete specified source. Throws error when source is not found */
|
|
13
|
-
deleteSourceById(sourceId: string): void;
|
|
14
|
-
/** Update source id. Id must be non-empty and contain at least 3 characters. It must also be unique in scope. Note that this also updates all maps that are referencing this source */
|
|
15
|
-
updateSourceLocation(oldSourceId: string, newSourceId: string, newPath: string): PLSExporterSource;
|
|
16
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// PulsarSourceManager.ts
|
|
4
|
-
// Supernova
|
|
5
|
-
//
|
|
6
|
-
// Created by Jiri Trecak.
|
|
7
|
-
// Copyright © 2020 Jiri Trecak. All rights reserved.
|
|
8
|
-
//
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PLSPulsarSourceManager = void 0;
|
|
11
|
-
const ExporterSource_1 = require("../../model/sources/ExporterSource");
|
|
12
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
13
|
-
// MARK: - Definitions
|
|
14
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
15
|
-
// MARK: - Class
|
|
16
|
-
class PLSPulsarSourceManager {
|
|
17
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
18
|
-
// MARK: - Setup
|
|
19
|
-
constructor(exporter) {
|
|
20
|
-
this.exporter = exporter;
|
|
21
|
-
}
|
|
22
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
23
|
-
// MARK: - Source manipulation
|
|
24
|
-
/** Get all sources associated with loaded exporter. Note that sources don't contain their code definitions, as those need to be requested separaterly */
|
|
25
|
-
getSources() {
|
|
26
|
-
// Create true array, as every other approach returns some form of iterator
|
|
27
|
-
let sourceStore = new Array();
|
|
28
|
-
for (let source of this.exporter.sources.values()) {
|
|
29
|
-
sourceStore.push(source);
|
|
30
|
-
}
|
|
31
|
-
return sourceStore;
|
|
32
|
-
}
|
|
33
|
-
/** Get specific source associated with loaded exporter */
|
|
34
|
-
getSourceById(sourceId) {
|
|
35
|
-
for (let source of this.exporter.sources.values()) {
|
|
36
|
-
if (source.id === sourceId) {
|
|
37
|
-
return source;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
throw new Error(`Unknown source ${sourceId}`);
|
|
41
|
-
}
|
|
42
|
-
/** Create new source for loaded exporter. Source comes with default name and code and uses generic context */
|
|
43
|
-
createNewSource() {
|
|
44
|
-
let count = this.exporter.sources.size;
|
|
45
|
-
let source = new ExporterSource_1.PLSExporterSource(`source${count + 1}.pr`, null, ``);
|
|
46
|
-
this.exporter.storeNewSource(source);
|
|
47
|
-
return source;
|
|
48
|
-
}
|
|
49
|
-
/** Delete specified source. Throws error when source is not found */
|
|
50
|
-
deleteSourceById(sourceId) {
|
|
51
|
-
if (!this.exporter.sourceById(sourceId)) {
|
|
52
|
-
throw Error(`Unknown source for deletion ${sourceId}`);
|
|
53
|
-
}
|
|
54
|
-
this.exporter.removeSourceById(sourceId);
|
|
55
|
-
}
|
|
56
|
-
/** Update source id. Id must be non-empty and contain at least 3 characters. It must also be unique in scope. Note that this also updates all maps that are referencing this source */
|
|
57
|
-
updateSourceLocation(oldSourceId, newSourceId, newPath) {
|
|
58
|
-
// Find the source
|
|
59
|
-
let source = this.exporter.sourceById(oldSourceId);
|
|
60
|
-
if (!source) {
|
|
61
|
-
throw Error(`Unknown source for update ${oldSourceId}`);
|
|
62
|
-
}
|
|
63
|
-
let sourceId = newSourceId.trim();
|
|
64
|
-
if (sourceId.length < 3) {
|
|
65
|
-
throw Error('Source id must be at least 3 letters long');
|
|
66
|
-
}
|
|
67
|
-
if (!sourceId.match(/^[0-9a-zA-Z._]+$/)) {
|
|
68
|
-
throw Error('Source id must only contain letters, numbers, dots or underscores');
|
|
69
|
-
}
|
|
70
|
-
// Modify source id
|
|
71
|
-
this.exporter.moveBlueprintSource(oldSourceId, newSourceId, newPath);
|
|
72
|
-
return source;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.PLSPulsarSourceManager = PLSPulsarSourceManager;
|
|
76
|
-
//# sourceMappingURL=PulsarBlueprintManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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M,CAAC,CAAC;QACrC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,qEAAqE;IACrE,gBAAgB,CAAC,QAAgB;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACvC,MAAM,KAAK,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,uLAAuL;IACvL,oBAAoB,CAClB,WAAmB,EACnB,WAAmB,EACnB,OAAe;QAEf,kBAAkB;QAClB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,KAAK,CAAC,6BAA6B,WAAW,EAAE,CAAC,CAAC;SACzD;QAED,IAAI,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,KAAK,CAAC,2CAA2C,CAAC,CAAC;SAC1D;QAED,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;YACvC,MAAM,KAAK,CACT,mEAAmE,CACpE,CAAC;SACH;QAED,mBAAmB;QACnB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnFD,wDAmFC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PLSExporter } from './../../model/exporters/Exporter';
|
|
2
|
-
import { PLSEngineExporterProcessingResult } from '../PulsarInterface';
|
|
3
|
-
import { DSMReferenceStore } from './../../model/dsm/DSMReferenceStore';
|
|
4
|
-
import { DSMBridgeConfiguration } from '@supernova-studio/pulsar-language';
|
|
5
|
-
import { PLSPulsarExporterMode } from '../Pulsar';
|
|
6
|
-
export declare class PLSPulsarCIManager {
|
|
7
|
-
private exporter;
|
|
8
|
-
private currentExporterInstance;
|
|
9
|
-
constructor(exporter: PLSExporter);
|
|
10
|
-
/** Execute entire exporter and retrieve all files produced as a result of this export */
|
|
11
|
-
executeExporter(dsmBridgeConfig: DSMBridgeConfiguration, exportMode: PLSPulsarExporterMode): Promise<PLSEngineExporterProcessingResult>;
|
|
12
|
-
/** Execute entire exporter and retrieve all files produced as a result of this export */
|
|
13
|
-
executeExporterForSingleSandboxedComponent(dsmBridgeConfig: DSMBridgeConfiguration, exportMode: PLSPulsarExporterMode, sandboxComponentId: string, serializedSandboxData: string): Promise<PLSEngineExporterProcessingResult>;
|
|
14
|
-
/** Retrieve intermediate output of exporter in progress */
|
|
15
|
-
retrieveRunningExporterState(): PLSEngineExporterProcessingResult | null;
|
|
16
|
-
/** Get reference store containing description of all elements in the DSM, including all context categories */
|
|
17
|
-
getDSMContextStore(dsmBridgeConfig: DSMBridgeConfiguration): Promise<DSMReferenceStore>;
|
|
18
|
-
private convertExportResultToPulsarResult;
|
|
19
|
-
private parseName;
|
|
20
|
-
fetchReferenceStore(dsmBridgeConfig: DSMBridgeConfiguration): Promise<DSMReferenceStore>;
|
|
21
|
-
static fetchReferenceStoreStatic(dsmBridgeConfig: DSMBridgeConfiguration): Promise<DSMReferenceStore>;
|
|
22
|
-
fetchReferenceStoreForSandboxedComponent(componentId: string): Promise<DSMReferenceStore>;
|
|
23
|
-
private computeRootFileGroupFromFiles;
|
|
24
|
-
private pathPermutations;
|
|
25
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// PulsarCIManager.ts
|
|
4
|
-
// Supernova
|
|
5
|
-
//
|
|
6
|
-
// Created by Jiri Trecak.
|
|
7
|
-
// Copyright © 2020 Jiri Trecak. All rights reserved.
|
|
8
|
-
//
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PLSPulsarCIManager = void 0;
|
|
11
|
-
const PulsarInterface_1 = require("../PulsarInterface");
|
|
12
|
-
const DSMReferenceStore_1 = require("./../../model/dsm/DSMReferenceStore");
|
|
13
|
-
const Logger_1 = require("./../../tools/Logger");
|
|
14
|
-
const ExportConfiguration_1 = require("./../../engine/configuration/ExportConfiguration");
|
|
15
|
-
const ExportEngine_1 = require("./../../engine/ExportEngine");
|
|
16
|
-
const pulsar_language_1 = require("@supernova-studio/pulsar-language");
|
|
17
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
18
|
-
// MARK: - Definitions
|
|
19
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
20
|
-
// MARK: - Class
|
|
21
|
-
class PLSPulsarCIManager {
|
|
22
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
23
|
-
// MARK: - Setup
|
|
24
|
-
constructor(exporter) {
|
|
25
|
-
this.exporter = exporter;
|
|
26
|
-
this.currentExporterInstance = null;
|
|
27
|
-
}
|
|
28
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
29
|
-
// MARK: - CI support
|
|
30
|
-
/** Execute entire exporter and retrieve all files produced as a result of this export */
|
|
31
|
-
async executeExporter(dsmBridgeConfig, exportMode) {
|
|
32
|
-
// Fetch the reference store containing description of the entire dsm, with all its elements
|
|
33
|
-
let store = await this.fetchReferenceStore(dsmBridgeConfig);
|
|
34
|
-
// Configure export engine
|
|
35
|
-
let logger = new Logger_1.PLSLogger();
|
|
36
|
-
let configuration = new ExportConfiguration_1.PLSExportConfiguration(this.exporter, logger, store, dsmBridgeConfig, exportMode, {});
|
|
37
|
-
let pulsarEngine = new ExportEngine_1.PLSExportEngine(configuration);
|
|
38
|
-
this.currentExporterInstance = pulsarEngine;
|
|
39
|
-
// Run the export and wait for results, processing all blueprints against all file maps
|
|
40
|
-
let result = await pulsarEngine.processExport();
|
|
41
|
-
// Convert results and ditch the current export instance
|
|
42
|
-
let convertedResult = this.convertExportResultToPulsarResult(result, this.currentExporterInstance);
|
|
43
|
-
this.currentExporterInstance;
|
|
44
|
-
return convertedResult;
|
|
45
|
-
}
|
|
46
|
-
/** Execute entire exporter and retrieve all files produced as a result of this export */
|
|
47
|
-
async executeExporterForSingleSandboxedComponent(dsmBridgeConfig, exportMode, sandboxComponentId, serializedSandboxData) {
|
|
48
|
-
// Fetch the reference store containing description of the entire dsm, with all its elements
|
|
49
|
-
let store = await this.fetchReferenceStoreForSandboxedComponent(sandboxComponentId);
|
|
50
|
-
// Configure export engine
|
|
51
|
-
let logger = new Logger_1.PLSLogger();
|
|
52
|
-
let sandboxData = JSON.parse(serializedSandboxData);
|
|
53
|
-
let configuration = new ExportConfiguration_1.PLSExportConfiguration(this.exporter, logger, store, dsmBridgeConfig, exportMode, sandboxData);
|
|
54
|
-
let pulsarEngine = new ExportEngine_1.PLSExportEngine(configuration);
|
|
55
|
-
this.currentExporterInstance = pulsarEngine;
|
|
56
|
-
// Run the export and wait for results, processing all blueprints against all file maps
|
|
57
|
-
let result = await pulsarEngine.processExport();
|
|
58
|
-
// Convert results and ditch the current export instance
|
|
59
|
-
let convertedResult = this.convertExportResultToPulsarResult(result, this.currentExporterInstance);
|
|
60
|
-
this.currentExporterInstance;
|
|
61
|
-
return convertedResult;
|
|
62
|
-
}
|
|
63
|
-
/** Retrieve intermediate output of exporter in progress */
|
|
64
|
-
retrieveRunningExporterState() {
|
|
65
|
-
if (this.currentExporterInstance !== null) {
|
|
66
|
-
let store = this.currentExporterInstance.configuration.outputStore;
|
|
67
|
-
return this.convertExportResultToPulsarResult(store, this.currentExporterInstance);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/** Get reference store containing description of all elements in the DSM, including all context categories */
|
|
74
|
-
async getDSMContextStore(dsmBridgeConfig) {
|
|
75
|
-
return this.fetchReferenceStore(dsmBridgeConfig);
|
|
76
|
-
}
|
|
77
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
78
|
-
// MARK: - Context
|
|
79
|
-
convertExportResultToPulsarResult(sourceStore, exportEngine) {
|
|
80
|
-
let files = new Array();
|
|
81
|
-
for (let [path, partialResult] of sourceStore.dataStore.entries()) {
|
|
82
|
-
if (typeof partialResult === 'string') {
|
|
83
|
-
let pathDescriptor = this.parseName(path);
|
|
84
|
-
let fileDescriptor = {
|
|
85
|
-
name: pathDescriptor.fullname,
|
|
86
|
-
path: pathDescriptor.path,
|
|
87
|
-
content: partialResult,
|
|
88
|
-
type: 'string',
|
|
89
|
-
source: 'primary' // TODO: Decide whether it is a main invoked file or emitted
|
|
90
|
-
};
|
|
91
|
-
files.push(fileDescriptor);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
throw new Error('Unsupported type of produced file for write');
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
exporterId: this.exporter.id,
|
|
99
|
-
runId: exportEngine.runId,
|
|
100
|
-
emittedFiles: files,
|
|
101
|
-
state: PulsarInterface_1.PLSEngineExporterState.finished_success,
|
|
102
|
-
rootGroup: this.computeRootFileGroupFromFiles(files)
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
parseName(fullPath) {
|
|
106
|
-
// Only retrieve files that are .blazar or .json
|
|
107
|
-
// Modify filename by removing the first directory
|
|
108
|
-
let components = fullPath.split('/');
|
|
109
|
-
// Extract filename, extension and paths
|
|
110
|
-
let filename = components[components.length - 1];
|
|
111
|
-
let fullpath = components.join('/');
|
|
112
|
-
// Extract directory
|
|
113
|
-
components.pop();
|
|
114
|
-
let directory = components.join('/');
|
|
115
|
-
// Get extension and check whether it is correct format
|
|
116
|
-
let nameParts = filename.split('.');
|
|
117
|
-
let extension;
|
|
118
|
-
let name;
|
|
119
|
-
if (nameParts.length >= 2) {
|
|
120
|
-
extension = nameParts[nameParts.length - 1];
|
|
121
|
-
nameParts.pop();
|
|
122
|
-
name = nameParts.join('.');
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
throw Error('Unable to properly parse output file');
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
fullname: filename,
|
|
129
|
-
name: name,
|
|
130
|
-
extension: extension,
|
|
131
|
-
folder: directory,
|
|
132
|
-
path: fullpath
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
async fetchReferenceStore(dsmBridgeConfig) {
|
|
136
|
-
let dsmBridge = new pulsar_language_1.DSMBridge(dsmBridgeConfig);
|
|
137
|
-
let result = await dsmBridge.getDSMDataFromEndpoint('bff/structure', null);
|
|
138
|
-
// Construct store from the result
|
|
139
|
-
let store = new DSMReferenceStore_1.DSMReferenceStore(result);
|
|
140
|
-
return store;
|
|
141
|
-
}
|
|
142
|
-
static async fetchReferenceStoreStatic(dsmBridgeConfig) {
|
|
143
|
-
let dsmBridge = new pulsar_language_1.DSMBridge(dsmBridgeConfig);
|
|
144
|
-
let result = await dsmBridge.getDSMDataFromEndpoint('bff/structure', null);
|
|
145
|
-
// Construct store from the result
|
|
146
|
-
let store = new DSMReferenceStore_1.DSMReferenceStore(result);
|
|
147
|
-
return store;
|
|
148
|
-
}
|
|
149
|
-
async fetchReferenceStoreForSandboxedComponent(componentId) {
|
|
150
|
-
// Construct store from the result
|
|
151
|
-
let store = new DSMReferenceStore_1.DSMReferenceStore({
|
|
152
|
-
components: [{ id: componentId, name: 'Sandboxed Component' }],
|
|
153
|
-
componentGroups: [],
|
|
154
|
-
tokenGroups: [],
|
|
155
|
-
tokenTypes: [],
|
|
156
|
-
themes: []
|
|
157
|
-
});
|
|
158
|
-
return store;
|
|
159
|
-
}
|
|
160
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
161
|
-
// MARK: - File group computing
|
|
162
|
-
computeRootFileGroupFromFiles(files) {
|
|
163
|
-
// Create root group to which everything goes
|
|
164
|
-
let rootGroup = new PulsarInterface_1.PLSEngineFileGroup('Root', '/', [], []);
|
|
165
|
-
let subgroups = new Map();
|
|
166
|
-
let currentParent = rootGroup;
|
|
167
|
-
for (let file of files) {
|
|
168
|
-
// Assign current parent as root
|
|
169
|
-
currentParent = rootGroup;
|
|
170
|
-
// Compute all subpaths leading to certain path, for example path like /root/sub/sub will return following:
|
|
171
|
-
// /root
|
|
172
|
-
// /root/sub
|
|
173
|
-
// /root/sub/sub
|
|
174
|
-
let permutations = this.pathPermutations(file.path);
|
|
175
|
-
if (permutations.length === 0) {
|
|
176
|
-
// Assuming no directories, it belongs to the root group
|
|
177
|
-
rootGroup.files.push(file);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
// With directories, we go through each one, create it and we also create subgroup and link them proprly together
|
|
181
|
-
// File is added to the last group
|
|
182
|
-
for (let [index, permutation] of permutations.entries()) {
|
|
183
|
-
let group = subgroups.get(permutation.path);
|
|
184
|
-
if (group) {
|
|
185
|
-
// Group exists, we do nothing except moving parent
|
|
186
|
-
currentParent = group;
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
// Group doesn't exist, we create one, assign it to parent and buffer
|
|
190
|
-
group = new PulsarInterface_1.PLSEngineFileGroup(permutation.lastComponent, permutation.path, [], []);
|
|
191
|
-
currentParent.groups.push(group);
|
|
192
|
-
subgroups.set(permutation.path, group);
|
|
193
|
-
}
|
|
194
|
-
if (index === permutations.length - 1) {
|
|
195
|
-
// For last permutation, we add the file to it
|
|
196
|
-
group.files.push(file);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return rootGroup;
|
|
202
|
-
}
|
|
203
|
-
pathPermutations(path) {
|
|
204
|
-
// Path always contains filename in our case, so we remove it
|
|
205
|
-
let pathComponents = path.split('/');
|
|
206
|
-
pathComponents.pop();
|
|
207
|
-
let buffer = new Array();
|
|
208
|
-
let stringBuffer = '';
|
|
209
|
-
for (let component of pathComponents) {
|
|
210
|
-
stringBuffer += `/${component}`;
|
|
211
|
-
buffer.push({
|
|
212
|
-
path: stringBuffer,
|
|
213
|
-
lastComponent: component
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return buffer;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
exports.PLSPulsarCIManager = PLSPulsarCIManager;
|
|
220
|
-
//# sourceMappingURL=PulsarCIManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PulsarCIManager.js","sourceRoot":"","sources":["../../../../src/pulsar/managers/PulsarCIManager.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,sBAAsB;AACtB,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAMF,wDAK4B;AAE5B,2EAAwE;AACxE,iDAAiD;AACjD,0FAA0F;AAC1F,8DAA8D;AAC9D,uEAG2C;AAG3C,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,kBAAkB;IAO7B,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,QAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACtC,CAAC;IAED,8GAA8G;IAC9G,qBAAqB;IAErB,yFAAyF;IACzF,KAAK,CAAC,eAAe,CACnB,eAAuC,EACvC,UAAiC;QAEjC,4FAA4F;QAC5F,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;QAE5D,0BAA0B;QAC1B,IAAI,MAAM,GAAG,IAAI,kBAAS,EAAE,CAAC;QAC7B,IAAI,aAAa,GAAG,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c,EAAE;YACpC,YAAY,IAAI,IAAI,SAAS,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,SAAS;aACzB,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxSD,gDAwSC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PLSExporter } from './../../model/exporters/Exporter';
|
|
2
|
-
import { BLZBlueprint, DSMExecutionContext, BLZHighlightEngineToken, DSMBridgeConfiguration } from '@supernova-studio/pulsar-language';
|
|
3
|
-
import { BLZAutocompleteEngineApplicationResult, BLZAutocompleteEngineSuggestion } from '@supernova-studio/pulsar-language/build/main/tools/autocomplete/AutocompleteEngine';
|
|
4
|
-
import { PLSEngineSourceProcessingResult } from './../PulsarInterface';
|
|
5
|
-
export declare class PLSPulsarCodeManager {
|
|
6
|
-
private exporter;
|
|
7
|
-
private codeExecutionContext;
|
|
8
|
-
constructor(exporter: PLSExporter);
|
|
9
|
-
/** Execute source code and retrieve the resulting output. This also retrieves any emitted extra files. Throws error when source is not found */
|
|
10
|
-
executeSourceById(sourceId: string, dsmBridgeConfig: DSMBridgeConfiguration, contextKey: string, contextId: string): Promise<PLSEngineSourceProcessingResult>;
|
|
11
|
-
/** Update source code definition. Content can be anything */
|
|
12
|
-
updateSourceCodeDefinitionForSourceId(sourceId: string, definition: string): void;
|
|
13
|
-
/** Update source code definition. Overview can be empty. Throws error when source is not found */
|
|
14
|
-
updateSourceLocation(oldSourceId: string, newSourceId: string, newPath: string): void;
|
|
15
|
-
/** Suggest next characters, words or snippets to be inserted into blazar code as user types */
|
|
16
|
-
suggestNextFromSourceCode(code: string, selectionLocation: number, selectionLength: number): Array<BLZAutocompleteEngineSuggestion>;
|
|
17
|
-
/** Apply autocompletion result to specified blazar code */
|
|
18
|
-
applyAutocompletionResultToCode(code: string, selectionLocation: number, selectionLength: number, apply: BLZAutocompleteEngineSuggestion): BLZAutocompleteEngineApplicationResult;
|
|
19
|
-
/** Compute highlight tokens for the provided blazar code */
|
|
20
|
-
suggestHighlightFromSourceCode(code: string): Array<BLZHighlightEngineToken>;
|
|
21
|
-
createContextData(contextKey: string, contextId: string): Map<string, any>;
|
|
22
|
-
parseSource(declaration: string, executionContext: DSMExecutionContext): Promise<BLZBlueprint>;
|
|
23
|
-
interpretSource(source: BLZBlueprint, data: Map<string, any>, executionContext: DSMExecutionContext): Promise<string>;
|
|
24
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// PulsarCodeManager.ts
|
|
4
|
-
// Supernova
|
|
5
|
-
//
|
|
6
|
-
// Created by Jiri Trecak.
|
|
7
|
-
// Copyright © 2020 Jiri Trecak. All rights reserved.
|
|
8
|
-
//
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PLSPulsarCodeManager = void 0;
|
|
11
|
-
const Logger_1 = require("@supernova-studio/pulsar-language/build/main/interpreter/loggers/Logger");
|
|
12
|
-
const BlueprintLoader_1 = require("./../../engine/loaders/BlueprintLoader");
|
|
13
|
-
const pulsar_language_1 = require("@supernova-studio/pulsar-language");
|
|
14
|
-
const BlueprintLoader_2 = require("@supernova-studio/pulsar-language/build/main/interpreter/loaders/BlueprintLoader");
|
|
15
|
-
const ExporterSource_1 = require("../../model/sources/ExporterSource");
|
|
16
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
-
// MARK: - Definitions
|
|
18
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
19
|
-
// MARK: - Class
|
|
20
|
-
class PLSPulsarCodeManager {
|
|
21
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
22
|
-
// MARK: - Setup
|
|
23
|
-
constructor(exporter) {
|
|
24
|
-
this.exporter = exporter;
|
|
25
|
-
// Context is not usable for actual execution, but provides data about all types of functions / flows etc. available in the system
|
|
26
|
-
this.codeExecutionContext = new pulsar_language_1.DSMExecutionContext(new BlueprintLoader_2.BLZBlueprintLoader(), new pulsar_language_1.BLZBlueprintEmitter(), new Logger_1.BLZLogger(), new pulsar_language_1.DSMBridge({
|
|
27
|
-
accessToken: '',
|
|
28
|
-
apiUrl: '',
|
|
29
|
-
designSystemId: '',
|
|
30
|
-
dsVersionId: '',
|
|
31
|
-
apiVersion: '0.2'
|
|
32
|
-
}), null);
|
|
33
|
-
}
|
|
34
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
35
|
-
// MARK: - Code editor
|
|
36
|
-
/** Execute source code and retrieve the resulting output. This also retrieves any emitted extra files. Throws error when source is not found */
|
|
37
|
-
async executeSourceById(sourceId, dsmBridgeConfig, contextKey, contextId) {
|
|
38
|
-
//
|
|
39
|
-
// Find the source
|
|
40
|
-
let source = this.exporter.sourceById(sourceId);
|
|
41
|
-
if (!source) {
|
|
42
|
-
throw Error(`Unknown source to execute ${sourceId}`);
|
|
43
|
-
}
|
|
44
|
-
// Create context data
|
|
45
|
-
let contextData = this.createContextData(contextKey, contextId);
|
|
46
|
-
// Create execution context for the DSM access, with in-memory loaders and emitters
|
|
47
|
-
let logger = new Logger_1.BLZLogger();
|
|
48
|
-
let loader = new BlueprintLoader_1.PLSBlueprintLoader(this.exporter);
|
|
49
|
-
let emitter = new pulsar_language_1.BLZMemoryBlueprintEmitter(false);
|
|
50
|
-
let configuredBridge = new pulsar_language_1.DSMBridge(dsmBridgeConfig);
|
|
51
|
-
let executionContext = new pulsar_language_1.DSMExecutionContext(loader, emitter, logger, configuredBridge, null);
|
|
52
|
-
// Parse sources using custom context with dsm functionality and execute
|
|
53
|
-
let parsedSource = await this.parseSource(source.content, executionContext);
|
|
54
|
-
let interpretedResult = await this.interpretSource(parsedSource, contextData, executionContext);
|
|
55
|
-
// Generate file pack. In case of generated source, one file will be produced as primary and there can be additional files based on emitted content
|
|
56
|
-
let producedPrimaryFile = {
|
|
57
|
-
name: 'Main',
|
|
58
|
-
path: '',
|
|
59
|
-
content: interpretedResult,
|
|
60
|
-
source: 'primary',
|
|
61
|
-
type: 'string'
|
|
62
|
-
};
|
|
63
|
-
let producedEmittedFiles = new Array();
|
|
64
|
-
for (let emittedResult of emitter.allEmittedContent()) {
|
|
65
|
-
let producedEmittedFile = {
|
|
66
|
-
name: emittedResult.filename,
|
|
67
|
-
path: '',
|
|
68
|
-
content: emittedResult.content,
|
|
69
|
-
source: 'emitter',
|
|
70
|
-
type: 'string'
|
|
71
|
-
};
|
|
72
|
-
producedEmittedFiles.push(producedEmittedFile);
|
|
73
|
-
}
|
|
74
|
-
// Construct all information into result
|
|
75
|
-
return {
|
|
76
|
-
sourceId: sourceId,
|
|
77
|
-
producedContent: [producedPrimaryFile, ...producedEmittedFiles],
|
|
78
|
-
logger: logger
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/** Update source code definition. Content can be anything */
|
|
82
|
-
updateSourceCodeDefinitionForSourceId(sourceId, definition) {
|
|
83
|
-
// Find the source
|
|
84
|
-
let source = this.exporter.sourceById(sourceId);
|
|
85
|
-
if (!source) {
|
|
86
|
-
throw Error(`Unknown source to update ${sourceId}`);
|
|
87
|
-
}
|
|
88
|
-
// Update the source definition. Note that even invalid definition should be saved, so we don't validate
|
|
89
|
-
source.content = definition;
|
|
90
|
-
}
|
|
91
|
-
/** Update source code definition. Overview can be empty. Throws error when source is not found */
|
|
92
|
-
updateSourceLocation(oldSourceId, newSourceId, newPath) {
|
|
93
|
-
// Find the source
|
|
94
|
-
let source = this.exporter.sourceById(oldSourceId);
|
|
95
|
-
if (!source) {
|
|
96
|
-
throw Error(`Unknown source to update ${oldSourceId}`);
|
|
97
|
-
}
|
|
98
|
-
// Move it
|
|
99
|
-
this.exporter.moveBlueprintSource(oldSourceId, newSourceId, newPath);
|
|
100
|
-
}
|
|
101
|
-
/** Suggest next characters, words or snippets to be inserted into blazar code as user types */
|
|
102
|
-
suggestNextFromSourceCode(code, selectionLocation, selectionLength) {
|
|
103
|
-
let suggestionEngine = new pulsar_language_1.BLZBlueprintAutocompleteEngine(this.codeExecutionContext);
|
|
104
|
-
suggestionEngine.loadSnippets(new pulsar_language_1.BLZAutocompleteBlueprintSnippets().snippetPool());
|
|
105
|
-
let suggestions = suggestionEngine.suggestNextBasedOnString(code, selectionLocation, selectionLength);
|
|
106
|
-
return suggestions;
|
|
107
|
-
}
|
|
108
|
-
/** Apply autocompletion result to specified blazar code */
|
|
109
|
-
applyAutocompletionResultToCode(code, selectionLocation, selectionLength, apply) {
|
|
110
|
-
let suggestionEngine = new pulsar_language_1.BLZBlueprintAutocompleteEngine(this.codeExecutionContext);
|
|
111
|
-
let result = suggestionEngine.applySuggestion(apply, code, selectionLocation, selectionLength, 0);
|
|
112
|
-
return result;
|
|
113
|
-
}
|
|
114
|
-
/** Compute highlight tokens for the provided blazar code */
|
|
115
|
-
suggestHighlightFromSourceCode(code) {
|
|
116
|
-
let suggestionEngine = new pulsar_language_1.BLZBlueprintHighlightEngine(this.codeExecutionContext);
|
|
117
|
-
let result = suggestionEngine.tokenize(code);
|
|
118
|
-
return result;
|
|
119
|
-
}
|
|
120
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
121
|
-
// MARK: - Context
|
|
122
|
-
createContextData(contextKey, contextId) {
|
|
123
|
-
let data = new Map();
|
|
124
|
-
if (contextId === 'none') {
|
|
125
|
-
if (contextKey === ExporterSource_1.PLSExporterSourceContextType.generic) {
|
|
126
|
-
return data;
|
|
127
|
-
}
|
|
128
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.component) {
|
|
129
|
-
throw new Error('Source with component context can only be tested against design system with one or more defined components. Create new component and run this source again.');
|
|
130
|
-
}
|
|
131
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.componentGroup) {
|
|
132
|
-
throw new Error('Source with component group context can only be tested against design system with one or more defined component groups. Create new component group and run this source again.');
|
|
133
|
-
}
|
|
134
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.tokenType) {
|
|
135
|
-
throw new Error('Source with token type context can only be tested against design system with one or more token types. Create new token and run this source again.');
|
|
136
|
-
}
|
|
137
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.tokenGroup) {
|
|
138
|
-
throw new Error('Source with token group context can only be tested against design system with one or more defined token groups. Create new token group and run this source again.');
|
|
139
|
-
}
|
|
140
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.theme) {
|
|
141
|
-
throw new Error('Source with theme context can only be tested against design system with one or more defined themes. Create new theme and run this source again.');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
if (contextKey === ExporterSource_1.PLSExporterSourceContextType.generic) {
|
|
146
|
-
// Generic ignores context id
|
|
147
|
-
return data;
|
|
148
|
-
}
|
|
149
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.component) {
|
|
150
|
-
data.set('componentId', contextId);
|
|
151
|
-
}
|
|
152
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.componentGroup) {
|
|
153
|
-
data.set('groupId', contextId);
|
|
154
|
-
}
|
|
155
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.tokenType) {
|
|
156
|
-
data.set('tokenTypeId', contextId);
|
|
157
|
-
}
|
|
158
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.tokenGroup) {
|
|
159
|
-
data.set('groupId', contextId);
|
|
160
|
-
}
|
|
161
|
-
else if (contextKey === ExporterSource_1.PLSExporterSourceContextType.theme) {
|
|
162
|
-
data.set('themeId', contextId);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return data;
|
|
166
|
-
}
|
|
167
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
168
|
-
// MARK: - Convenience
|
|
169
|
-
async parseSource(declaration, executionContext) {
|
|
170
|
-
let source = pulsar_language_1.BLZBlueprintFactory.blueprint(declaration, 'test', executionContext, null);
|
|
171
|
-
return source;
|
|
172
|
-
}
|
|
173
|
-
async interpretSource(source, data, executionContext) {
|
|
174
|
-
let renderingContext = new pulsar_language_1.BLZInterpreterContext(data);
|
|
175
|
-
let interpreter = new pulsar_language_1.BLZInterpreter();
|
|
176
|
-
return interpreter.interpret(source, renderingContext, executionContext);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.PLSPulsarCodeManager = PLSPulsarCodeManager;
|
|
180
|
-
//# sourceMappingURL=PulsarCodeManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PulsarCodeManager.js","sourceRoot":"","sources":["../../../../src/pulsar/managers/PulsarCodeManager.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,wBAAwB;AACxB,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAMF,oGAAoG;AACpG,4EAA4E;AAC5E,uEAc2C;AAK3C,sHAAsH;AAKtH,uEAAkF;AAElF,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,oBAAoB;IAO/B,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,QAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,kIAAkI;QAClI,IAAI,CAAC,oBAAoB,GAAG,IAAI,qCAAmB,CACjD,IAAI,oCAAkB,EAAE,EACxB,IAAI,qCAAmB,EAAE,EACzB,IAAI,kBAAS,EAAE,EACf,IAAI,2BAAS,CAAC;YACZ,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,EAAE;YAClB,WAAW,EAAE,EAA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K,CAAC,WAAW,CACf,WAAmB,EACnB,gBAAqC;QAErC,IAAI,MAAM,GAAG,qCAAmB,CAAC,SAAS,CACxC,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,IAAI,CACL,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAoB,EACpB,IAAsB,EACtB,gBAAqC;QAErC,IAAI,gBAAgB,GAAG,IAAI,uCAAqB,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,WAAW,GAAG,IAAI,gCAAc,EAAE,CAAC;QACvC,OAAO,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAC3E,CAAC;CACF;AA9PD,oDA8PC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PLSExporter } from '../../model/exporters/Exporter';
|
|
2
|
-
export declare class PLSPulsarConfigurationManager {
|
|
3
|
-
constructor(_exporter: PLSExporter);
|
|
4
|
-
/** Get exporter configuration JSON */
|
|
5
|
-
getExporterConfigurationJSON(): string;
|
|
6
|
-
/** Get source configuration JSON */
|
|
7
|
-
getSourceConfigurationJSON(): string;
|
|
8
|
-
/** Get output configuration JSON */
|
|
9
|
-
getOutputConfigurationJSON(): string;
|
|
10
|
-
/** Update exporter configuration JSON */
|
|
11
|
-
updateExporterConfigurationJSON(_content: string): void;
|
|
12
|
-
/** Update source configuration JSON */
|
|
13
|
-
updateSourceConfigurationJSON(_content: string): void;
|
|
14
|
-
/** Update output configuration JSON */
|
|
15
|
-
updateOutputConfigurationJSON(_content: string): void;
|
|
16
|
-
}
|