Prechádzať zdrojové kódy

Update cli name and version, add CI npm pack test

Leszek Wiesner 4 rokov pred
rodič
commit
9c165975ce

+ 14 - 2
.github/workflows/joystream-cli.yml

@@ -17,7 +17,13 @@ jobs:
     - name: checks
       run: |
         yarn install --frozen-lockfile
-        yarn workspace joystream-cli checks
+        yarn workspace @joystream/cli checks
+    - name: npm pack test
+      run: |
+        cd cli
+        npm pack | tail -1 | xargs tar xzf
+        cd package && npm link
+        joystream-cli help
 
   cli_build_osx:
     name: MacOS Checks
@@ -34,4 +40,10 @@ jobs:
     - name: checks
       run: |
         yarn install --frozen-lockfile --network-timeout 120000
-        yarn workspace joystream-cli checks
+        yarn workspace @joystream/cli checks
+    - name: npm pack test
+      run: |
+        cd cli
+        npm pack | tail -1 | xargs tar xzf
+        cd package && npm link
+        joystream-cli help

+ 9 - 9
cli/README.md

@@ -1,12 +1,12 @@
-joystream-cli
+@joystream/cli
 =============
 
 Command Line Interface for Joystream community and governance activities
 
 [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
-[![Version](https://img.shields.io/npm/v/joystream-cli.svg)](https://npmjs.org/package/joystream-cli)
-[![Downloads/week](https://img.shields.io/npm/dw/joystream-cli.svg)](https://npmjs.org/package/joystream-cli)
-[![License](https://img.shields.io/npm/l/joystream-cli.svg)](https://github.com/Joystream/cli/blob/master/package.json)
+[![Version](https://img.shields.io/npm/v/@joystream/cli.svg)](https://npmjs.org/package/@joystream/cli)
+[![Downloads/week](https://img.shields.io/npm/dw/@joystream/cli.svg)](https://npmjs.org/package/@joystream/cli)
+[![License](https://img.shields.io/npm/l/@joystream/cli.svg)](https://github.com/Joystream/cli/blob/master/package.json)
 
 <!-- toc -->
 * [Development](#development)
@@ -40,11 +40,11 @@ Alternatively:
 # Usage
 <!-- usage -->
 ```sh-session
-$ npm install -g joystream-cli
+$ npm install -g @joystream/cli
 $ joystream-cli COMMAND
 running command...
 $ joystream-cli (-v|--version|version)
-joystream-cli/0.0.0 linux-x64 node-v13.12.0
+@joystream/cli/0.1.0 linux-x64 node-v13.12.0
 $ joystream-cli --help [COMMAND]
 USAGE
   $ joystream-cli COMMAND
@@ -221,15 +221,15 @@ OPTIONS
       If no "--method" flag is provided then all methods in that module will be listed along with the descriptions.
 
   -a, --callArgs=callArgs
-      Specifies the arguments to use when calling a method. Multiple arguments can be separated with a comma, ie.
+      Specifies the arguments to use when calling a method. Multiple arguments can be separated with a comma, ie. 
       "-a=arg1,arg2".
       You can omit this flag even if the method requires some aguments.
       In that case you will be promted to provide value for each required argument.
-      Ommiting this flag is recommended when input parameters are of more complex types (and it's hard to specify them as
+      Ommiting this flag is recommended when input parameters are of more complex types (and it's hard to specify them as 
       just simple comma-separated strings)
 
   -e, --exec
-      Provide this flag if you want to execute the actual call, instead of displaying the method description (which is
+      Provide this flag if you want to execute the actual call, instead of displaying the method description (which is 
       default)
 
   -m, --method=method

+ 2 - 2
cli/package.json

@@ -1,7 +1,7 @@
 {
-  "name": "joystream-cli",
+  "name": "@joystream/cli",
   "description": "Command Line Interface for Joystream community and governance activities",
-  "version": "0.0.0",
+  "version": "0.1.0",
   "author": "Leszek Wiesner",
   "bin": {
     "joystream-cli": "./bin/run"

+ 2 - 1
cli/src/base/StateAwareCommandBase.ts

@@ -5,6 +5,7 @@ import { CLIError } from '@oclif/errors'
 import lockFile from 'proper-lockfile'
 import DefaultCommandBase from './DefaultCommandBase'
 import os from 'os'
+import _ from 'lodash'
 
 // Type for the state object (which is preserved as json in the state file)
 type StateObject = {
@@ -47,7 +48,7 @@ export default abstract class StateAwareCommandBase extends DefaultCommandBase {
     if (!packageJson || !packageJson.name) {
       throw new CLIError('Cannot get package name from package.json!')
     }
-    return path.join(systemAppDataPath, packageJson.name)
+    return path.join(systemAppDataPath, _.kebabCase(packageJson.name))
   }
 
   getStateFilePath(): string {