Skip to content

Commit 8dac554

Browse files
committed
fix(ts-model-api): use commonjs
I tried ESM and UMD, but commonjs is the only one that works in the text-editor/kernelf-angular-demo.
1 parent 1327513 commit 8dac554

File tree

16 files changed

+220
-210
lines changed

16 files changed

+220
-210
lines changed

light-model-client/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ kotlin {
2121
}
2222
}
2323
}
24+
useCommonJs()
2425
}
2526

2627
sourceSets {

model-api-gen-runtime/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ kotlin {
1919
}
2020
}
2121
}
22+
useCommonJs()
2223
}
2324

2425
sourceSets {

model-api/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ kotlin {
3939
}
4040
}
4141
}
42+
useCommonJs()
4243
}
4344
sourceSets {
4445
val commonMain by getting {

model-client/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ kotlin {
4141
}
4242
}
4343
}
44+
useCommonJs()
4445
}
4546
sourceSets {
4647
val commonMain by getting {

model-server-api/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ kotlin {
2323
}
2424
}
2525
}
26+
useCommonJs()
2627
}
2728

2829
sourceSets {

ts-model-api/package-lock.json

Lines changed: 184 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts-model-api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dist/*.d.ts.map",
2020
"dist/*.d.ts"
2121
],
22+
"type": "commonjs",
2223
"main": "dist/index",
2324
"typings": "dist/index.d.ts",
2425
"types": "dist/index.d.ts",
@@ -41,7 +42,7 @@
4142
"husky": "^4.2.3",
4243
"shx": "^0.3.2",
4344
"tslint": "^6.1.0",
44-
"typescript": "^3.8.3"
45+
"typescript": "^4.7.4"
4546
},
4647
"engines": {
4748
"node": ">= 10.18.1",

ts-model-api/src/ChildrenAccessor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type {ITypedNode, TypedNode} from "./TypedNode";
2-
import type {INodeJS} from "./INodeJS";
3-
import {LanguageRegistry} from "./LanguageRegistry";
4-
import type {IConceptJS} from "./IConceptJS";
1+
import type {ITypedNode, TypedNode} from "./TypedNode.js";
2+
import type {INodeJS} from "./INodeJS.js";
3+
import {LanguageRegistry} from "./LanguageRegistry.js";
4+
import type {IConceptJS} from "./IConceptJS.js";
55

66
export abstract class ChildrenAccessor<ChildT extends ITypedNode> implements Iterable<ChildT> {
77
constructor(public parentNode: INodeJS, public role: string | undefined) {

ts-model-api/src/GeneratedConcept.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import type {IConceptJS} from "./IConceptJS";
17+
import type {IConceptJS} from "./IConceptJS.js";
1818

1919
export abstract class GeneratedConcept implements IConceptJS {
2020

ts-model-api/src/GeneratedLanguage.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type {ILanguage} from "./ILanguage";
2-
import {LanguageRegistry} from "./LanguageRegistry";
3-
import type {INodeJS} from "./INodeJS";
4-
import type {TypedNode} from "./TypedNode";
5-
import type {GeneratedConcept} from "./GeneratedConcept";
1+
import type {ILanguage} from "./ILanguage.js";
2+
import {LanguageRegistry} from "./LanguageRegistry.js";
3+
import type {INodeJS} from "./INodeJS.js";
4+
import type {TypedNode} from "./TypedNode.js";
5+
import type {GeneratedConcept} from "./GeneratedConcept.js";
66

77
export abstract class GeneratedLanguage implements ILanguage {
88

0 commit comments

Comments
 (0)