nwui-cli 0.4.4 → 0.4.5

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > nwui-cli@0.4.1 build /Users/dan/Developer/NativeWindUI/nativewindui/apps/cli
3
+ > nwui-cli@0.4.5 build /Users/dan/Developer/NativeWindUI/nativewindui/apps/cli
4
4
  > tsc && chmod +x ./build/index.js
5
5
 
package/build/index.js CHANGED
@@ -11,7 +11,9 @@ import { renderTitle } from './utils/opening.js';
11
11
  const main = async () => {
12
12
  let quiet = false;
13
13
  try {
14
- await renderTitle();
14
+ if (!quiet) {
15
+ await renderTitle();
16
+ }
15
17
  }
16
18
  catch (_err) {
17
19
  console.log(`\n${color.blue('welcome to the')} ${color.cyan('nativewindui cli')}`);
@@ -30,6 +32,7 @@ const main = async () => {
30
32
  case '--quiet':
31
33
  case '-q':
32
34
  quiet = true;
35
+ env.EXPO_QUIET = true;
33
36
  args.shift();
34
37
  break;
35
38
  case '--big-examples-with-deps':
@@ -10,6 +10,12 @@ class ExpoEnv {
10
10
  set EXPO_NO_GIT_STATUS(value) {
11
11
  process.env["EXPO_NO_GIT_STATUS"] = value ? "1" : "0";
12
12
  }
13
+ get EXPO_QUIET() {
14
+ return trueish(process.env["EXPO_QUIET"] || "");
15
+ }
16
+ set EXPO_QUIET(value) {
17
+ process.env["EXPO_QUIET"] = value ? "1" : "0";
18
+ }
13
19
  }
14
20
  ;
15
21
  class Env extends ExpoEnv {
@@ -29,30 +29,26 @@ const spawnAsync = (cmd, args) => execa(cmd, args, cwd ? { cwd } : undefined);
29
29
  // SOFTWARE.
30
30
  import chalk from 'chalk';
31
31
  import { env } from './env.js';
32
- import { isInteractive } from './interactive.js';
33
32
  import { confirmAsync } from './prompts.js';
34
33
  import * as Log from '../log.js';
35
34
  export async function maybeBailOnGitStatusAsync() {
35
+ const isGitStatusClean = await validateGitStatusAsync();
36
+ // If status is clean, no need to check anything else
37
+ if (isGitStatusClean) {
38
+ return false;
39
+ }
40
+ // If EXPO_NO_GIT_STATUS is enabled, skip the warning and continue
36
41
  if (env.EXPO_NO_GIT_STATUS) {
37
- Log.warn('Git status is dirty but the command will continue because EXPO_NO_GIT_STATUS is enabled...');
38
42
  return false;
39
43
  }
40
- const isGitStatusClean = await validateGitStatusAsync();
41
- // Give people a chance to bail out if git working tree is dirty
42
- if (!isGitStatusClean) {
43
- if (!isInteractive()) {
44
- Log.warn(`Git status is dirty but the command will continue because the terminal is not interactive.`);
45
- return false;
46
- }
47
- Log.log();
48
- const answer = await confirmAsync({
49
- message: `Continue with uncommited changes?`,
50
- });
51
- if (!answer) {
52
- return true;
53
- }
54
- Log.log();
44
+ Log.log();
45
+ const answer = await confirmAsync({
46
+ message: `Continue with uncommited changes?`,
47
+ });
48
+ if (!answer) {
49
+ return true;
55
50
  }
51
+ Log.log();
56
52
  return false;
57
53
  }
58
54
  export async function validateGitStatusAsync() {
@@ -69,14 +65,20 @@ export async function validateGitStatusAsync() {
69
65
  return true;
70
66
  }
71
67
  else if (workingTreeStatus === 'dirty') {
72
- logWarning('Git branch has uncommited file changes', `It's recommended to commit all changes before proceeding in case you want to revert generated changes.`);
68
+ if (!env.EXPO_QUIET) {
69
+ logWarning('Git branch has uncommited file changes', `It's recommended to commit all changes before proceeding in case you want to revert generated changes.`);
70
+ }
73
71
  }
74
72
  else {
75
- logWarning('No git repo found in current directory', `Use git to track file changes before running commands that modify project files.`);
73
+ if (!env.EXPO_QUIET) {
74
+ logWarning('No git repo found in current directory', `Use git to track file changes before running commands that modify project files.`);
75
+ }
76
76
  }
77
77
  return false;
78
78
  }
79
79
  function logWarning(warning, hint) {
80
- Log.warn(chalk.bold `! ` + warning);
81
- Log.log(chalk.gray `\u203A ` + chalk.gray(hint));
80
+ if (!env.EXPO_QUIET) {
81
+ Log.warn(chalk.bold `! ` + warning);
82
+ Log.log(chalk.gray `\u203A ` + chalk.gray(hint));
83
+ }
82
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nwui-cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "NativeWindUI CLI",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",