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

[Docs] Run TSC on HOWTOs + README #191

Merged
merged 17 commits into from
May 30, 2024
Merged

[Docs] Run TSC on HOWTOs + README #191

merged 17 commits into from
May 30, 2024

Conversation

hinthornw
Copy link
Contributor

@hinthornw hinthornw commented May 30, 2024

No description provided.

@hinthornw hinthornw changed the title [Docs] Run TS compiloer on HOWTOs + README [Docs] Run TSC on HOWTOs + README May 30, 2024
temp_file_path = "temp.ts"
with open(temp_file_path, "w") as f:
f.write(ts_code)
cmd = ["npx", "tsc", temp_file_path] + tsconfig_options
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you just pass the config file to tsc?

Copy link
Contributor Author

@hinthornw hinthornw May 30, 2024

Choose a reason for hiding this comment

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

You would think. Maybe you can. Doesn't seem like it though.

  1. https://www.typescriptlang.org/docs/handbook/compiler-options.html
  2. https://arc.net/l/quote/lvbifppw

When input files are specified on the command line, tsconfig.json files are ignored.

Maybe through something like --project

Ah no still not:

error TS5042: Option 'project' cannot be mixed with source files on a command line.

def run_js_code(js_code_path: str) -> str:
print("Running JavaScript code...")
process = subprocess.Popen(
["npx", "node", js_code_path],
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use npx everywhere?

Copy link
Contributor Author

@hinthornw hinthornw May 30, 2024

Choose a reason for hiding this comment

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

Because i have no clue what i'm doing but tsc doesn't run but npx tsc does locally for me

@hinthornw hinthornw merged commit a96a9a4 into main May 30, 2024
9 checks passed
@hinthornw hinthornw deleted the wfh/more_tutorials branch May 30, 2024 13:57
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.

None yet

3 participants