Skip to content

Commit ea8a7cb

Browse files
committed
configuring build (WIP)
1 parent b243bc8 commit ea8a7cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+607
-992
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"--extensionDevelopmentPath=${workspaceFolder}/extension"
1515
],
1616
"outFiles": [
17-
"${workspaceFolder}/extension/pack/**/*.js"
17+
"${workspaceFolder}/extension/pack/**/*.cjs"
1818
],
1919
"sourceMaps": true
2020
},
@@ -27,7 +27,7 @@
2727
],
2828
"sourceMaps": true,
2929
"outFiles": [
30-
"${workspaceFolder}/extension/pack/src-language-server/main.cjs"
30+
"${workspaceFolder}/extension/pack/src-language-server/*.cjs"
3131
],
3232
"sourceMapPathOverrides": {
3333
"meteor://💻app/*": "${workspaceFolder}/*",

extension/esbuild.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ const nodeContext = await esbuild.context({
4545
});
4646

4747
const browserContext = await esbuild.context({
48-
entryPoints: ['src-webview/main.ts'],
49-
outdir: 'pack/webview',
48+
entryPoints: [
49+
'src-webview/main.ts',
50+
'src-diagram-snippets/main.ts',
51+
'src-context-table/main.ts',
52+
],
53+
outdir: 'pack',
5054
bundle: true,
5155
target: 'es6',
5256
loader: { '.ts': 'ts', '.css': 'css' },

extension/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,14 @@
535535
"onCommand:pasta.getLTLFormula"
536536
],
537537
"files": [
538-
"lib",
539538
"extension",
540-
"server",
539+
"src",
540+
"src-context-table",
541+
"src-diagram-snippets",
542+
"src-language-server",
541543
"syntaxes",
542-
"webview"
544+
"src-webview",
545+
"pack"
543546
],
544547
"main": "./pack/src/extension.cjs",
545548
"dependencies": {
@@ -574,13 +577,14 @@
574577
"ovsx": "^0.6.0",
575578
"esbuild": "^0.21.2"
576579
},
580+
"type": "module",
577581
"scripts": {
578582
"prepare": "yarn run clean && yarn run langium:generate && yarn run build",
579583
"clean": "rimraf pack",
580584
"langium:generate": "langium generate",
581585
"langium:watch": "langium generate --watch",
582586
"lint": "eslint .",
583-
"build": "yarn run langium:generate && node esbuild.mjs",
587+
"build": "yarn run langium:generate && tsc -b tsconfig.json && node esbuild.mjs",
584588
"watch": "webpack --watch",
585589
"package": "vsce package --yarn -o pasta.vsix",
586590
"predistribute": "yarn run package",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2017",
5+
"outDir": "pack",
6+
"lib": ["ESNext", "dom"],
7+
"jsx": "react",
8+
"jsxFactory": "jsx",
9+
"sourceMap": true,
10+
"rootDir": "src",
11+
"strict": true, // enable all strict type-checking options
12+
"resolveJsonModule": true, // Allow importing JSON files
13+
"moduleResolution": "Node16",
14+
"esModuleInterop": true,
15+
/* Additional Checks */
16+
"strictPropertyInitialization": false, // No need to initialize every variable
17+
"declaration": false,
18+
"noImplicitAny": false,
19+
"noEmitOnError": true,
20+
"noImplicitThis": true,
21+
"strictNullChecks": true,
22+
"experimentalDecorators": true,
23+
"emitDecoratorMetadata": true,
24+
"skipLibCheck": true,
25+
},
26+
// "include": ["src"],
27+
"exclude": ["node_modules", ".vscode-test", "pack"]
28+
}

extension/src-diagram-snippets/jsx.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ declare global {
2424
namespace JSX {
2525
// Based on the tag list in github:DefinitelyTyped/DefinitelyTyped:React
2626
interface IntrinsicElements {
27-
[elemName: string]: VNodeData;
27+
// TODO: check whether this can be deleted or not
28+
// [elemName: string]: VNodeData;
2829
}
2930
}
3031
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2017",
5+
"outDir": "pack",
6+
"lib": ["ESNext", "dom"],
7+
"jsx": "react",
8+
"jsxFactory": "jsx",
9+
"sourceMap": true,
10+
"rootDir": "src",
11+
"strict": true, // enable all strict type-checking options
12+
"resolveJsonModule": true, // Allow importing JSON files
13+
"moduleResolution": "Node16",
14+
"esModuleInterop": true,
15+
/* Additional Checks */
16+
"strictPropertyInitialization": false, // No need to initialize every variable
17+
"declaration": false,
18+
"noImplicitAny": false,
19+
"noEmitOnError": true,
20+
"noImplicitThis": true,
21+
"strictNullChecks": true,
22+
"experimentalDecorators": true,
23+
"emitDecoratorMetadata": true,
24+
"skipLibCheck": true,
25+
},
26+
// "include": ["src"],
27+
"exclude": ["node_modules", ".vscode-test", "pack"]
28+
}

extension/src-language-server/diagram-server.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
import { Action, DiagramServices, JsonMap, RequestAction, RequestModelAction, ResponseAction } from "sprotty-protocol";
1919
import { Connection } from "vscode-languageserver";
20-
import { FtaServices } from "./fta/fta-module";
21-
import { SetSynthesisOptionsAction, UpdateOptionsAction } from "./options/actions";
22-
import { DropDownOption } from "./options/option-models";
23-
import { SnippetDiagramServer } from "./snippets/snippet-diagram-server";
24-
import { LanguageSnippet } from "./snippets/snippet-model";
25-
import { StpaDiagramSnippets } from "./snippets/stpa-snippets";
26-
import { GenerateSVGsAction, RequestSvgAction, SvgAction, UpdateDiagramAction } from "./stpa/actions";
27-
import { StpaSynthesisOptions, filteringUCAsID } from "./stpa/diagram/stpa-synthesis-options";
20+
import { FtaServices } from "./fta/fta-module.js";
21+
import { SetSynthesisOptionsAction, UpdateOptionsAction } from "./options/actions.js";
22+
import { DropDownOption } from "./options/option-models.js";
23+
import { SnippetDiagramServer } from "./snippets/snippet-diagram-server.js";
24+
import { LanguageSnippet } from "./snippets/snippet-model.js";
25+
import { StpaDiagramSnippets } from "./snippets/stpa-snippets.js";
26+
import { GenerateSVGsAction, RequestSvgAction, SvgAction, UpdateDiagramAction } from "./stpa/actions.js";
27+
import { StpaSynthesisOptions, filteringUCAsID } from "./stpa/diagram/stpa-synthesis-options.js";
2828
import {
2929
COMPLETE_GRAPH_PATH,
3030
CONTROL_STRUCTURE_PATH,
@@ -49,9 +49,9 @@ import {
4949
setScenarioWithFilteredUCAGraphOptions,
5050
setScenarioWithNoUCAGraphOptions,
5151
setSystemConstraintGraphOptions,
52-
} from "./stpa/result-report/svg-generator";
53-
import { StpaServices } from "./stpa/stpa-module";
54-
import { SynthesisOptions } from "./synthesis-options";
52+
} from "./stpa/result-report/svg-generator.js";
53+
import { StpaServices } from "./stpa/stpa-module.js";
54+
import { SynthesisOptions } from "./synthesis-options.js";
5555

5656
export class PastaDiagramServer extends SnippetDiagramServer {
5757
protected synthesisOptions: SynthesisOptions | undefined;

extension/src-language-server/fta/analysis/fta-cutSet-calculator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import {
2626
isKNGate,
2727
isOR,
2828
isTopEvent,
29-
} from "../../generated/ast";
30-
import { namedFtaElement } from "../utils";
29+
} from "../../generated/ast.js";
30+
import { namedFtaElement } from "../utils.js";
3131

3232
/* element for which the cut sets were determined */
3333
export let topOfAnalysis: string | undefined;

extension/src-language-server/fta/diagram/fta-diagram-generator.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
import { AstNode } from "langium";
1919
import { GeneratorContext, IdCache, LangiumDiagramGenerator } from "langium-sprotty";
2020
import { SModelElement, SModelRoot, SNode, SLabel } from "sprotty-protocol";
21-
import { Component, Condition, Gate, ModelFTA, isComponent, isCondition, isKNGate } from "../../generated/ast";
22-
import { getDescription } from "../../utils";
23-
import { topOfAnalysis } from "../analysis/fta-cutSet-calculator";
24-
import { FtaServices } from "../fta-module";
25-
import { namedFtaElement } from "../utils";
26-
import { DescriptionNode, FTAEdge, FTAGraph, FTANode, FTAPort } from "./fta-interfaces";
21+
import { Component, Condition, Gate, ModelFTA, isComponent, isCondition, isKNGate } from "../../generated/ast.js";
22+
import { getDescription } from "../../utils.js";
23+
import { topOfAnalysis } from "../analysis/fta-cutSet-calculator.js";
24+
import { FtaServices } from "../fta-module.js";
25+
import { namedFtaElement } from "../utils.js";
26+
import { DescriptionNode, FTAEdge, FTAGraph, FTANode, FTAPort } from "./fta-interfaces.js";
2727
import {
2828
FTA_DESCRIPTION_NODE_TYPE,
2929
FTA_EDGE_TYPE,
@@ -33,10 +33,10 @@ import {
3333
FTA_PORT_TYPE,
3434
FTNodeType,
3535
PortSide,
36-
} from "./fta-model";
37-
import { FtaSynthesisOptions, noCutSet, spofsSet } from "./fta-synthesis-options";
38-
import { getFTNodeType, getTargets } from "./utils";
39-
import { HEADER_LABEL_TYPE } from "../../stpa/diagram/stpa-model";
36+
} from "./fta-model.js";
37+
import { FtaSynthesisOptions, noCutSet, spofsSet } from "./fta-synthesis-options.js";
38+
import { getFTNodeType, getTargets } from "./utils.js";
39+
import { HEADER_LABEL_TYPE } from "../../stpa/diagram/stpa-model.js";
4040
export class FtaDiagramGenerator extends LangiumDiagramGenerator {
4141
protected readonly options: FtaSynthesisOptions;
4242

extension/src-language-server/fta/diagram/fta-interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
import { Point, SEdge, SGraph, SNode, SPort } from "sprotty-protocol";
19-
import { FTNodeType, PortSide } from "./fta-model";
19+
import { FTNodeType, PortSide } from "./fta-model.js";
2020

2121
/**
2222
* Node of a fault tree.

0 commit comments

Comments
 (0)