-
Notifications
You must be signed in to change notification settings - Fork 264
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
Build as ESM and UMD libs #305
Build as ESM and UMD libs #305
Conversation
@apisim Thanks for the PR. I think that updating all the dependencies may have caused the build error. I would like to see a massive version update like that done in a separate PR or at least commit as it has a high chance of breaking things. |
@joshuawilson As far as I can tell, the Travis CI build was successful. From the two that failed, one is a 502 Bad Gateway error, which has nothing to do with the code, and the one for the windows build has no info in the raw log. Did something just time out? My builds on Windows run fine and the tests all run successfully. I don't see a way to manually re-run the GitHub workflow actions. From what I've been reading, some workflow_dispatch configuration is needed? I guess I'll have to push some trivial changes to trigger the workflow (when I get back to my laptop). Thanks! |
I was able to manually re-trigger them. We just got github actions setup, so I didn't know how to do it either. |
Thanks, @joshuawilson! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @joshuawilson |
@evidolob Thank you for the review and the comments.
Sure - I can extract common tsconfig settings into a Regarding updating README.md - what information in particular should be included or changed? |
OK - pushed a commit to back out the updates to the dependencies in |
To fix it you need to delete
I think we may have "default"
At least we need to update getting-started section. And it would be nice to have some section which describes that now we have to type of modules, and how and when use them. |
@evidolob Are you thinking of not producing and publishing |
I was thinking that it was your intention. |
Btw a lot of clients currently use E.g https://github.com/liuderchi/ide-yaml/blob/master/src/main.js#L21 |
I'm sorry for the confusion - no, my intention wasn't to replace Could you clarify, @evidolob, "...Just extend I guess this "missed the train" for Release 0.10.0? |
As for release, I think you have time, till tomorrow, I do not have time to do it today. |
With these changes to the |
I'm not sure I understand, @joshuawilson - the original On another note, @evidolob - it is a bit more complicated to update README.md with info on how to use the new ESM and UMD libraries. I'm currently using them in a monaco-yaml fork with the goal of merging all the changes in the fork back into the original monaco-yaml repo. Given the transient nature of the monaco-yaml fork and the unknowns of when the changes will be merged into the original monaco-yaml repo (supposedly after the ESM and UMD libraries are published with yaml-language-server), I can't currently offer "how to use" instructions. I don't want to be holding up Release 0.10.0. I think it might be best to close this PR. I will still probably submit a separate PR for the changes to Sincerely - thank you very much for considering the PR and for your time. Thanks!! |
@apisim Sorry, maybe I was not clear on update REDME request, I just want to inform users that we produce several different JS modules, and they may use this project not only like node modules. As for release, we quite flexible, we may release We, with @joshuawilson , wants to make release schedule more transparent, usually we make releases every 3 week, I will create some document which describe release process. If you need to have some bug fix or feature released, don't hesitate to contact us, we will glad to help you. |
If that's OK with you, I'd like to move forward with this pull request @joshuawilson @evidolob @JPinkney I believe the comments so far were all addressed. Let me know, please, if there's some tweaking you think is needed or of anything else. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side, I think both @evidolob and @joshuawilson are on PTO so I'm going to wait for them to get back before I merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A few last things:
- I think it would be better if we delete
lib
folder withclean
script - It would be great if you add record about new libraries in to
CHANGELOG.md
OK. I added a step to the Let me know if there's anything else. |
The build now also produces libraries in ESM and UMD format. That makes it possible, for example, to use yaml-language-server in Monaco Editor with the YAML language server running as a worker in the browser.
Summary of the Changes
New Files
The output for both is a new directory
/lib
.Modified Files
@types/prettier
to the latest version.lib/
so Git will ignore the untracked files in it.require
withimport
.require
withimport
. This makes it possible to compile with webpack and have the formatting work when running in the browser. There is another change described below.yarn install
.yamlFormatter.ts
yamlFormatter.ts
now supports configuring indentation using the standardFormattingOptions
from 'vscode-languageserver-types'. The existing code in server.ts can be seen as tightly coupled withprettier
-tabWidth
is specific toprettier
.Moreover, to configure the tab size when creating a Monaco Editor instance one has to use the standard
tabSize
; usingtabWidth
doesn't work.Notice that this change shouldn't break any existing code that makes use of
tabWidth
(e.g. when running the YAML language server in something like VS Code).Others
Notice that according to the npm-publish docs, "...All files in the package directory are included if no local .gitignore or .npmignore file exists. If both files exist and a file is ignored by .gitignore but not by .npmignore then it will be included". Therefore, my assumption is that the
lib/
directory and its content will be published along without/server
.