@takeshape/cli 10.2.0 → 10.2.4

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.
@@ -72,7 +72,7 @@ const mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, par
72
72
  projectId,
73
73
  ...baseInput
74
74
  });
75
- if (!(baseQueryResult !== null && baseQueryResult !== void 0 && baseQueryResult.latestVersion)) {
75
+ if (!baseQueryResult?.latestVersion) {
76
76
  return (0, _fatalError.fatalError)('Base branch does not exist');
77
77
  }
78
78
  const {
@@ -88,7 +88,7 @@ const mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, par
88
88
  projectId,
89
89
  ...head
90
90
  });
91
- if (!(parentQueryResult !== null && parentQueryResult !== void 0 && parentQueryResult.parentVersion)) {
91
+ if (!parentQueryResult?.parentVersion) {
92
92
  return (0, _fatalError.fatalError)('Head branch does not exist');
93
93
  }
94
94
  base = parentQueryResult.parentVersion;
@@ -101,7 +101,7 @@ const mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, par
101
101
  ...base
102
102
  };
103
103
  const branchQueryResult = await getBranchQuery(client, targetParams);
104
- if (!(branchQueryResult !== null && branchQueryResult !== void 0 && branchQueryResult.latestVersion)) {
104
+ if (!branchQueryResult?.latestVersion) {
105
105
  return (0, _fatalError.fatalError)('Target branch does not exist');
106
106
  }
107
107
  const target = branchQueryResult.latestVersion;
@@ -20,9 +20,8 @@ var _default = (0, _linkedCommand.loggedInCommand)(async (_, params) => {
20
20
  const sites = await (0, _data.fetchSites)(params, project.value);
21
21
  let site;
22
22
  if (sites.length) {
23
- var _site;
24
23
  site = await (0, _prompt.promptList)('Select a site:', sites);
25
- if (((_site = site) === null || _site === void 0 ? void 0 : _site.value) === 'NONE') {
24
+ if (site?.value === 'NONE') {
26
25
  site = undefined;
27
26
  }
28
27
  }
@@ -35,7 +35,6 @@ const validate = async (cli, params) => {
35
35
  let project;
36
36
  if (params.authToken) {
37
37
  try {
38
- var _response$data;
39
38
  const client = (0, _graphql.createAdminConnector)(params, params.authToken, {
40
39
  environment: 'PRODUCTION',
41
40
  projectId: schema.projectId
@@ -46,7 +45,7 @@ const validate = async (cli, params) => {
46
45
  id: schema.projectId
47
46
  }
48
47
  });
49
- project = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.project;
48
+ project = response.data?.project;
50
49
  } catch {
51
50
  // Eat the error and use default entitlements
52
51
  }
package/dist/config.js CHANGED
@@ -75,8 +75,8 @@ async function writeLinkedProjectConfig(params, linkedApiKey, project, site) {
75
75
  const graphqlEndpoint = (0, _graphql.getGraphQLEndpoint)(params, project.value);
76
76
  const takeshaperc = {
77
77
  projectId: project.value,
78
- siteId: site === null || site === void 0 ? void 0 : site.value,
79
- siteName: site === null || site === void 0 ? void 0 : site.name,
78
+ siteId: site?.value,
79
+ siteName: site?.name,
80
80
  endpoint: params.endpoint,
81
81
  appUrl: params.appUrl,
82
82
  projectName: project.name,
package/dist/util/api.js CHANGED
@@ -33,11 +33,10 @@ function getAuthHeader(authToken) {
33
33
  };
34
34
  }
35
35
  async function api(params, method, path, body) {
36
- var _params$linkedApiKey;
37
36
  const requestParams = {
38
37
  method,
39
38
  headers: {
40
- ...getAuthHeader(params.authToken ?? ((_params$linkedApiKey = params.linkedApiKey) === null || _params$linkedApiKey === void 0 ? void 0 : _params$linkedApiKey.apiKey)),
39
+ ...getAuthHeader(params.authToken ?? params.linkedApiKey?.apiKey),
41
40
  'Content-Type': 'application/json'
42
41
  }
43
42
  };
@@ -12,5 +12,5 @@ function createConnector(params, branchParams, options) {
12
12
  ...branchParams,
13
13
  projectId: params.projectId
14
14
  }, options));
15
- return options !== null && options !== void 0 && options.cache ? (0, _cachedConnector.connectorWithCache)(connector) : connector;
15
+ return options?.cache ? (0, _cachedConnector.connectorWithCache)(connector) : connector;
16
16
  }
package/dist/util/data.js CHANGED
@@ -55,7 +55,7 @@ async function fetchProjects(params) {
55
55
  } = await client({
56
56
  query: projectListQuery
57
57
  });
58
- return data.projects.filter(p => (p === null || p === void 0 ? void 0 : p.invite) === null);
58
+ return data.projects.filter(p => p?.invite === null);
59
59
  } catch (e) {
60
60
  throw (0, _errors.formatErrorMessage)(e, 'fetching your projects');
61
61
  }
@@ -22,7 +22,7 @@ function createRunner(name, task) {
22
22
  const {
23
23
  warnings
24
24
  } = stats;
25
- if (warnings !== null && warnings !== void 0 && warnings.length) {
25
+ if (warnings?.length) {
26
26
  (0, _log.default)(`${name} - ` + _chalk.default.yellow('Warnings:'));
27
27
  warnings.forEach(warning => {
28
28
  (0, _log.default)(_chalk.default.yellow(`${warning.source}: ${warning.message}`));
package/dist/util/spin.js CHANGED
@@ -19,7 +19,7 @@ async function spin(spinQuery) {
19
19
  case 'timeout':
20
20
  throw new Error('Export timed out');
21
21
  case 'error':
22
- if (res !== null && res !== void 0 && res.message) {
22
+ if (res?.message) {
23
23
  throw new Error(res.message);
24
24
  } else {
25
25
  throw new Error('An unknown error occurred');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/cli",
3
- "version": "10.2.0",
3
+ "version": "10.2.4",
4
4
  "description": "TakeShape CLI",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -54,15 +54,15 @@
54
54
  "semver": "^6.3.0",
55
55
  "stream-to-promise": "^2.2.0",
56
56
  "tmp": "^0.0.33",
57
- "@takeshape/branches": "10.2.0",
58
- "@takeshape/ssg": "10.2.0",
59
- "@takeshape/schema": "10.2.0",
60
- "@takeshape/streams": "10.2.0",
61
- "@takeshape/util": "10.2.0"
57
+ "@takeshape/branches": "10.2.4",
58
+ "@takeshape/schema": "10.2.4",
59
+ "@takeshape/ssg": "10.2.4",
60
+ "@takeshape/streams": "10.2.4",
61
+ "@takeshape/util": "10.2.4"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/archiver": "^3.1.0",
65
- "@types/async-retry": "^1.4.2",
65
+ "@types/async-retry": "^1.4.8",
66
66
  "@types/fs-extra": "^8.1.0",
67
67
  "@types/glob": "^7.1.1",
68
68
  "@types/inquirer": "^7.3.1",
@@ -80,10 +80,10 @@
80
80
  "graphql": "16.6.0",
81
81
  "nock": "^13.2.9",
82
82
  "unzipper": "^0.10.11",
83
- "@takeshape/typescript-jest-junit-reporter": "10.2.0"
83
+ "@takeshape/typescript-jest-junit-reporter": "10.2.4"
84
84
  },
85
85
  "engines": {
86
- "node": ">=16"
86
+ "node": ">=18"
87
87
  },
88
88
  "scripts": {
89
89
  "build": "pnpm build:types && pnpm build:js && pnpm build:copy",