-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from Contentstack-Solutions/seed
Seed Plugin
- Loading branch information
Showing
36 changed files
with
73,125 additions
and
1,880 deletions.
There are no files selected for viewing
7,777 changes: 7,039 additions & 738 deletions
7,777
packages/contentstack-bulk-publish/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
10,775 changes: 10,765 additions & 10 deletions
10,775
packages/contentstack-clone/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
5,518 changes: 5,507 additions & 11 deletions
5,518
packages/contentstack-export-to-csv/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": [ | ||
"oclif", | ||
"oclif-typescript" | ||
], | ||
"rules": { | ||
"unicorn/no-abusive-eslint-disable": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/ban-ts-ignore": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*-debug.log | ||
*-error.log | ||
/.nyc_output | ||
/dist | ||
/lib | ||
/tmp | ||
/yarn.lock | ||
node_modules | ||
.DS_Store | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## Description | ||
This plugin allows you to quickly import existing Stacks that are needed to run sample apps. | ||
|
||
<!-- usagestop --> | ||
## Commands | ||
<!-- commands --> | ||
* [`csdx cm:seed`](#csdx-cmseed) | ||
|
||
## `csdx cm:seed` | ||
|
||
Create a Stack from existing content types, entries, assets, etc | ||
|
||
``` | ||
USAGE | ||
$ csdx cm:seed | ||
OPTIONS | ||
-r, --repo=repo GitHub account or GitHub account/repository | ||
EXAMPLES | ||
$ csdx cm:seed | ||
$ csdx cm:seed -r "account" | ||
$ csdx cm:seed -r "account/repository" | ||
``` | ||
|
||
_See code: [src/commands/cm/seed.ts](https://github.com/contentstack/cli/blob/v1.0.5/src/commands/cm/seed.ts)_ | ||
<!-- commandsstop --> | ||
|
||
## Advanced Flags | ||
The following flags allow you to host and import Stacks from your own GitHub repository. | ||
The account name can be a personal user account, organization account, or enterprise account. | ||
|
||
``` | ||
$ csdx cm:seed -r "account/repository" | ||
``` | ||
|
||
**Step 1.** Export a Stack | ||
|
||
Identify a Stack that you would like to export. | ||
This stack might be used in conjunction with a sample web site or mobile app you have created. | ||
|
||
Now, run `csdx cm:export` against it. The following documentation explains the [Export Plugin](https://www.contentstack.com/docs/developers/cli/export-content-using-cli/). | ||
|
||
In most cases, running `csdx cm:export -A` or `csdx cm:export -a "management token"` should work for you. | ||
|
||
The `csdx cm:seed` plugin uses the same libraries as `csdx cm:import`. | ||
|
||
**Step 2.** GitHub | ||
|
||
Once the Stack is exported: | ||
|
||
* Create a GitHub repository. | ||
* By convention, your repository name should be prefixed with `stack-`. For example: `stack-your-starter-app`. | ||
Doing so will allow the stack names to be found by the interactive prompt when running `csdx cm:seed -r "account"`. | ||
This step is optional. You can fully qualify the repository name if required: `csdx cm:seed -r "account/repo`. | ||
* Create a folder named `stack` within the newly created GitHub repository | ||
* Take the content from **Step 1** and commit it to the `stack` folder | ||
* Create a [Release](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository) | ||
|
||
The latest release will be downloaded and extracted, when a user attempts to install a Stack using: | ||
|
||
``` | ||
$ csdx cm:seed -r "account" | ||
$ csdx cm:seed -r "account/repository" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
require('@oclif/command').run() | ||
.catch(require('@oclif/errors/handle')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
node "%~dp0\run" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
"roots": [ | ||
"<rootDir>" | ||
], | ||
"testMatch": [ | ||
"**/tests/**/*.+(ts|tsx)", | ||
"**/?(*.)+(spec|test).+(ts|tsx)" | ||
], | ||
"transform": { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
} |
Oops, something went wrong.