Skip to content

Commit 8273b19

Browse files
author
ninadhatkar
committed
updates readme files and package.json remove unused pack script updates api for git repo serach in seed
1 parent 9aedb53 commit 8273b19

12 files changed

Lines changed: 59 additions & 17 deletions

File tree

packages/auth/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-auth
1616
$ csdx COMMAND
1717
running command...
1818
$ csdx (-v|--version|version)
19-
@contentstack/cli-auth/0.1.1-beta.1 darwin-x64 node-v10.19.0
19+
@contentstack/cli-auth/0.1.1-beta.1 darwin-x64 node-v13.14.0
2020
$ csdx --help [COMMAND]
2121
USAGE
2222
$ csdx COMMAND
@@ -37,6 +37,8 @@ USAGE
3737
Login to Contentstack and save the session for further use
3838

3939
```
40+
Login to Contentstack and save the session for further use
41+
4042
USAGE
4143
$ csdx auth:login
4244
@@ -54,6 +56,8 @@ _See code: [src/commands/auth/login.js](https://github.com/contentstack/cli/blob
5456
Log out from Contentstack and clear the session
5557

5658
```
59+
Log out from Contentstack and clear the session
60+
5761
USAGE
5862
$ csdx auth:logout
5963
@@ -71,6 +75,9 @@ _See code: [src/commands/auth/logout.js](https://github.com/contentstack/cli/blo
7175
Lists all existing tokens added to the session
7276

7377
```
78+
Lists all existing tokens added to the session
79+
80+
7481
USAGE
7582
$ csdx auth:tokens
7683
@@ -95,6 +102,9 @@ _See code: [src/commands/auth/tokens/index.js](https://github.com/contentstack/c
95102
Adds management/delivery tokens to your session to use it with further CLI command
96103

97104
```
105+
Adds management/delivery tokens to your session to use it with further CLI command
106+
by default it adds management token if either of management or delivery flags are not set
107+
98108
USAGE
99109
$ csdx auth:tokens:add
100110
@@ -123,6 +133,8 @@ _See code: [src/commands/auth/tokens/add.js](https://github.com/contentstack/cli
123133
Removes stored tokens
124134

125135
```
136+
Removes stored tokens
137+
126138
USAGE
127139
$ csdx auth:tokens:remove
128140
@@ -143,6 +155,9 @@ _See code: [src/commands/auth/tokens/remove.js](https://github.com/contentstack/
143155
Display current users email address
144156

145157
```
158+
Display current users email address
159+
160+
146161
USAGE
147162
$ csdx auth:whoami
148163
6.3 KB
Binary file not shown.

packages/auth/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
},
5151
"repository": "https://github.com/contentstack/cli",
5252
"scripts": {
53-
"pack": "npm pack && mv *.tgz ../../build/",
5453
"postpack": "rm -f oclif.manifest.json",
5554
"posttest": "npx eslint .",
5655
"prepack": "oclif-dev manifest && oclif-dev readme",

packages/contentstack-bulk-publish/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
1717
$ csdx COMMAND
1818
running command...
1919
$ csdx (-v|--version|version)
20-
@contentstack/cli-cm-bulk-publish/0.1.1-beta.2 darwin-x64 node-v14.9.0
20+
@contentstack/cli-cm-bulk-publish/0.1.1-beta.2 darwin-x64 node-v13.14.0
2121
$ csdx --help [COMMAND]
2222
USAGE
2323
$ csdx COMMAND

packages/contentstack-bulk-publish/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
},
5757
"repository": "https://github.com/contentstack/cli",
5858
"scripts": {
59-
"pack": "npm pack && mv *.tgz ../../build",
6059
"postpack": "rm -f oclif.manifest.json",
6160
"prepack": "oclif-dev manifest && oclif-dev readme",
6261
"test": "nyc mocha --forbid-only \"test/**/*.test.js\"",

packages/contentstack-export/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
],
5353
"license": "MIT",
5454
"scripts": {
55-
"pack": "npm pack && mv *.tgz ../../build",
5655
"postpack": "rm -f oclif.manifest.json",
5756
"prepack": "oclif-dev manifest && oclif-dev readme",
5857
"test": "nyc mocha --forbid-only \"test/**/*.test.js\"",

packages/contentstack-import/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ USAGE
2929

3030
## `csdx cm:import`
3131

32-
Import script for importing the content into new stack
33-
3432
```
3533
USAGE
3634
$ csdx cm:import

packages/contentstack-seed/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Description
2-
This plugin allows you to quickly import existing Stacks that are needed to run sample apps.
2+
The “seed” command in Contentstack CLI allows users to import content to your stack, from Github repositories. It's an effective command that can help you to migrate content to your stack with minimal steps.
3+
4+
To import content to your stack, you can choose from the following two sources:
5+
6+
**Contentstack’s organization**: In this organization, we have provided sample content, which you can import directly to your stack using the seed command.
7+
8+
**Github’s repository**: You can import content available on Github’s repository belonging to an organization or an individual.
39

410
<!-- usagestop -->
511
## Commands
@@ -23,7 +29,7 @@ EXAMPLES
2329
$ csdx cm:seed -r "account/repository"
2430
```
2531

26-
_See code: [src/commands/cm/seed.ts](https://github.com/contentstack/cli/blob/v1.0.5/src/commands/cm/seed.ts)_
32+
_See code: [src/commands/cm/seed.ts](https://github.com/contentstack/cli/blob/v1.0.6/src/commands/cm/seed.ts)_
2733
<!-- commandsstop -->
2834

2935
## Advanced Flags
@@ -63,3 +69,6 @@ The latest release will be downloaded and extracted, when a user attempts to ins
6369
$ csdx cm:seed -r "account"
6470
$ csdx cm:seed -r "account/repository"
6571
```
72+
73+
## Documentation
74+
To get more detailed documentation of this command, visit the Seed command documentation on our docs.

packages/contentstack-seed/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"repository": "contentstack/cli",
6161
"scripts": {
6262
"test": "jest",
63+
"pack": "npm pack --dry-run",
6364
"postpack": "rm -f oclif.manifest.json",
6465
"posttest": "eslint . --ext .ts --config .eslintrc",
6566
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",

packages/contentstack-seed/src/seed/github/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ export default class GitHubClient {
2828
return result
2929
}
3030

31-
constructor(public username: string) {
31+
constructor(public username: string, defaultStackPattern: string) {
3232
this.gitHubRepoUrl = `https://api.github.com/repos/${username}`
33-
this.gitHubUserUrl = `https://api.github.com/users/${username}`
33+
this.gitHubUserUrl = `https://api.github.com/search/repositories?q=org%3A${username}+in:name+${defaultStackPattern}`
3434
}
3535

3636
async getAllRepos(count = 100) {
3737
try {
38-
const response = await axios.get(`${this.gitHubUserUrl}/repos?per_page=${count}&sort=full_name&type=public`)
39-
return response.data
38+
const response = await axios.get(`${this.gitHubUserUrl}&per_page=${count}`)
39+
return response.data.items
4040
} catch (error) {
4141
throw this.buildError(error)
4242
}

0 commit comments

Comments
 (0)