Skip to content

Publishing the PK CLI for General Use #268

Description

@CMCDragonkai

Requirements of this design

The new structure of our projects is:

Polykey

  • js-polykey renames to Polykey
  • keeps all issues in js-polykey
  • license: GPL3 (possible move to APL3)
  • npm: polykey
  • not hosted on nix (it's not an application)
  • supports network API
  • embeddable as a library
  • bin/ code is extracted to Polykey-CLI
  • maintains wiki: theory, reference, guides, tutorials
  • maintains community discussions
  • main README.md (open source entry point)
  • requires cross-platform gitlab runner for building and QA of possibly-native addons

Polykey-CLI

  • license: GPL3
  • npm: polykey-cli
  • nix: polykey-cli
  • extracts bin/ code out of js-polykey
  • requires cross-platform gitlab runner for building and QA

Polykey-Desktop - electron/tauri wrapper around library code

  • license: GPL3
  • not hosted on npm (it's not a JS library or application)
  • nix: polykey-desktop
  • requires cross-platform gitlab runner for building & QA

Polykey-Mobile - nativescript wrapper around library code

  • license: unknown
  • not hosted on npm (it's not a JS library or application)
  • not hosted on nix (it's not a desktop application)
  • requires cross-platform gitlab runner for building & QA

We may not need to split out to Polykey-CLI just yet, but it can be done later.

Additional context

Specification

  1. - Undeprecate the NPM polykey, as Polykey Core library now uses polykey
  2. - Publish to polykey
  3. - Deprecate @matrixai/polykey and make it point to polykey and make the deprecated js-polykey and make it point to polykey

Activity

  1. added
    enhancementNew feature or request
    designRequires design
    epicBig issue with multiple subissues
    on Oct 26, 2021
  2. CMCDragonkai commented on Nov 12, 2021

    @CMCDragonkai
    MemberAuthor

    Review CLI exit codes in relation to sysexit standards

    Exceptions are currently using sysexit codes from this stanard: https://www.freebsd.org/cgi/man.cgi?query=sysexits&apropos=0&sektion=0&manpath=FreeBSD+4.3-RELEASE&format=html

    It's a good idea to review these exit codes and see how to ensure we all of our CLI commands are returning the proper exit codes.

  3. CMCDragonkai commented on Nov 19, 2021

    @CMCDragonkai
    MemberAuthor

    Bundling and Minification Step in our Release Executables

    Recommend attempting the usage of a minifier before we package it up using pkg. Right now tsc doesn't minify the JS code nor does it do any optimisations.

    Here's some resources:

    Basically, right now tsc produces the dist. We would want to pass the dist into a minifier/bundler like esbuild or terser or ncc, and then pass the final single file result to pkg.

    Ideally the "bundling" step should also perform optimisations like DCE.

    This should reduce the size of the final executable by a significant amount, possibly 70%, and it should also help with the performance of the code as in #277 since it won't need to load different files.

    However for npm publishing, it will still use dist as normal unminified and all. This makes it useful for libraries. This bundling step would only be done temporarily within our release builds to executables. It does not apply to application nor docker target.

  4. CMCDragonkai commented on Dec 15, 2021

    @CMCDragonkai
    MemberAuthor

    Should review the CLI error handling overall, see this thread: #278 (comment) and https://github.com/MatrixAI/js-polykey/wiki/API-Design

  5. CMCDragonkai commented on Dec 17, 2021

    @CMCDragonkai
    MemberAuthor

    Noticed that sometimes we need our --verbose messaging because by default only WARN messages are shown. Now some message are useful for the user. Some messages are useful for the debugger/developer. So we may need to raise our message levels internally to DEBUG. That way info messages useful to the user can still be shown. On the other hand, I'm not sure if I like this as well.

    Perhaps instead we need another level, or level of messages that is given interactively. That is one could say that messages intended for interactive usage can be this.logger.warn.

    Alternatively, interactive messages may need to go directly to process.stderr.write rather than using the logger even though the logger does use STDERR.

    Not entirely sure atm. Because this has to interact with formatting and error handling too.

  6. self-assigned this
    on Feb 18, 2022
  7. CMCDragonkai commented on Dec 8, 2022

    @CMCDragonkai
    MemberAuthor
  8. CMCDragonkai commented on Jul 6, 2023

    @CMCDragonkai
    MemberAuthor

    @tegefaulkes this is our epic for PK CLI. We can attach issues related to it here.

    Also all of the issues relating CLI stuff will get moved to Polykey-CLI.

  9. CMCDragonkai commented on Jul 10, 2023

    @CMCDragonkai
    MemberAuthor

    First we factor out, then we move issues.

  10. tegefaulkes commented on Jul 11, 2023

    @tegefaulkes
    Contributor

    K. I can split out the CLI soon. There are a lot of pending changes in the agent migration PR, so doing them side by side is not ideal. I can get the agent migration to a working state and merge that, some of the remaining tasks for that can be a 2nd PR.

    So I can merge #525, then split out the CLI, and complete the remainder of the migration. The remaining part should be consolidating the quic server and reverse connection handling into the node connection manager.

  11. CMCDragonkai commented on Aug 11, 2023

    @CMCDragonkai
    MemberAuthor

    Moving to Polykey-CLI.

  12. CMCDragonkai commented on Aug 11, 2023

    @CMCDragonkai
    MemberAuthor

    I'd say this is done... sort of. There's nothing more to do for this issue, but just massaging Polykey-CLI to be better.

    More specific issues can be created for integrating a bundler, compression, and maybe even replacing pkg with our own creation.

  13. CMCDragonkai commented on Aug 22, 2023

    @CMCDragonkai
    MemberAuthor

    Reopening this right now, cause there are few subissues to solve here as part of 6th testnet deployment.

  14. CMCDragonkai commented on Oct 18, 2023

    @CMCDragonkai
    MemberAuthor

    Now that things are built and PK CLI master and staging is synced, this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions