Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/import setup command base #1627

Merged
merged 30 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c125f6e
import pre setup command base code
shafeeqd959 Sep 3, 2024
c1b5036
Merge branch 'development' into feat/import-setup-command
shafeeqd959 Sep 3, 2024
2afb274
Merge branch 'development' of github.com:contentstack/cli into feat/i…
shafeeqd959 Sep 3, 2024
2524800
Merge branch 'feat/import-setup-command' of github.com:contentstack/c…
shafeeqd959 Sep 3, 2024
de67ada
deleted env
shafeeqd959 Sep 3, 2024
c8df043
changes
shafeeqd959 Sep 3, 2024
6db05e3
content type update
shafeeqd959 Sep 3, 2024
c246db6
Merge pull request #1542 from contentstack/feat/import-setup-command
shafeeqd959 Sep 4, 2024
5b2373d
Merge branch 'development' of github.com:contentstack/cli into feat/i…
shafeeqd959 Oct 9, 2024
93c4a34
content type basic setup
shafeeqd959 Oct 11, 2024
02b9881
Merge branch 'development' of github.com:contentstack/cli into feat/i…
shafeeqd959 Oct 11, 2024
eb000b8
lock file update
shafeeqd959 Oct 11, 2024
ef6afad
feat: added taxonomy mapper file support in import setup
aman19K Oct 23, 2024
574bb3d
Merge pull request #1643 from contentstack/feat/DX-1608
aman19K Oct 23, 2024
ffa4ccf
asset mapper file creation
shafeeqd959 Oct 24, 2024
afa0e11
fixed conflicts
shafeeqd959 Oct 24, 2024
baeaa9f
Merge pull request #1644 from contentstack/feat/import-setup-asset-ma…
shafeeqd959 Oct 25, 2024
93da7af
asset mapper, marketplace
shafeeqd959 Nov 6, 2024
9311979
merged changes
shafeeqd959 Nov 6, 2024
4c35079
Merge branch 'feat/import-setup-command-base' into feat/import-setup-…
shafeeqd959 Nov 6, 2024
dc4db88
Merge pull request #1663 from contentstack/feat/import-setup-asset-ma…
shafeeqd959 Nov 6, 2024
b9506d7
entry integration
shafeeqd959 Nov 7, 2024
b5e5fde
import setup command
shafeeqd959 Dec 5, 2024
efdf604
import setup command
shafeeqd959 Dec 5, 2024
cb0cfb6
release pipeline changes
shafeeqd959 Dec 5, 2024
587a9f8
removed tsconfig
shafeeqd959 Dec 5, 2024
c8d2651
fixed region
shafeeqd959 Dec 5, 2024
f09aea9
review changes added
shafeeqd959 Dec 6, 2024
483e788
Merge branch 'development' of github.com:contentstack/cli into feat/i…
shafeeqd959 Dec 6, 2024
ef6fc05
log level update
shafeeqd959 Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,23 @@ jobs:
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-clone/package.json
- name: Installing dependencies of import-setup
id: import-setup-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_import_setup == 'true'}}
working-directory: ./packages/contentstack-import-setup
run: npm install
- name: Compiling import-setup
if: ${{ steps.import-setup-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-import-setup
run: npm run prepack
- name: Publishing import-setup
uses: JS-DevTools/[email protected]
if: ${{ steps.import-setup-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-import-setup/package.json
access: public
tag: beta
- name: Installing dependencies of export to csv
id: export-to-csv-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_export-to-csv == 'true'}}
Expand Down
3,545 changes: 868 additions & 2,677 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.7.3 darwin-arm64 node-v22.8.0
@contentstack/cli-audit/1.7.3 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -269,7 +269,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/index.ts)_

## `csdx plugins:add PLUGIN`

Expand Down Expand Up @@ -343,7 +343,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN`

Expand Down Expand Up @@ -392,7 +392,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/install.ts)_

## `csdx plugins:link PATH`

Expand Down Expand Up @@ -423,7 +423,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/link.ts)_

## `csdx plugins:remove [PLUGIN]`

Expand Down Expand Up @@ -464,7 +464,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/reset.ts)_

## `csdx plugins:uninstall [PLUGIN]`

Expand Down Expand Up @@ -492,7 +492,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/uninstall.ts)_

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -536,5 +536,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.17/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.19/src/commands/plugins/update.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.3.22 darwin-arm64 node-v22.8.0
@contentstack/cli-auth/1.3.22 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.13.0 darwin-arm64 node-v22.8.0
@contentstack/cli-cm-bootstrap/1.13.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.2.0 darwin-arm64 node-v22.8.0
@contentstack/cli-cm-branches/1.2.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.7.0 darwin-arm64 node-v22.8.0
@contentstack/cli-cm-bulk-publish/1.7.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.13.0 darwin-arm64 node-v22.8.0
@contentstack/cli-cm-clone/1.13.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.9.0 darwin-arm64 node-v22.8.0
@contentstack/cli-config/1.9.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.14.1 darwin-arm64 node-v22.8.0
@contentstack/cli-cm-export/1.14.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 2 additions & 0 deletions packages/contentstack-import-setup/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Build files
./lib
56 changes: 56 additions & 0 deletions packages/contentstack-import-setup/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
"oclif-typescript",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "none"
}
],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-redeclare": "off",
"eqeqeq": [
"error",
"smart"
],
"id-match": "error",
"no-eval": "error",
"no-var": "error",
"quotes": "off",
"indent": "off",
"camelcase": "off",
"comma-dangle": "off",
"arrow-parens": "off",
"operator-linebreak": "off",
"object-curly-spacing": "off",
"node/no-missing-import": "off",
"lines-between-class-members": "off",
"padding-line-between-statements": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"unicorn/no-abusive-eslint-disable": "off",
"@typescript-eslint/no-explicit-any": "off",
"unicorn/consistent-function-scoping": "off",
"@typescript-eslint/no-use-before-define": "off"
}
}
14 changes: 14 additions & 0 deletions packages/contentstack-import-setup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/lib
/tmp
/yarn.lock
node_modules
.DS_Store
coverage
.vscode/
/lib

.env
8 changes: 8 additions & 0 deletions packages/contentstack-import-setup/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": ["test/helpers/init.js", "ts-node/register", "source-map-support/register"],
"watch-extensions": [
"ts"
],
"recursive": true,
"timeout": 5000
}
5 changes: 5 additions & 0 deletions packages/contentstack-import-setup/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"inlcude": [
"lib/**/*.js"
]
}
7 changes: 7 additions & 0 deletions packages/contentstack-import-setup/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
}
21 changes: 21 additions & 0 deletions packages/contentstack-import-setup/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
115 changes: 115 additions & 0 deletions packages/contentstack-import-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@contentstack/cli-cm-import

It is Contentstack’s CLI plugin to import content in the stack. To learn how to export and import content in Contentstack, refer to the [Migration guide](https://www.contentstack.com/docs/developers/cli/migration/).

[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE)it -m

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->

For switching to EU region update the hosts at config/default.js

```js
{
host:'https://eu-api.contentstack.com/v3',
cdn: 'https://eu-cdn.contentstack.com/v3',
...
}
```

For switching to AZURE-NA region update the hosts at config/default.js

```js
{
host:'https://azure-na-api.contentstack.com/v3',
cdn: 'https://azure-na-cdn.contentstack.com/v3'
...
}
```

For switching to AZURE-EU region update the hosts at config/default.js

```js
{
host:'https://azure-eu-api.contentstack.com/v3',
cdn: 'https://azure-eu-cdn.contentstack.com/v3'
...
}
```

# Usage

<!-- usage -->
```sh-session
$ npm install -g @contentstack/cli-cm-import-setup
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import-setup/1.0.0-beta.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
...
```
<!-- usagestop -->

# Commands

<!-- commands -->
* [`csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue)
* [`csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue-1)

## `csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`

Import content from a stack

```
USAGE
$ csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]

FLAGS
-a, --alias=<value> alias of the management token
-d, --data-dir=<value> path and location where data is stored
-k, --stack-api-key=<value> API key of the target stack
--modules=<option> [optional] specific module name
<options: content-types|entries|both>

DESCRIPTION
Import content from a stack

ALIASES
$ csdx cm:import-setup

EXAMPLES
$ csdx cm:stacks:import-setup --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir> --modules <module_name, module_name>
```

## `csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`

Import content from a stack

```
USAGE
$ csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]

FLAGS
-a, --alias=<value> alias of the management token
-d, --data-dir=<value> path and location where data is stored
-k, --stack-api-key=<value> API key of the target stack
--modules=<option> [optional] specific module name
<options: content-types|entries|both>

DESCRIPTION
Import content from a stack

ALIASES
$ csdx cm:import-setup

EXAMPLES
$ csdx cm:stacks:import-setup --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir> --modules <module_name, module_name>
```

_See code: [src/commands/cm/stacks/import-setup.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-import-setup/src/commands/cm/stacks/import-setup.ts)_
<!-- commandsstop -->
Loading
Loading