@gitbeaker/cli 40.0.2 → 40.1.0

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.
package/README.md CHANGED
@@ -101,8 +101,6 @@ GITLAB_TOKEN=personaltoken
101
101
  GITBEAKER_CAMELIZE=true
102
102
  ```
103
103
 
104
- This could be set globally or using a [.env](https://github.com/motdotla/dotenv#readme) file in the project folder.
105
-
106
104
  </td></tr>
107
105
  </tbody>
108
106
  </table>
@@ -224,6 +222,7 @@ This could be set globally or using a [.env](https://github.com/motdotla/dotenv#
224
222
  <td align="center" valign="top" width="0.33%"><a href="https://github.com/elaine-mattos"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/79633988?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Elaine Mattos"/></td>
225
223
  <td align="center" valign="top" width="0.33%"><a href="https://github.com/vitamindck"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/10766587?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="DK"/></td>
226
224
  <td align="center" valign="top" width="0.33%"><a href="http://www.koenbrouwer.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/3260168?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Koen Brouwer"/></td>
225
+ <td align="center" valign="top" width="0.33%"><a href="https://scrumplex.net/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11587657?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Sefa Eyeoglu"/></td>
227
226
  </tr>
228
227
  </p>
229
228
 
package/dist/index.mjs CHANGED
@@ -42,10 +42,8 @@ function normalizeEnviromentVariables(env) {
42
42
  "PROFILE_MODE"
43
43
  ];
44
44
  suffixes.forEach((s) => {
45
- if (env[`GITLAB_${s}`])
46
- normalized[`GITBEAKER_${s}`] = env[`GITLAB_${s}`];
47
- if (env[`GITBEAKER_${s}`])
48
- normalized[`GITBEAKER_${s}`] = env[`GITBEAKER_${s}`];
45
+ if (env[`GITLAB_${s}`]) normalized[`GITBEAKER_${s}`] = env[`GITLAB_${s}`];
46
+ if (env[`GITBEAKER_${s}`]) normalized[`GITBEAKER_${s}`] = env[`GITBEAKER_${s}`];
49
47
  });
50
48
  return normalized;
51
49
  }
@@ -55,15 +53,12 @@ function buildArgumentObjects(globalConfig, method, rawArgs) {
55
53
  const optionalArgs = {};
56
54
  const initArgs = {};
57
55
  Object.entries(rawArgs).forEach(([argName, value]) => {
58
- if (ignoreOptions.includes(argName) || value == null)
59
- return;
56
+ if (ignoreOptions.includes(argName) || value == null) return;
60
57
  const camelCased = camelize(argName.replace("gb-", "").replace("gl-", ""), "-");
61
58
  if (globalConfig[argName.replace("gl-", "gb-")]) {
62
59
  initArgs[camelCased] = value;
63
- } else if (method.args.includes(camelCased))
64
- coreArgs[camelCased] = value;
65
- else
66
- optionalArgs[camelCased] = value;
60
+ } else if (method.args.includes(camelCased)) coreArgs[camelCased] = value;
61
+ else optionalArgs[camelCased] = value;
67
62
  });
68
63
  return {
69
64
  initArgs,
@@ -74,8 +69,7 @@ function buildArgumentObjects(globalConfig, method, rawArgs) {
74
69
  function getDisplayConfig(globalConfig) {
75
70
  const display = {};
76
71
  Object.entries(globalConfig).forEach(([k, v]) => {
77
- if (v.defaultValue == null)
78
- return;
72
+ if (v.defaultValue == null) return;
79
73
  display[k] = {
80
74
  alias: v.alias,
81
75
  description: v.desc,
@@ -191,7 +185,7 @@ var usageStyle = Chalk.hex("#fc6e26").bold;
191
185
  var optionStyle = Chalk.white.bold;
192
186
  var descriptionStyle = Chalk.hex("#848484");
193
187
  var hintStyle = Chalk.hex("#6a5f88");
194
- var cli = Sywac.version("-v, --version").help("-h, --help").showHelpByDefault().epilogue("Copyright 2023").style({
188
+ var cli = Sywac.version("-v, --version").help("-h, --help").showHelpByDefault().epilogue(`Copyright ${(/* @__PURE__ */ new Date()).getFullYear()}`).style({
195
189
  usagePrefix: usageStyle,
196
190
  group: groupStyle,
197
191
  flags: optionStyle,
@@ -204,8 +198,7 @@ cli.boolean("-g --global-args", {
204
198
  desc: "Show global arguments currently set in the environment variables"
205
199
  });
206
200
  cli.command("*", (argv, ctx) => {
207
- if (!argv.g)
208
- return;
201
+ if (!argv.g) return;
209
202
  const globalConfig = getGlobalConfig();
210
203
  const display = getDisplayConfig(globalConfig);
211
204
  ctx.output = Object.keys(display).length === 0 ? "No global variables have been set!" : JSON.stringify(display, null, 3);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@gitbeaker/cli",
3
- "version": "40.0.2",
3
+ "version": "40.1.0",
4
4
  "description": "CLI implementation of the GitLab API.",
5
5
  "license": "MIT",
6
6
  "engines": {
7
- "node": ">=18.0.0"
7
+ "node": ">=18.20.0"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
@@ -31,22 +31,22 @@
31
31
  "dist"
32
32
  ],
33
33
  "scripts": {
34
- "build": "tsup src/index.ts --format esm --treeshake --target node18",
34
+ "build": "tsup src/index.ts --format esm --treeshake --target esnext",
35
35
  "test:unit": "jest --maxWorkers=50% test/unit",
36
36
  "test:e2e": "jest --maxWorkers=50% test/e2e",
37
37
  "lint": "eslint '**/{src,test,scripts}/**/*.ts'",
38
38
  "lint:fix": "yarn lint --fix"
39
39
  },
40
40
  "dependencies": {
41
- "@gitbeaker/core": "^40.0.2",
42
- "@gitbeaker/rest": "^40.0.2",
41
+ "@gitbeaker/core": "^40.1.0",
42
+ "@gitbeaker/rest": "^40.1.0",
43
43
  "chalk": "4.1.2",
44
44
  "sywac": "^1.3.0",
45
45
  "xcase": "^2.0.1"
46
46
  },
47
47
  "devDependencies": {
48
- "tsup": "^8.0.1",
49
- "typescript": "^5.3.3"
48
+ "tsup": "^8.1.0",
49
+ "typescript": "^5.5.3"
50
50
  },
51
- "gitHead": "371194377c652d86497d6345963e03d9e534b940"
51
+ "gitHead": "312d4dc3eb7938b30ddf2b314297b3a535d5e7bc"
52
52
  }