Skip to content

Commit cab8530

Browse files
committed
Fixing build issues
1 parent 5d93b45 commit cab8530

File tree

5 files changed

+119
-2
lines changed

5 files changed

+119
-2
lines changed

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@
6868
"main": "./lib/diff2html.js",
6969
"module": "./lib-esm/diff2html.js",
7070
"types": "./lib/diff2html.d.ts",
71+
"ts-node": {
72+
"compilerOptions": {
73+
"module": "commonjs",
74+
"typeRoots": [
75+
"./node_modules/@types",
76+
"./typings"
77+
]
78+
}
79+
},
7180
"lint-staged": {
7281
"**/*.+(js|jsx|ts|tsx|json)": [
7382
"prettier --write",

scripts/hulk.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* limitations under the License.
1414
*/
1515

16+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
17+
/// <reference path="./profoundlogic__hogan.d.ts" />
18+
1619
import * as path from 'path';
1720
import * as fs from 'fs';
1821

scripts/profoundlogic__hogan.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
declare module '@profoundlogic/hogan' {
2+
export interface Context {
3+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4+
[key: string]: any;
5+
}
6+
7+
export interface SectionTags {
8+
o: string;
9+
c: string;
10+
}
11+
12+
export interface HoganOptions {
13+
asString?: boolean | undefined;
14+
sectionTags?: readonly SectionTags[] | undefined;
15+
delimiters?: string | undefined;
16+
disableLambda?: boolean | undefined;
17+
}
18+
19+
export interface Token {
20+
tag: string;
21+
otag?: string | undefined;
22+
ctag?: string | undefined;
23+
i?: number | undefined;
24+
n?: string | undefined;
25+
text?: string | undefined;
26+
}
27+
28+
export interface Leaf extends Token {
29+
end: number;
30+
nodes: Token[];
31+
}
32+
33+
export type Tree = Leaf[];
34+
35+
export interface Partials {
36+
[symbol: string]: HoganTemplate;
37+
}
38+
39+
export class HoganTemplate {
40+
render(context: Context, partials?: Partials, indent?: string): string;
41+
}
42+
43+
export { HoganTemplate as Template, HoganTemplate as template };
44+
45+
export function compile(text: string, options?: HoganOptions & { asString: false }): HoganTemplate;
46+
export function compile(text: string, options?: HoganOptions & { asString: true }): string;
47+
export function compile(text: string, options?: HoganOptions): HoganTemplate | string;
48+
49+
export function scan(text: string, delimiters?: string): Token[];
50+
51+
export function parse(tokens: readonly Token[], text?: undefined, options?: HoganOptions): Tree;
52+
}

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"include": ["src/**/*", "typings/**/*"],
2+
"include": ["src/**/*", "typings/**/*", "scripts/**/*"],
33
"exclude": ["node_modules", "src/__tests__/**"],
44
"compilerOptions": {
55
"outDir": "bundles-out",
@@ -32,6 +32,7 @@
3232
"preserveConstEnums": true,
3333
"alwaysStrict": true,
3434
"noImplicitAny": true,
35-
"noImplicitThis": true
35+
"noImplicitThis": true,
36+
"typeRoots": ["./node_modules/@types", "./typings"]
3637
}
3738
}

typings/profoundlogic__hogan.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
declare module '@profoundlogic/hogan' {
2+
export interface Context {
3+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4+
[key: string]: any;
5+
}
6+
7+
export interface SectionTags {
8+
o: string;
9+
c: string;
10+
}
11+
12+
export interface HoganOptions {
13+
asString?: boolean | undefined;
14+
sectionTags?: readonly SectionTags[] | undefined;
15+
delimiters?: string | undefined;
16+
disableLambda?: boolean | undefined;
17+
}
18+
19+
export interface Token {
20+
tag: string;
21+
otag?: string | undefined;
22+
ctag?: string | undefined;
23+
i?: number | undefined;
24+
n?: string | undefined;
25+
text?: string | undefined;
26+
}
27+
28+
export interface Leaf extends Token {
29+
end: number;
30+
nodes: Token[];
31+
}
32+
33+
export type Tree = Leaf[];
34+
35+
export interface Partials {
36+
[symbol: string]: HoganTemplate;
37+
}
38+
39+
export class HoganTemplate {
40+
render(context: Context, partials?: Partials, indent?: string): string;
41+
}
42+
43+
export { HoganTemplate as Template, HoganTemplate as template };
44+
45+
export function compile(text: string, options?: HoganOptions & { asString: false }): HoganTemplate;
46+
export function compile(text: string, options?: HoganOptions & { asString: true }): string;
47+
export function compile(text: string, options?: HoganOptions): HoganTemplate | string;
48+
49+
export function scan(text: string, delimiters?: string): Token[];
50+
51+
export function parse(tokens: readonly Token[], text?: undefined, options?: HoganOptions): Tree;
52+
}

0 commit comments

Comments
 (0)