mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-26 15:32:16 +00:00
Fix asinit tsconfig.json generation
This used to extend the .d.ts file instead of the base .json, which was wrong
This commit is contained in:
parent
ab08269276
commit
fe9d53329d
@ -30,7 +30,7 @@ const compilerDir = path.join(__dirname, "..");
|
|||||||
const compilerVersion = require(path.join(compilerDir, "package.json")).version;
|
const compilerVersion = require(path.join(compilerDir, "package.json")).version;
|
||||||
const assemblyDir = path.join(projectDir, "assembly");
|
const assemblyDir = path.join(projectDir, "assembly");
|
||||||
const tsconfigFile = path.join(assemblyDir, "tsconfig.json");
|
const tsconfigFile = path.join(assemblyDir, "tsconfig.json");
|
||||||
const definitionsFile = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.d.ts"));
|
const tsconfigBase = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.json"));
|
||||||
const entryFile = path.join(assemblyDir, "index.ts");
|
const entryFile = path.join(assemblyDir, "index.ts");
|
||||||
const buildDir = path.join(projectDir, "build");
|
const buildDir = path.join(projectDir, "build");
|
||||||
const gitignoreFile = path.join(buildDir, ".gitignore");
|
const gitignoreFile = path.join(buildDir, ".gitignore");
|
||||||
@ -145,10 +145,10 @@ function ensureAssemblyDirectory() {
|
|||||||
|
|
||||||
function ensureTsconfigJson() {
|
function ensureTsconfigJson() {
|
||||||
console.log("- Making sure that 'assembly/tsconfig.json' is set up...");
|
console.log("- Making sure that 'assembly/tsconfig.json' is set up...");
|
||||||
const definitionsPath = definitionsFile.replace(/\\/g, "/");
|
const base = tsconfigBase.replace(/\\/g, "/");
|
||||||
if (!fs.existsSync(tsconfigFile)) {
|
if (!fs.existsSync(tsconfigFile)) {
|
||||||
fs.writeFileSync(tsconfigFile, JSON.stringify({
|
fs.writeFileSync(tsconfigFile, JSON.stringify({
|
||||||
"extends": definitionsPath,
|
"extends": base,
|
||||||
"include": [
|
"include": [
|
||||||
"./**/*.ts"
|
"./**/*.ts"
|
||||||
]
|
]
|
||||||
@ -157,7 +157,7 @@ function ensureTsconfigJson() {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
let tsconfig = JSON.parse(fs.readFileSync(tsconfigFile, "utf8"));
|
let tsconfig = JSON.parse(fs.readFileSync(tsconfigFile, "utf8"));
|
||||||
tsconfig["extends"] = definitionsPath;
|
tsconfig["extends"] = base;
|
||||||
fs.writeFileSync(tsconfigFile, JSON.stringify(tsconfig, null, 2));
|
fs.writeFileSync(tsconfigFile, JSON.stringify(tsconfig, null, 2));
|
||||||
console.log(chalk.green(" Updated: ") + tsconfigFile);
|
console.log(chalk.green(" Updated: ") + tsconfigFile);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../std/assembly.d.ts",
|
"extends": "../../../std/assembly.json",
|
||||||
"include": [
|
"include": [
|
||||||
"./**/*.ts"
|
"./**/*.ts"
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user