sn-typescript-util 1.3.7 → 1.3.8

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/bin/snts.js CHANGED
@@ -4,7 +4,7 @@ import { execFile } from 'node:child_process';
4
4
  import path from 'path';
5
5
  import { readFileSync } from 'fs';
6
6
  import { fileURLToPath } from 'url';
7
- import { bold, gray, magenta, red } from 'colorette';
7
+ import { bold, cyan, gray, magenta, red } from 'colorette';
8
8
  import { intro, outro, spinner } from '@clack/prompts';
9
9
  async function doBuild() {
10
10
  const s = startPrompts('Installing configs', 'Build started');
@@ -48,6 +48,12 @@ async function doSync() {
48
48
  return stdout;
49
49
  });
50
50
  }
51
+ function getDescription(version) {
52
+ const title = 'SN TypeScript Util';
53
+ const description =
54
+ 'is a TS utility for ServiceNow developers using VS Code.';
55
+ return `${bold(magenta(title))} ${description} ${gray(`(${version})`)}\n`;
56
+ }
51
57
  function getErrorMsg() {
52
58
  const url = `https://docs.servicenow.com/bundle/vancouver-application-development/page/build/applications/task/create-project.html`;
53
59
  const msg = `No active application detected. Please create a project with the ServiceNow Extension for VS Code.\n\n${url}`;
@@ -89,15 +95,8 @@ async function hasApplication() {
89
95
  async function init() {
90
96
  const program = new Command();
91
97
  const info = await getPackageInfo();
92
- const version = `(${info.version})`;
93
- program.description(
94
- `${bold(
95
- magenta('SN TypeScript Util')
96
- )} is a TS utility for ServiceNow developers using VS Code. ${gray(
97
- version
98
- )}`
99
- );
100
- program.version(info.version, '-v, --version', 'output the current version');
98
+ const version = info.version;
99
+ program.version(version, '-v, --version', 'output the current version');
101
100
  program.option(
102
101
  '-b, --build',
103
102
  'build project utility files & package dependencies'
@@ -110,6 +109,8 @@ async function init() {
110
109
  '-s, --sync',
111
110
  'sync new instance-based src files to the ts directory'
112
111
  );
112
+ program.usage(cyan('[options]'));
113
+ console.log(getDescription(version));
113
114
  return doOptions(program);
114
115
  }
115
116
  function introPrompt(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sn-typescript-util",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "A TypeScript utility for ServiceNow developers using VS Code",
5
5
  "bin": {
6
6
  "snts": "bin/snts.js"
package/scripts/snts.ts CHANGED
@@ -5,7 +5,7 @@ import { execFile } from 'node:child_process';
5
5
  import path from 'path';
6
6
  import { readFileSync } from 'fs';
7
7
  import { fileURLToPath } from 'url';
8
- import { bold, gray, magenta, red } from 'colorette';
8
+ import { bold, cyan, gray, magenta, red } from 'colorette';
9
9
  import { intro, outro, spinner } from '@clack/prompts';
10
10
  import { Options } from './options.js';
11
11
  import { Workspace } from './workspace.js';
@@ -56,6 +56,13 @@ async function doSync() {
56
56
  });
57
57
  }
58
58
 
59
+ function getDescription(version: string) {
60
+ const title = 'SN TypeScript Util';
61
+ const description =
62
+ 'is a TS utility for ServiceNow developers using VS Code.';
63
+ return `${bold(magenta(title))} ${description} ${gray(`(${version})`)}\n`;
64
+ }
65
+
59
66
  function getErrorMsg() {
60
67
  const url: string = `https://docs.servicenow.com/bundle/vancouver-application-development/page/build/applications/task/create-project.html`;
61
68
  const msg: string = `No active application detected. Please create a project with the ServiceNow Extension for VS Code.\n\n${url}`;
@@ -109,15 +116,8 @@ async function hasApplication() {
109
116
  async function init() {
110
117
  const program = new Command();
111
118
  const info = await getPackageInfo();
112
- const version = `(${info.version})`;
113
- program.description(
114
- `${bold(
115
- magenta('SN TypeScript Util')
116
- )} is a TS utility for ServiceNow developers using VS Code. ${gray(
117
- version
118
- )}`
119
- );
120
- program.version(info.version, '-v, --version', 'output the current version');
119
+ const version = info.version;
120
+ program.version(version, '-v, --version', 'output the current version');
121
121
  program.option(
122
122
  '-b, --build',
123
123
  'build project utility files & package dependencies'
@@ -130,6 +130,8 @@ async function init() {
130
130
  '-s, --sync',
131
131
  'sync new instance-based src files to the ts directory'
132
132
  );
133
+ program.usage(cyan('[options]'));
134
+ console.log(getDescription(version));
133
135
  return doOptions(program);
134
136
  }
135
137