Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): sync-ts-config script needs import assertion of type json #2164

Merged

Conversation

aldousalvarez
Copy link
Contributor

Fixes #2163

Signed-off-by: aldousalvarez [email protected]

@aldousalvarez aldousalvarez force-pushed the aldousalvarez/issue2163 branch from bd52bbf to 91f7fc0 Compare September 28, 2022 01:34
@aldousalvarez aldousalvarez force-pushed the aldousalvarez/issue2163 branch 2 times, most recently from cdb68d4 to 82cb094 Compare November 2, 2022 09:06
@aldousalvarez aldousalvarez requested review from petermetz and removed request for sandeepnRES and izuru0 November 2, 2022 10:51
@aldousalvarez aldousalvarez force-pushed the aldousalvarez/issue2163 branch from 82cb094 to cf7d390 Compare November 7, 2022 08:21
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aldousalvarez aldousalvarez force-pushed the aldousalvarez/issue2163 branch 2 times, most recently from 589b134 to 01baf2a Compare November 16, 2022 08:19
@aldousalvarez
Copy link
Contributor Author

@petermetz already done it with the latest commit. I returned it all back on to the main function and now I created a variable for PROJECT_DIR + LERNA_JSON with
const LERNA_JSON_DIR = PROJECT_DIR + LERNA_JSON; and I also created a console.log for it. Apologies as well for my confusion

@petermetz
Copy link
Contributor

Suggested edit:

diff --git a/tools/sync-npm-deps-to-tsc-projects.ts b/tools/sync-npm-deps-to-tsc-projects.ts
index 93024ae2..79465bee 100644
--- a/tools/sync-npm-deps-to-tsc-projects.ts
+++ b/tools/sync-npm-deps-to-tsc-projects.ts
@@ -24,9 +24,10 @@ const main = async (argv: string[], env: NodeJS.ProcessEnv) => {
   const PROJECT_DIR = path.join(SCRIPT_DIR, "../");
   console.log(`SCRIPT_DIR=${SCRIPT_DIR}`);
   console.log(`PROJECT_DIR=${PROJECT_DIR}`);
-  const lernaJson = JSON.parse(
-    await readFile(PROJECT_DIR + LERNA_JSON, "utf-8"),
-  );
+
+  const lernaJsonStr = await readFile(PROJECT_DIR + LERNA_JSON, "utf-8");
+  const lernaJson = JSON.parse(lernaJsonStr);
+
   const pkgJsonGlobPatterns = lernaJson.packages.map((it: string) =>
     "./".concat(it).concat(`/${PACKAGE_JSON}`),
   );

@aldousalvarez aldousalvarez force-pushed the aldousalvarez/issue2163 branch from 01baf2a to 5552b99 Compare November 17, 2022 02:41
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aldousalvarez LGTM, thank you for the updates!

@petermetz petermetz force-pushed the aldousalvarez/issue2163 branch from 5552b99 to 981ffe5 Compare November 17, 2022 21:32
@petermetz petermetz force-pushed the aldousalvarez/issue2163 branch from 981ffe5 to 51adcc3 Compare November 19, 2022 01:29
@petermetz petermetz merged commit aa936ec into hyperledger-cacti:main Nov 19, 2022
@petermetz petermetz deleted the aldousalvarez/issue2163 branch November 19, 2022 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(build): sync-ts-config script needs import assertion of type json
4 participants