@contentstack/cli-command 2.0.0-beta.1 → 2.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +6 -5
  2. package/package.json +22 -20
package/lib/index.js CHANGED
@@ -7,8 +7,9 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
7
7
  const defaultRateLimit = 5;
8
8
  class ContentstackCommand extends cli_utilities_1.Command {
9
9
  get context() {
10
+ var _a;
10
11
  // @ts-ignore
11
- return this.config.context || {};
12
+ return this.config.context || ((_a = this.config.options) === null || _a === void 0 ? void 0 : _a.context) || {};
12
13
  }
13
14
  get email() {
14
15
  if (this._email)
@@ -44,7 +45,7 @@ class ContentstackCommand extends cli_utilities_1.Command {
44
45
  return defaultRateLimit;
45
46
  }
46
47
  get cmaHost() {
47
- let cma = this.region.cma;
48
+ const cma = this.region.cma;
48
49
  if (cma.startsWith('http')) {
49
50
  const u = new url_1.URL(cma);
50
51
  if (u.host)
@@ -53,7 +54,7 @@ class ContentstackCommand extends cli_utilities_1.Command {
53
54
  return cma;
54
55
  }
55
56
  get cdaHost() {
56
- let cda = this.region.cda;
57
+ const cda = this.region.cda;
57
58
  if (cda.startsWith('http')) {
58
59
  const u = new url_1.URL(cda);
59
60
  if (u.host)
@@ -65,11 +66,11 @@ class ContentstackCommand extends cli_utilities_1.Command {
65
66
  return this.region.uiHost;
66
67
  }
67
68
  get cdaAPIUrl() {
68
- let cda = this.region.cda;
69
+ const cda = this.region.cda;
69
70
  return cda.startsWith('http') ? cda : `https://${cda}`;
70
71
  }
71
72
  get cmaAPIUrl() {
72
- let cma = this.region.cma;
73
+ const cma = this.region.cma;
73
74
  return cma.startsWith('http') ? cma : `https://${cma}`;
74
75
  }
75
76
  getToken(alias) {
package/package.json CHANGED
@@ -1,44 +1,42 @@
1
1
  {
2
2
  "name": "@contentstack/cli-command",
3
3
  "description": "Contentstack CLI plugin for configuration",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.11",
5
5
  "author": "Contentstack",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {
9
+ "build": "pnpm compile",
9
10
  "prepack": "pnpm compile",
10
- "clean": "rm -rf ./lib ./node_modules tsconfig.build.tsbuildinfo",
11
+ "clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
11
12
  "compile": "tsc -b tsconfig.json",
12
- "test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
13
- "pretest": "tsc -p test",
14
- "posttest": "npm run lint",
15
- "lint": "eslint src/**/*.ts",
16
- "format": "eslint src/**/*.ts --fix",
17
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
18
- "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
19
- "test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
13
+ "test": "mocha \"test/unit/**/*.test.ts\"",
14
+ "lint": "eslint src/**/*.ts"
20
15
  },
21
16
  "dependencies": {
22
- "@contentstack/cli-utilities": "~2.0.0-beta.1",
23
- "contentstack": "^3.25.3",
24
- "@oclif/core": "^4.3.0",
25
- "@oclif/plugin-help": "^6.2.28"
17
+ "@contentstack/cli-utilities": "~2.0.0-beta.12",
18
+ "contentstack": "^3.27.0",
19
+ "@oclif/core": "^4.11.4"
20
+ },
21
+ "overrides": {
22
+ "@oclif/core": {
23
+ "picomatch": "^4.0.4"
24
+ }
26
25
  },
27
26
  "devDependencies": {
28
- "@oclif/test": "^4.1.13",
29
- "@types/mkdirp": "^1.0.2",
27
+ "@oclif/test": "^4.1.18",
30
28
  "@types/mocha": "^8.2.3",
31
29
  "@types/node": "^14.18.63",
32
- "eslint": "^8.57.1",
30
+ "eslint": "^10.5.0",
33
31
  "eslint-config-oclif": "^6.0.15",
34
- "eslint-config-oclif-typescript": "^3.1.13",
32
+ "eslint-config-oclif-typescript": "^3.1.14",
35
33
  "mocha": "10.8.2",
36
34
  "nyc": "^15.1.0",
37
35
  "ts-node": "^8.10.2",
38
36
  "typescript": "^4.9.5"
39
37
  },
40
38
  "engines": {
41
- "node": ">=14.0.0"
39
+ "node": ">=22.0.0"
42
40
  },
43
41
  "files": [
44
42
  "/types",
@@ -63,5 +61,9 @@
63
61
  "bin": "csdx",
64
62
  "repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-command/<%- commandPath %>"
65
63
  },
66
- "repository": "contentstack/cli"
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "git+https://github.com/contentstack/cli.git",
67
+ "directory": "packages/contentstack-command"
68
+ }
67
69
  }