sn-typescript-util 1.3.6 → 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 +12 -4
- package/bun.lockb +0 -0
- package/package.json +4 -4
- package/scripts/snts.ts +13 -4
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, 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}`;
|
|
@@ -66,7 +72,7 @@ function getWorkspace() {
|
|
|
66
72
|
}
|
|
67
73
|
function handleError() {
|
|
68
74
|
getErrorMsg();
|
|
69
|
-
process.exit(1);
|
|
75
|
+
return process.exit(1);
|
|
70
76
|
}
|
|
71
77
|
function handleOptions(program, options, option) {
|
|
72
78
|
return (
|
|
@@ -89,8 +95,8 @@ async function hasApplication() {
|
|
|
89
95
|
async function init() {
|
|
90
96
|
const program = new Command();
|
|
91
97
|
const info = await getPackageInfo();
|
|
92
|
-
|
|
93
|
-
program.version(
|
|
98
|
+
const version = info.version;
|
|
99
|
+
program.version(version, '-v, --version', 'output the current version');
|
|
94
100
|
program.option(
|
|
95
101
|
'-b, --build',
|
|
96
102
|
'build project utility files & package dependencies'
|
|
@@ -103,6 +109,8 @@ async function init() {
|
|
|
103
109
|
'-s, --sync',
|
|
104
110
|
'sync new instance-based src files to the ts directory'
|
|
105
111
|
);
|
|
112
|
+
program.usage(cyan('[options]'));
|
|
113
|
+
console.log(getDescription(version));
|
|
106
114
|
return doOptions(program);
|
|
107
115
|
}
|
|
108
116
|
function introPrompt(msg) {
|
package/bun.lockb
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sn-typescript-util",
|
|
3
|
-
"version": "1.3.
|
|
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"
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/commander": "^2.12.2",
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
37
|
-
"@typescript-eslint/parser": "^6.
|
|
38
|
-
"bun-types": "^1.0.
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.17.0",
|
|
38
|
+
"bun-types": "^1.0.21",
|
|
39
39
|
"eslint": "^8.56.0",
|
|
40
40
|
"prettier": "^3.1.1"
|
|
41
41
|
}
|
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, 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}`;
|
|
@@ -78,7 +85,7 @@ function getWorkspace() {
|
|
|
78
85
|
|
|
79
86
|
function handleError() {
|
|
80
87
|
getErrorMsg();
|
|
81
|
-
process.exit(1);
|
|
88
|
+
return process.exit(1);
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
function handleOptions(
|
|
@@ -109,8 +116,8 @@ async function hasApplication() {
|
|
|
109
116
|
async function init() {
|
|
110
117
|
const program = new Command();
|
|
111
118
|
const info = await getPackageInfo();
|
|
112
|
-
|
|
113
|
-
program.version(
|
|
119
|
+
const version = info.version;
|
|
120
|
+
program.version(version, '-v, --version', 'output the current version');
|
|
114
121
|
program.option(
|
|
115
122
|
'-b, --build',
|
|
116
123
|
'build project utility files & package dependencies'
|
|
@@ -123,6 +130,8 @@ async function init() {
|
|
|
123
130
|
'-s, --sync',
|
|
124
131
|
'sync new instance-based src files to the ts directory'
|
|
125
132
|
);
|
|
133
|
+
program.usage(cyan('[options]'));
|
|
134
|
+
console.log(getDescription(version));
|
|
126
135
|
return doOptions(program);
|
|
127
136
|
}
|
|
128
137
|
|