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

Dev: Create new lint, test, format, watcher scripts and tasks #1652

Merged

Conversation

riotrah
Copy link
Member

@riotrah riotrah commented Apr 1, 2022

What has Changed?

  • Created npm scripts to run prettier check and prettier format in "watch mode", using onchange package, per prettier docs

  • Created new vsc Tasks for:

    • Mocha test watcher
    • Eslint watch
    • new Prettier check watch
    • new Prettier format watch
    • compound task that runs the above unit test, eslint, prettier format watchers + existing Build watch task
  • I personally like to run these all at once, and would consider making the compound watcher the "default build task", such that it's bound to cmd+shift+b, but I'm sure many others might prefer otherwise.

Fixes # (I did not create an issue for this, @PEZ, should I?)

Here's a screenshot
image

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • [-] Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
    • [-] Tested the VSIX built from the PR (so, after you've submitted the PR). You'll find the artifacts by clicking Show all checks in the CI section of the PR page, and then Details on the ci/circleci: build test.
  • [-] Referenced the issue I am fixing/addressing in a commit message for the pull request.
    • [-] If I am fixing the issue, I have used GitHub's fixes/closes syntax
    • [-] If I am fixing just part of the issue, I have just referenced it w/o any of the "fixes” keywords.
  • Created the issue I am fixing/addressing, if it was not present.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

Ping @PEZ, @bpringe, @corasaurus-hex, @Cyrik

@riotrah riotrah marked this pull request as draft April 2, 2022 02:02
@riotrah riotrah changed the title Create new lint, test, format, watcher scripts and tasks Dev: Create new lint, test, format, watcher scripts and tasks Apr 2, 2022
@riotrah riotrah marked this pull request as ready for review April 2, 2022 02:58
@PEZ
Copy link
Collaborator

PEZ commented Apr 2, 2022

(I did not create an issue for this, @PEZ, should I?)

I think you should have. 😄 It's a thing I have that I like a problem statement for the records.

I'll be merging this as is and update it some. And link to this PR from the changelog.

@PEZ PEZ merged commit e779363 into BetterThanTomorrow:dev Apr 2, 2022
@PEZ
Copy link
Collaborator

PEZ commented Apr 2, 2022

Many thanks for this, @riotrah !!! 🎉 🙏

I updated things so that we have a default build task, Calva Dev that will run a Compile task and a Watch task in sequence. There is now a precompile script that cleans and builds the grammar (previously happened in prewatch). The Watch task runs Prettier in a panel group of its own and the TS and CLJS watchers and Linter in the same group.

This means that pressing cmd+b now starts with cleaning, npm i, update grammar, compile cljs, compile ts. Then starts prettier. and the other watchers. Looks like so when it is all done.

image

I've also added a custom connect sequence for :calva-lib. So when things are started we can press F5, then connect the REPL.

@riotrah riotrah deleted the wip/rayat/new-watcher-tasks-scripts branch April 2, 2022 16:37
@riotrah
Copy link
Member Author

riotrah commented Apr 2, 2022

Awesome!! The connect sequence will be useful for me to learn from, as I have not made use of that feature at all!

@riotrah
Copy link
Member Author

riotrah commented Apr 2, 2022

Questions:

  1. why have a compile-cljs pre step, when watch-cljs does that in a watch-mode?
  2. why has the semantics for the script or task named just "watch" changed from watching ts to watching cljs?

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.

2 participants