@requence/task 1.0.0-alpha.13 → 1.0.0-alpha.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @requence/task
2
2
 
3
+ ## 1.0.0-alpha.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 45d26fc: fixed task access token retrieval
8
+
9
+ ## 1.0.0-alpha.14
10
+
11
+ ### Patch Changes
12
+
13
+ - 3a5e3e2: allow more access token options
14
+
3
15
  ## 1.0.0-alpha.13
4
16
 
5
17
  ### Patch Changes
package/build/cli.js CHANGED
@@ -1376,12 +1376,10 @@ class Y18N {
1376
1376
  return this._taggedLiteral(arguments[0], ...arguments);
1377
1377
  }
1378
1378
  const str = args.shift();
1379
- let cb = function() {
1380
- };
1379
+ let cb = function() {};
1381
1380
  if (typeof args[args.length - 1] === "function")
1382
1381
  cb = args.pop();
1383
- cb = cb || function() {
1384
- };
1382
+ cb = cb || function() {};
1385
1383
  if (!this.cache[this.locale])
1386
1384
  this._readLocaleFile();
1387
1385
  if (!this.cache[this.locale][str] && this.updateFiles) {
@@ -1401,8 +1399,7 @@ class Y18N {
1401
1399
  const singular = args.shift();
1402
1400
  const plural = args.shift();
1403
1401
  const quantity = args.shift();
1404
- let cb = function() {
1405
- };
1402
+ let cb = function() {};
1406
1403
  if (typeof args[args.length - 1] === "function")
1407
1404
  cb = args.pop();
1408
1405
  if (!this.cache[this.locale])
@@ -1838,8 +1835,7 @@ class CommandInstance {
1838
1835
  addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
1839
1836
  let aliases = [];
1840
1837
  const middlewares = commandMiddlewareFactory(commandMiddleware);
1841
- handler = handler || (() => {
1842
- });
1838
+ handler = handler || (() => {});
1843
1839
  if (Array.isArray(cmd)) {
1844
1840
  if (isCommandAndAliases(cmd)) {
1845
1841
  [cmd, ...aliases] = cmd;
@@ -1988,8 +1984,7 @@ class CommandInstance {
1988
1984
  innerArgv.catch((error) => {
1989
1985
  try {
1990
1986
  yargs.getInternalMethods().getUsageInstance().fail(null, error);
1991
- } catch (_err) {
1992
- }
1987
+ } catch (_err) {}
1993
1988
  });
1994
1989
  }
1995
1990
  }
@@ -4337,8 +4332,7 @@ class YargsInstance {
4337
4332
  argv._.push.apply(argv._, argv["--"]);
4338
4333
  try {
4339
4334
  delete argv["--"];
4340
- } catch (_err) {
4341
- }
4335
+ } catch (_err) {}
4342
4336
  return argv;
4343
4337
  }
4344
4338
  [kCreateLogger]() {
@@ -4466,8 +4460,7 @@ class YargsInstance {
4466
4460
  });
4467
4461
  assertNotStrictEqual(pkgJsonPath, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4468
4462
  obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8"));
4469
- } catch (_noop) {
4470
- }
4463
+ } catch (_noop) {}
4471
4464
  __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
4472
4465
  return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
4473
4466
  }
@@ -4881,13 +4874,18 @@ function errorExit(title, text) {
4881
4874
  process.exit(1);
4882
4875
  }
4883
4876
  y.command("generate-types", "generates typescript types", (yargs) => yargs.option("access-token", {
4884
- describe: "access token"
4877
+ describe: "access token",
4878
+ type: "string"
4885
4879
  }).option("outfile", {
4886
4880
  default: "requence-env.d.ts"
4887
4881
  }).option("outdir", {
4888
4882
  default: ""
4889
4883
  }), async (argv) => {
4890
- const token = argv.accessToken ?? process.env.REQUENCE_ACCESS_TOKEN ?? JSON.parse(fs.readFileSync("package.json", "utf-8")).requence?.accessToken;
4884
+ let token = argv.accessToken ?? process.env.REQUENCE_TASK_ACCESS_TOKEN ?? process.env.REQUENCE_ACCESS_TOKEN;
4885
+ if (!token) {
4886
+ const pkgJson = JSON.parse(fs.readFileSync("package.json", "utf-8"));
4887
+ token = pkgJson.requence?.task?.accessToken ?? pkgJson.requence?.accessToken;
4888
+ }
4891
4889
  console.info();
4892
4890
  if (!token) {
4893
4891
  errorExit("No access token found", `You can provide the access token as argument to ${chalk.bold("createTask")},
@@ -4918,5 +4916,5 @@ in your ${chalk.bold("package.json")} in ${chalk.bold("requence.accessToken")}`)
4918
4916
  console.info(chalk.green("types saved to", chalk.bold(path.relative(process.cwd(), file))));
4919
4917
  }).scriptName("requence-task").help("h").demandCommand(1, 1).strict().parse();
4920
4918
 
4921
- //# debugId=B545466CD91A49C964756E2164756E21
4919
+ //# debugId=F3A972B39B5A133F64756E2164756E21
4922
4920
  //# sourceMappingURL=cli.js.map