Skip to content

Conversation

@microbit-carlos
Copy link
Collaborator

As I believe package.json "type": "module" forces ES Modules syntax.

Comment on lines +3 to +4
import { headerData } from "./inputdata.js";
import { generateBlob, generateCArray, generateDsHexLiteral } from "./main.js";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@microbit-robert this is the part I haven't had a chance to look into.
As npm run start ends up running node built/cli.js it looks like the script needs the import to include the extension.

Not sure how to get ts to convert the import statements (in which case maybe we need to reintroduce tsconfig.cli.json and npm start would then be tsc --project tsconfig.cli.json && node built/cli.js.

Copy link
Collaborator Author

@microbit-carlos microbit-carlos Sep 5, 2024

Choose a reason for hiding this comment

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

Assuming the ml extension needs the import statements in the built output as they currently are, then we'd need to make sure the packaging script still used the original tsconfig.json and excludes the cli.ts file from the package (as that'd be broken to be used with node and it doesn't do anything as an imported module).

@microbit-carlos microbit-carlos marked this pull request as ready for review September 5, 2024 12:49
Copy link
Contributor

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

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

LGTM.

@microbit-carlos microbit-carlos merged commit fed0924 into main Sep 5, 2024
@microbit-carlos microbit-carlos deleted the header-cli branch September 5, 2024 12:58
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.

3 participants