Skip to content

Commit

Permalink
fix(build): sync-ts-config script needs import assertion of type json
Browse files Browse the repository at this point in the history
Fixes hyperledger-cacti#2163

Signed-off-by: aldousalvarez <aldousss.alvarez@gmail.com>
  • Loading branch information
aldousalvarez committed Nov 2, 2022
1 parent 3062343 commit cdb68d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/sync-npm-deps-to-tsc-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import JSON5 from "json5";
import fs from "fs-extra";
import { globby, Options as GlobbyOptions } from "globby";
import { RuntimeError } from "run-time-error";
import lernaJson from "../lerna.json";
import { readFile } from "fs/promises";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand All @@ -19,16 +19,19 @@ const main = async (argv: string[], env: NodeJS.ProcessEnv) => {
}
const TS_CONFIG = "tsconfig.json";
const PACKAGE_JSON = "package.json";
const LERNA_JSON = "lerna.json";
const SCRIPT_DIR = __dirname;
const PROJECT_DIR = path.join(SCRIPT_DIR, "../");
console.log(`SCRIPT_DIR=${SCRIPT_DIR}`);
console.log(`PROJECT_DIR=${PROJECT_DIR}`);

const pkgJsonGlobPatterns = lernaJson.packages.map((it) =>
const lernaJson = JSON.parse(
await readFile(PROJECT_DIR + LERNA_JSON, "utf-8"),
);
const pkgJsonGlobPatterns = lernaJson.packages.map((it: string) =>
"./".concat(it).concat(`/${PACKAGE_JSON}`),
);

const tsConfigJsonGlobPatterns = lernaJson.packages.map((it) =>
const tsConfigJsonGlobPatterns = lernaJson.packages.map((it: string) =>
"./".concat(it).concat(`/${TS_CONFIG}`),
);
console.log("Globbing lerna package patterns: ", pkgJsonGlobPatterns);
Expand Down

0 comments on commit cdb68d4

Please sign in to comment.