@jacebenson/jsn 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +33 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacebenson/jsn",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A command-line interface for ServiceNow that follows the Unix philosophy: simple, composable, and scriptable.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/app.js CHANGED
@@ -121,17 +121,39 @@ export class App {
121
121
 
122
122
  // ⚠️ Warning if in the Default update set
123
123
  if (updateSet && updateSet.toLowerCase().includes('default')) {
124
- process.stderr.write(
125
- '\x1b[33m' + // yellow
126
- '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
127
- ' ⚠ You are in the Default update set!\n' +
128
- ' Create a named update set to capture your changes:\n' +
129
- ' jsn dev updatesets create --name "My Feature"\n' +
130
- ' jsn dev updatesets set "My Feature"\n' +
131
- ' (Run \x1b[1mjsn updatesets yolo\x1b[22m to silence this warning)\n' +
132
- '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
133
- '\x1b[0m' // reset
134
- );
124
+ const isGlobal = scope === 'global';
125
+ if (isGlobal) {
126
+ // 🔴 HARD WARNING — Global + Default
127
+ process.stderr.write(
128
+ '\x1b[31m' + // red
129
+ '┏━ GLOBAL + DEFAULT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n' +
130
+ '┃ You are in Global scope with the Default update set. ┃\n' +
131
+ '┃ Changes ARE captured — in the Default update set. ┃\n' +
132
+ '┃ Moving them to a named update set later requires ┃\n' +
133
+ '┃ manual surgery, one change at a time. Avoid the mess. ┃\n' +
134
+ '┃ ┃\n' +
135
+ '┃ Create a named update set now: ┃\n' +
136
+ '┃ jsn dev updatesets create --name "My Feature" ┃\n' +
137
+ '┃ ┃\n' +
138
+ '┃ Or switch to a scoped scope first: ┃\n' +
139
+ '┃ jsn dev scopes list ┃\n' +
140
+ '┃ ┃\n' +
141
+ '┃ (Run jsn updatesets yolo to silence this check) ┃\n' +
142
+ '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\x1b[0m\n'
143
+ );
144
+ } else {
145
+ // 🟡 SOFT WARNING — Scope + Default
146
+ process.stderr.write(
147
+ '\x1b[33m' + // yellow
148
+ '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
149
+ ' ⚠ Default update set in scope [' + scope + ']\n' +
150
+ ' Changes are contained to this scope, but a named\n' +
151
+ ' update set is still recommended for tracking.\n' +
152
+ ' (Run \x1b[1mjsn updatesets yolo\x1b[22m to silence this warning)\n' +
153
+ '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
154
+ '\x1b[0m' // reset
155
+ );
156
+ }
135
157
  }
136
158
  }
137
159