Skip to content

Commit fe9d533

Browse files
committed
Fix asinit tsconfig.json generation
This used to extend the .d.ts file instead of the base .json, which was wrong
1 parent ab08269 commit fe9d533

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

bin/asinit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const compilerDir = path.join(__dirname, "..");
3030
const compilerVersion = require(path.join(compilerDir, "package.json")).version;
3131
const assemblyDir = path.join(projectDir, "assembly");
3232
const tsconfigFile = path.join(assemblyDir, "tsconfig.json");
33-
const definitionsFile = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.d.ts"));
33+
const tsconfigBase = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.json"));
3434
const entryFile = path.join(assemblyDir, "index.ts");
3535
const buildDir = path.join(projectDir, "build");
3636
const gitignoreFile = path.join(buildDir, ".gitignore");
@@ -145,10 +145,10 @@ function ensureAssemblyDirectory() {
145145

146146
function ensureTsconfigJson() {
147147
console.log("- Making sure that 'assembly/tsconfig.json' is set up...");
148-
const definitionsPath = definitionsFile.replace(/\\/g, "/");
148+
const base = tsconfigBase.replace(/\\/g, "/");
149149
if (!fs.existsSync(tsconfigFile)) {
150150
fs.writeFileSync(tsconfigFile, JSON.stringify({
151-
"extends": definitionsPath,
151+
"extends": base,
152152
"include": [
153153
"./**/*.ts"
154154
]
@@ -157,7 +157,7 @@ function ensureTsconfigJson() {
157157

158158
} else {
159159
let tsconfig = JSON.parse(fs.readFileSync(tsconfigFile, "utf8"));
160-
tsconfig["extends"] = definitionsPath;
160+
tsconfig["extends"] = base;
161161
fs.writeFileSync(tsconfigFile, JSON.stringify(tsconfig, null, 2));
162162
console.log(chalk.green(" Updated: ") + tsconfigFile);
163163
}

examples/mandelbrot/assembly/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../std/assembly.d.ts",
2+
"extends": "../../../std/assembly.json",
33
"include": [
44
"./**/*.ts"
55
]

0 commit comments

Comments
 (0)