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

feat(developer): VSCode plugin for building 🗼 #12757

Draft
wants to merge 1 commit into
base: epic/ldml-editor
Choose a base branch
from

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Dec 2, 2024

  • initial checkin
  • README
  • build.sh

Fixes: #12756

@keymanapp-test-bot skip

@srl295 srl295 self-assigned this Dec 2, 2024
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Dec 2, 2024
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Dec 2, 2024

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S16 milestone Dec 2, 2024
@mcdurdin
Copy link
Member

mcdurdin commented Dec 3, 2024

Should this be based on epic/ldml-editor?

@mcdurdin mcdurdin changed the base branch from master to epic/ldml-editor December 3, 2024 00:51
@srl295
Copy link
Member Author

srl295 commented Dec 3, 2024

Should this be based on epic/ldml-editor?

Oops, yes, thanks!

@srl295 srl295 force-pushed the feat/developer/12756-vscode-build branch 2 times, most recently from b93b28f to b65ba85 Compare December 3, 2024 18:22
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Dec 3, 2024
developer/src/keyman-vscode-plugin/build.sh Outdated Show resolved Hide resolved
developer/src/keyman-vscode-plugin/package.json Outdated Show resolved Hide resolved
developer/src/keyman-vscode-plugin/tsconfig.json Outdated Show resolved Hide resolved
@srl295 srl295 force-pushed the feat/developer/12756-vscode-build branch 3 times, most recently from 5c3984f to 85dbd3a Compare December 3, 2024 22:49
@srl295 srl295 marked this pull request as ready for review December 3, 2024 22:49
@mcdurdin mcdurdin self-assigned this Dec 4, 2024
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

I feel like this PR is a good draft. But it needs a lot of work before it is ready to merge into the epic branch. Code that lands in an epic needs to be production ready -- with neat attachment points for follow-on PRs. We don't want commented-out code, test code, or code that will need re-review in general to land in the epic branch.

I've given some initial feedback. Hope this is not too depressing! I am excited for where this is going.

Finally, we should back-burner this work and focus on the LDML keyboard editor work as a priority. I think it might be sensible to refactor the .kpj handling in kmc into a kmc-project module and build on that. I can certainly take the changes in this PR into account if I take that on (or you can).

developer/src/build.sh Outdated Show resolved Hide resolved
This package is a standalone [VSCode](https://code.visualstudio.com) plugin which offers:

- a Build Task for building .kpj files into a package
- when building the .kpj file, all .kmn and .xml (LDML keyboard) files will be compiled as well
Copy link
Member

Choose a reason for hiding this comment

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

needs to also build .kps and .model.ts.

Copy link
Member Author

Choose a reason for hiding this comment

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

  • build .kps (actually I think it does, it just uses the .kpj to locate them?)
  • build .model.ts

developer/src/keyman-vscode-plugin/README.md Outdated Show resolved Hide resolved
developer/src/keyman-vscode-plugin/build.sh Outdated Show resolved Hide resolved
developer/src/keyman-vscode-plugin/build.sh Outdated Show resolved Hide resolved
};
const compiler = new kmcLdml.LdmlKeyboardCompiler();
if (!await compiler.init(callbacks, ldmlCompilerOptions)) {
msg(`Compiler failed init\r\n`);
Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid embedding NL in the messages -- this should be in the message function. Also, we are trying to keep all messages in separate files for future localization

Copy link
Member Author

Choose a reason for hiding this comment

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

  • update msg to have nl by default.

* @param msg callback for writing messages
* @returns accept on OK, otherwise throws
*/
export async function buildProject(workspaceRoot: string,
Copy link
Member

Choose a reason for hiding this comment

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

This function is very long and should be broken into smaller chunks

Comment on lines 204 to 206
if (didCompilePkg) {
throw Error(`Error: two packages were encountered.`);
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do you error on multiple packages?

Copy link
Member Author

Choose a reason for hiding this comment

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

i think this was a mistake.

Comment on lines 197 to 199
if (!didCompileSrc) {
throw Error(`Error: no source files were compiled.`);
}
Copy link
Member

Choose a reason for hiding this comment

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

It is legitimate to have a project with only a .kps and no .kmn or .xml

Copy link
Member Author

Choose a reason for hiding this comment

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

  • remove error

Copy link
Member

Choose a reason for hiding this comment

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

7500 additional lines in package-lock.json is a little concerning in terms of dependency creep; I know that's almost all in devDependencies but we need to be monitoring

@srl295
Copy link
Member Author

srl295 commented Dec 5, 2024

I feel like this PR is a good draft. But it needs a lot of work before it is ready to merge into the epic branch. Code that lands in an epic needs to be production ready -- with neat attachment points for follow-on PRs. We don't want commented-out code, test code, or code that will need re-review in general to land in the epic branch.

I've given some initial feedback. Hope this is not too depressing! I am excited for where this is going.

Finally, we should back-burner this work and focus on the LDML keyboard editor work as a priority. I think it might be sensible to refactor the .kpj handling in kmc into a kmc-project module and build on that. I can certainly take the changes in this PR into account if I take that on (or you can).

I got the rename in and will move this back to draft for now.

100% on quality.

@srl295 srl295 marked this pull request as draft December 5, 2024 19:22
@srl295
Copy link
Member Author

srl295 commented Dec 5, 2024

I feel like this PR is a good draft. But it needs a lot of work before it is ready to merge into the epic branch. Code that lands in an epic needs to be production ready -- with neat attachment points for follow-on PRs. We don't want commented-out code, test code, or code that will need re-review in general to land in the epic branch.
I've given some initial feedback. Hope this is not too depressing! I am excited for where this is going.
Finally, we should back-burner this work and focus on the LDML keyboard editor work as a priority. I think it might be sensible to refactor the .kpj handling in kmc into a kmc-project module and build on that. I can certainly take the changes in this PR into account if I take that on (or you can).

I got the rename in and will move this back to draft for now.

100% on quality.

erm. The one thing about tabling this is, it's also the substrate for the visual editor.

But, I think I can make a draft PR off this draft PR. And can work on the rest separately.

@srl295 srl295 force-pushed the feat/developer/12756-vscode-build branch from a1e73a5 to cb65131 Compare December 6, 2024 15:58
@srl295 srl295 changed the base branch from epic/ldml-editor to feat/developer/12798-vscode-ext-scaffolding-epic-ldml-editor December 6, 2024 15:59
@srl295 srl295 force-pushed the feat/developer/12756-vscode-build branch from cb65131 to f890a57 Compare December 6, 2024 16:02
- basic build of .kpj, .kps, .kmn, .xml

Fixes: #12756

Co-authored-by: Marc Durdin <[email protected]>
@srl295 srl295 force-pushed the feat/developer/12756-vscode-build branch from f890a57 to 1aee4ed Compare December 6, 2024 16:34
@darcywong00 darcywong00 modified the milestones: A18S16, A18S17 Dec 7, 2024
@srl295
Copy link
Member Author

srl295 commented Dec 10, 2024

OK. I'm going to let this one sit for a bit. It'll have some conflicts to work through.

Base automatically changed from feat/developer/12798-vscode-ext-scaffolding-epic-ldml-editor to epic/ldml-editor December 10, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(developer): VSCode Plugin for kpj/xml/kmn builds 🗼
3 participants