sn-typescript-util 1.3.4 → 1.3.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.
- package/README.md +3 -3
- package/bin/snts.js +2 -1
- package/bun.lockb +0 -0
- package/package.json +3 -2
- package/scripts/options.ts +2 -2
- package/scripts/snts.ts +10 -5
package/README.md
CHANGED
|
@@ -170,9 +170,9 @@ Inside of the application directory (after the build), the project structure wil
|
|
|
170
170
|
│ ├── Service Portal/
|
|
171
171
|
│ │ └── Widgets/
|
|
172
172
|
│ │ └── Dashboard/
|
|
173
|
-
│ │
|
|
174
|
-
│ │
|
|
175
|
-
│ │
|
|
173
|
+
│ │ └── Dashboard.client_script.ts
|
|
174
|
+
│ │ └── Dashboard.link.ts
|
|
175
|
+
│ │ └── Dashboard.script.ts
|
|
176
176
|
│ └── Types/
|
|
177
177
|
│ └── Table.ts
|
|
178
178
|
│ └── User.ts
|
package/bin/snts.js
CHANGED
|
@@ -24,6 +24,7 @@ async function doCompile() {
|
|
|
24
24
|
function doOptions(program) {
|
|
25
25
|
program.parse(process.argv).opts();
|
|
26
26
|
const option = Object.keys(program.opts()).toString();
|
|
27
|
+
const optionKey = option;
|
|
27
28
|
const options = {
|
|
28
29
|
build: () => {
|
|
29
30
|
doBuild();
|
|
@@ -38,7 +39,7 @@ function doOptions(program) {
|
|
|
38
39
|
program.help();
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
return handleOptions(program, options,
|
|
42
|
+
return handleOptions(program, options, optionKey);
|
|
42
43
|
}
|
|
43
44
|
async function doSync() {
|
|
44
45
|
const s = startPrompts('Processing', 'Sync started');
|
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.5",
|
|
4
4
|
"description": "A TypeScript utility for ServiceNow developers using VS Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"snts": "bin/snts.js"
|
|
@@ -32,9 +32,10 @@
|
|
|
32
32
|
"typescript": "^5.3.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@types/commander": "^2.12.2",
|
|
35
36
|
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
36
37
|
"@typescript-eslint/parser": "^6.15.0",
|
|
37
|
-
"bun-types": "^1.0.
|
|
38
|
+
"bun-types": "^1.0.19",
|
|
38
39
|
"eslint": "^8.56.0",
|
|
39
40
|
"prettier": "^3.1.1"
|
|
40
41
|
}
|
package/scripts/options.ts
CHANGED
package/scripts/snts.ts
CHANGED
|
@@ -27,9 +27,10 @@ async function doCompile() {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function doOptions(program:
|
|
30
|
+
function doOptions(program: Command) {
|
|
31
31
|
program.parse(process.argv).opts();
|
|
32
32
|
const option: string = Object.keys(program.opts()).toString();
|
|
33
|
+
const optionKey = option as keyof Options;
|
|
33
34
|
const options: Options = {
|
|
34
35
|
build: () => {
|
|
35
36
|
doBuild();
|
|
@@ -44,7 +45,7 @@ function doOptions(program: any) {
|
|
|
44
45
|
program.help();
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
return handleOptions(program, options,
|
|
48
|
+
return handleOptions(program, options, optionKey);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
async function doSync() {
|
|
@@ -75,7 +76,11 @@ function getWorkspace() {
|
|
|
75
76
|
return JSON.parse(readFileSync('./system/sn-workspace.json').toString());
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
function handleOptions(
|
|
79
|
+
function handleOptions(
|
|
80
|
+
program: Command,
|
|
81
|
+
options: Options,
|
|
82
|
+
option: keyof Options
|
|
83
|
+
) {
|
|
79
84
|
return (
|
|
80
85
|
shouldShowHelp(program, option) ||
|
|
81
86
|
((hasApplication() && options[option]) || showHelp(program))()
|
|
@@ -130,11 +135,11 @@ async function runSync() {
|
|
|
130
135
|
});
|
|
131
136
|
}
|
|
132
137
|
|
|
133
|
-
function shouldShowHelp(program:
|
|
138
|
+
function shouldShowHelp(program: Command, option: string) {
|
|
134
139
|
return !option && showHelp(program);
|
|
135
140
|
}
|
|
136
141
|
|
|
137
|
-
function showHelp(program:
|
|
142
|
+
function showHelp(program: Command) {
|
|
138
143
|
return program.help();
|
|
139
144
|
}
|
|
140
145
|
|