@yahoo/uds 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
Binary file
package/cli/cli.ts CHANGED
@@ -2,14 +2,26 @@
2
2
  // Start bluebun to run the correct CLI command
3
3
  import { parseArgs } from 'node:util';
4
4
 
5
- import { print, red, run } from 'bluebun';
5
+ import { cli, print, red } from 'bluebun';
6
+ import updateNotifier from 'simple-update-notifier';
6
7
 
8
+ import packageJson from '../package.json' assert { type: 'json' };
7
9
  import { getAuthenticatedUser } from './utils/auth';
8
10
 
11
+ const EXEMPT_FROM_AUTH = ['login'];
12
+
9
13
  async function main() {
14
+ if (process.env.CI !== '1') {
15
+ updateNotifier({
16
+ pkg: packageJson,
17
+ shouldNotifyInNpmScript: true,
18
+ alwaysRun: true,
19
+ });
20
+ }
21
+
10
22
  // We need to pass the path from Node to the Bun binaries
11
23
  // because there's an issue where the Bun binaries struggle to resolve
12
- const { values, positionals } = parseArgs({
24
+ const { values } = parseArgs({
13
25
  args: Bun.argv,
14
26
  options: {
15
27
  commandsPath: {
@@ -21,10 +33,19 @@ async function main() {
21
33
  });
22
34
 
23
35
  const cliPath = values.commandsPath!.toString();
24
- const isLoginCmd = positionals.includes('login');
25
36
 
26
- if (!isLoginCmd) {
37
+ const { command, props } = await cli({
38
+ name: 'uds',
39
+ cliPath,
40
+ });
41
+
42
+ // Don't require auth when running root `--help`
43
+ const isRootHelp = command.name === 'uds' && props.options.help;
44
+ const shouldRequireAuth = !isRootHelp && !EXEMPT_FROM_AUTH.includes(command.name);
45
+
46
+ if (shouldRequireAuth) {
27
47
  const user = await getAuthenticatedUser(cliPath);
48
+
28
49
  if (!user) {
29
50
  print(
30
51
  red(
@@ -35,10 +56,7 @@ async function main() {
35
56
  }
36
57
  }
37
58
 
38
- run({
39
- name: 'uds',
40
- cliPath,
41
- });
59
+ await command.run(props);
42
60
  }
43
61
 
44
62
  main();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yahoo/uds",
3
3
  "description": "Yahoo Universal System",
4
- "version": "2.1.3",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "uds": "./cli/uds-cli"
@@ -123,6 +123,7 @@
123
123
  "dev:fixtures": "bun run ./scripts/buildFixtures.ts --watch",
124
124
  "dev:purgeCSSData": "bun run ./scripts/generatePurgeCSSData.ts --watch",
125
125
  "dev:ts": "tsup --watch",
126
+ "format:pkg": "cd ../../ && bun syncpack format",
126
127
  "lint": "eslint -c eslint.config.mjs .",
127
128
  "lint:fix": "bun run lint --fix",
128
129
  "lint:pkg": "bun publint",
@@ -152,6 +153,7 @@
152
153
  "prompts": "^2.4.2",
153
154
  "react-toastify": "^11.0.2",
154
155
  "semver": "^7.6.3",
156
+ "simple-update-notifier": "^2.0.0",
155
157
  "tailwind-merge": "^2.5.3",
156
158
  "ts-morph": "^25.0.0",
157
159
  "uuid": "^11.0.3"