joplin icon indicating copy to clipboard operation
joplin copied to clipboard

CLI: Create Subnotebooks

Open k33pn3xtlvl opened this issue 1 year ago • 20 comments


Update: The purpose of this PR allows the user to create subnotebooks in the cli also independently of his currently selected notebook position


This should be the last PR for #1728 (Pre PR request https://github.com/laurent22/joplin/pull/6671)

I have port the command-mkbook to TypeScript, the reason is simple i wanted to try TypeScript and the opportunity was perfect.
All tests from the root folder are successful, exclude cli-integration.sh (read below). In addition to this the possibility for creating of the sub-notebooks from different places was added.

However, i would need a few tips for the tests.

  1. Is the cli-integration.sh old stuff?
    When I run it, i get an error message Error: Cannot open database: Trying to access nodeSqlite before it has been set!!!:
    This should have been fixed in the function https://github.com/laurent22/joplin/blob/a114e1b5f771538e8781d8da10abd97f07263a35/packages/lib/testing/test-utils.ts#L328

    If i understand it right, it seems not to work since the commit 4a7746b as the package shim was added. Additing to it the shell script is not used anywhere (Maybe i am wrong with both).

  2. Exist one test function which i can use to test mkbook from the tui? If not, i will use something similar to cli-integration-tests execCommand or the execCommand2

k33pn3xtlvl avatar Aug 06 '22 16:08 k33pn3xtlvl

Can anyone answer my question above? Thanks in advance! @laurent22 @personalizedrefrigerator

k33pn3xtlvl avatar Aug 10 '22 18:08 k33pn3xtlvl

Also please remove the translation files. We do that in separate commits

laurent22 avatar Aug 11 '22 11:08 laurent22

And you can ignore cli-integration.sh, it's deprecated

laurent22 avatar Aug 11 '22 11:08 laurent22

Also please remove the translation files. We do that in separate commits

Do i understand it right that i need to do a second PR with the modified translation files? Or will it be done in a different workflow for example from the maintainer side?

k33pn3xtlvl avatar Aug 11 '22 13:08 k33pn3xtlvl

Do i understand it right that i need to do a second PR with the modified translation files? Or will it be done in a different workflow for example from the maintainer side?

Yes from the maintainer side. We run a script that updates all translations in one commit

laurent22 avatar Aug 11 '22 14:08 laurent22

Tests are added now. Please give me feedback if i can improve anything in the tests.

From my side both PRs (#6671, #6722) are ready for merge.

k33pn3xtlvl avatar Aug 14 '22 20:08 k33pn3xtlvl

@laurent22 Can you merge it or is anything from my side to do? People can test the pre-release maybe they will found some good improve ideas.

k33pn3xtlvl avatar Aug 25 '22 07:08 k33pn3xtlvl

Test should also be fixed as well as @laurent22 improvement suggestions.

k33pn3xtlvl avatar Aug 30 '22 01:08 k33pn3xtlvl

The pull request top post should include a full description of the feature: what it does, how it does it, with examples of command lines. We don't read what's linked as the info is usually incomplete.

laurent22 avatar Sep 30 '22 15:09 laurent22

The pull request top post should include a full description of the feature: what it does, how it does it, with examples of command lines. We don't read what's linked as the info is usually incomplete.

After a few conversations, I get the information that you are not reading what is linked.... As i have seen it, the contributing readme has beend adjusted yesterday. https://github.com/laurent22/joplin/commit/9781a33419e425748c3a59c2ffc3d65893419ac0 - Adjust the Description

@laurent22 i have asked several questions https://github.com/laurent22/joplin/pull/6722#discussion_r976444547 to which I would need an answer, so than i can continue...

k33pn3xtlvl avatar Oct 01 '22 12:10 k33pn3xtlvl

Still looking forward to this feature! As I understand it, you can only create sub-notebooks using the desktop version. I use the Android app and the CLI version but not the desktop version, so this is rather inconvenient.

charlescochran avatar Oct 04 '22 14:10 charlescochran

As I have not received a reply to my message regarding a decision. I am removing the tests to speed up the CI pipeline as I described in Solution 1.

k33pn3xtlvl avatar Oct 30 '22 22:10 k33pn3xtlvl

Should be done now - tests have run cleanly.

k33pn3xtlvl avatar Nov 05 '22 04:11 k33pn3xtlvl

What is the next step for this?

charlescochran avatar Nov 20 '22 23:11 charlescochran

Conflicts need to be fixed and branch rebased. Also run "yarn run updateIgnored" from root

laurent22 avatar Nov 21 '22 00:11 laurent22

Conflicts need to be fixed and branch rebased. Also run "yarn run updateIgnored" from root

A merge instead of rebase was performed also yarn run updateIgnored from root Tests have gone cleanly.

@charlescochran thanks for keeping up!

k33pn3xtlvl avatar Nov 22 '22 00:11 k33pn3xtlvl

recheck

laurent22 avatar Dec 21 '22 17:12 laurent22

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Dec 21 '22 17:12 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

k33pn3xtlvl avatar Dec 30 '22 13:12 k33pn3xtlvl

@laurent22 You have really earned the beer / coffee! Please check again if the improvements fit like this.

k33pn3xtlvl avatar Dec 30 '22 13:12 k33pn3xtlvl

@k33pn3xtlvl, we plan to release a new version 2.10 of the CLI app and hopefully your feature can be included. Please let me know if you need anything to get this completed!

laurent22 avatar Feb 20 '23 13:02 laurent22

I'm currently busy, I'll do it this week (probably today or the day after tomorrow). Thanks for your support.

k33pn3xtlvl avatar Feb 21 '23 13:02 k33pn3xtlvl

@laurent22 Please look over it again. Thanks in advance!

k33pn3xtlvl avatar Feb 22 '23 00:02 k33pn3xtlvl

All good now, thanks @k33pn3xtlvl!

laurent22 avatar Feb 26 '23 12:02 laurent22