Skip to content

Commit 6ece0ae

Browse files
committed
chore: fix linting and lock typscript version
Typescript 5.3 is currently broken which causes problems when compiling the tests. We're version locking for now
1 parent ada0918 commit 6ece0ae

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default async function (root: string, variables: Variables) {
117117
".gitignore": copy(join(__dirname, "content", "gitignore")),
118118
"scripts/clean.ts": copy(join(__dirname, "content", "clean.ts")),
119119
".github/workflows/ci.yml": mustache({
120-
sourcePath: join(__dirname, "content", "ci.yml"),
120+
path: join(__dirname, "content", "ci.yml"),
121121
variables: variables.ci || {},
122122
}),
123123
".github/matchers/tap.json": copy(join(__dirname, "content", "tap.json")),

lib/mustache.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { Generator, ValidateInput } from "code-skeleton/lib/generators/abstract";
2-
import { GeneratorReportResult } from "code-skeleton/lib/generators/report";
1+
import { Generator } from "code-skeleton/lib/generators/abstract";
32
import { readFile } from "node:fs/promises";
43
import Mustache from "mustache";
54
Mustache.tags = [ "<%", "%>" ];
65

76
interface MustacheGeneratorOptions {
8-
sourcePath: string;
7+
path: string;
98
variables: unknown;
109
}
1110

@@ -15,31 +14,17 @@ class MustacheGenerator extends Generator<MustacheGeneratorOptions> {
1514
constructor (options: MustacheGeneratorOptions) {
1615
super(options);
1716

18-
if (!this.options.sourcePath) {
17+
if (!this.options.path) {
1918
throw new Error("Must specify a source path");
2019
}
2120
}
2221

2322
async generate () {
24-
const source = await readFile(this.options.sourcePath);
23+
const source = await readFile(this.options.path);
2524

2625
const rendered = Mustache.render(source.toString(), this.options.variables);
2726
return rendered;
2827
}
29-
30-
async validate(options: ValidateInput) : Promise<GeneratorReportResult> {
31-
const expected = await this.generate();
32-
33-
if (!options.found.includes(expected)) {
34-
this.report({
35-
expected,
36-
found: options.found,
37-
message: `${this.options.sourcePath} does not include the original template`
38-
});
39-
return GeneratorReportResult.Fail;
40-
}
41-
return GeneratorReportResult.Pass;
42-
}
4328
}
4429

4530
export function mustache (options: MustacheGeneratorOptions) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"eslint": "^8.0.0",
3232
"tap": "^16.0.0",
3333
"ts-node": "^10.0.0",
34-
"typescript": "^5.0.0"
34+
"typescript": "5.2.2"
3535
},
3636
"peerDependencies": {
3737
"code-skeleton": "^2.0.0"

0 commit comments

Comments
 (0)