Skip to content

Commit

Permalink
Add test code compilation
Browse files Browse the repository at this point in the history
- Fix inversify version to 6.0.1 as 6.0.2 introduces braking changes
  • Loading branch information
kaisalmen committed Dec 6, 2023
1 parent 75bc208 commit 518c877
Show file tree
Hide file tree
Showing 25 changed files with 610 additions and 505 deletions.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@vscode/codicons": "^0.0.33",
"express": "^4.18.2",
"inversify": "^6.0.1",
"inversify": "6.0.1",
"reflect-metadata": "^0.1.13",
"sprotty": "^1.0.0",
"sprotty-elk": "^1.0.0",
Expand Down
4 changes: 0 additions & 4 deletions examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": [
"reflect-metadata",
"webpack-env"
],
"composite": false,
"declaration": false,
"declarationMap": false
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"prepare": "yarn run clean && yarn run build",
"clean": "lerna run clean",
"build": "tsc --build tsconfig.build.json && yarn --cwd examples build",
"watch": "concurrently -n sprotty,examples -c blue,green, \"yarn --cwd examples watch\" \"tsc -b tsconfig.build.json -w\"",
"watch:tsc": "tsc --build --watch tsconfig.build.json",
"watch": "concurrently -n sprotty,examples -c blue,green, \"yarn --cwd examples watch\" \"yarn run watch:tsc\"",
"lint": "eslint {**/src/**/*.ts,**/src/**/*.tsx}",
"lint:fix": "eslint {**/src/**/*.ts,**/src/**/*.tsx} --fix",
"test": "vitest run",
Expand All @@ -16,6 +17,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "~6.13.2",
"@typescript-eslint/parser": "~6.13.2",
"@types/node": "~18.18.14",
"@vitest/coverage-v8": "~1.0.1",
"eslint": "~8.55.0",
"concurrently": "~8.2.2",
Expand All @@ -27,7 +29,7 @@
"semver": "~7.5.4",
"shx": "~0.3.4",
"typescript": "~5.3.2",
"vite": "~5.0.5",
"vite": "~5.0.6",
"vitest": "~1.0.1"
},
"workspaces": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "<%= project-name %>",
"description": "Please enter a brief description here",
"dependencies": {
"inversify": "^6.0.1",
"inversify": "6.0.1",
"reflect-metadata": "^0.1.13",
"sprotty": "^1.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"types": [
"reflect-metadata"
],
"esModuleInterop": true,
"sourceMap": true,
"experimentalDecorators": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/sprotty-elk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"sprotty-protocol": "^1.0.0"
},
"optionalDependencies": {
"inversify": "^6.0.1"
"inversify": "6.0.1"
},
"scripts": {
"clean": "shx rm -fr lib artifacts *.tsbuildinfo",
Expand Down
22 changes: 6 additions & 16 deletions packages/sprotty-elk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
// this file is required for VSCode to work properly
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.src.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"types": [
"node"
]
"noEmit": true,
"rootDir": "."
},
"include": [
"src"
],
"exclude": [
"**/*.spec.ts",
"**/*.spec.tsx"
],
"references": [
{ "path": "../sprotty-protocol/tsconfig.json"},
{ "path": "../sprotty/tsconfig.json" }
"src/**/*"
]
}
}
21 changes: 21 additions & 0 deletions packages/sprotty-elk/tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": [
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"**/*.spec.ts",
"**/*.spec.tsx",
"lib",
"node_modules"
],
"references": [
{ "path": "../sprotty-protocol/tsconfig.src.json"},
{ "path": "../sprotty/tsconfig.src.json" }
]
}
19 changes: 19 additions & 0 deletions packages/sprotty-elk/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "./tsconfig.src.json",
"compilerOptions": {
"rootDir": "src",
"noEmit": true,
"skipLibCheck": true
},
"references": [{
"path": "./tsconfig.src.json"
}],
"include": [
"**/*.spec.ts",
"**/*.spec.tsx"
],
"exclude": [
"lib",
"node_modules"
]
}
97 changes: 0 additions & 97 deletions packages/sprotty-elk/typings/elkjs/index.d.ts

This file was deleted.

15 changes: 6 additions & 9 deletions packages/sprotty-protocol/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// this file is required for VSCode to work properly
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.src.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
"noEmit": true,
"rootDir": "."
},
"include": [
"src"
],
"exclude": [
"**/*.spec.ts",
"**/*.spec.tsx"
"src/**/*"
]
}
}
17 changes: 17 additions & 0 deletions packages/sprotty-protocol/tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"**/*.spec.ts",
"**/*.spec.tsx",
"lib",
"node_modules"
]
}
19 changes: 19 additions & 0 deletions packages/sprotty-protocol/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "./tsconfig.src.json",
"compilerOptions": {
"rootDir": "src",
"noEmit": true,
"skipLibCheck": true
},
"references": [{
"path": "./tsconfig.src.json"
}],
"include": [
"**/*.spec.ts",
"**/*.spec.tsx"
],
"exclude": [
"lib",
"node_modules"
]
}
9 changes: 5 additions & 4 deletions packages/sprotty/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@
"directory": "packages/sprotty"
},
"peerDependencies": {
"inversify": "^6.0.1"
"inversify": "6.0.1"
},
"dependencies": {
"autocompleter": "^9.1.0",
"file-saver": "^2.0.5",
"snabbdom": "^3.5.1",
"inversify": "6.0.1",
"snabbdom": "~3.5.1",
"sprotty-protocol": "^1.0.0",
"tinyqueue": "^2.0.3"
},
"devDependencies": {
"happy-dom": "^12.10.3",
"@types/file-saver": "^2.0.5",
"snabbdom-to-html": "^7.1.0"
"happy-dom": "^12.10.3",
"snabbdom-to-html": "~7.1.0"
},
"scripts": {
"clean": "shx rm -fr lib artifacts *.tsbuildinfo",
Expand Down
14 changes: 7 additions & 7 deletions packages/sprotty/src/features/update/model-matching.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

import "reflect-metadata";
import { expect, describe, it } from 'vitest';
import { SModelRootSchema } from "../../base/model/smodel";
import { SModelElement } from 'sprotty-protocol';
import { ModelMatcher } from "./model-matching";

describe('ModelMatcher', () => {
it('finds new elements', () => {
const modelMatcher = new ModelMatcher();
const left: SModelRootSchema = {
const left: SModelElement = {
type: 't',
id: 'root'
};
const right: SModelRootSchema = {
const right: SModelElement = {
type: 't',
id: 'root',
children: [
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('ModelMatcher', () => {

it('finds deleted elements', () => {
const modelMatcher = new ModelMatcher();
const left: SModelRootSchema = {
const left: SModelElement = {
type: 't',
id: 'root',
children: [
Expand All @@ -76,7 +76,7 @@ describe('ModelMatcher', () => {
}
]
};
const right: SModelRootSchema = {
const right: SModelElement = {
type: 't',
id: 'root'
};
Expand All @@ -102,7 +102,7 @@ describe('ModelMatcher', () => {

it('matches elements with equal id', () => {
const modelMatcher = new ModelMatcher();
const left: SModelRootSchema = {
const left: SModelElement = {
type: 't',
id: 'root',
children: [
Expand All @@ -118,7 +118,7 @@ describe('ModelMatcher', () => {
}
]
};
const right: SModelRootSchema = {
const right: SModelElement = {
type: 't',
id: 'root',
children: [
Expand Down
Loading

0 comments on commit 518c877

Please sign in to comment.