sn-typescript-util 1.5.1 → 1.5.3
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 -10
- package/bun.lockb +0 -0
- package/package.json +11 -11
- package/scripts/snts.ts +5 -7
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Using TypeScript, the CLI provides an enhanced developer workflow.
|
|
|
29
29
|
|
|
30
30
|
- [Node.js](https://nodejs.org/)
|
|
31
31
|
- [ServiceNow Extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ServiceNow.now-vscode)
|
|
32
|
-
- An [imported application](https://
|
|
32
|
+
- An [imported application](https://www.servicenow.com/docs/bundle/xanadu-application-development/page/build/applications/task/vscode-import-application.html) in VS Code
|
|
33
33
|
|
|
34
34
|
**[Back to top](#table-of-contents)**
|
|
35
35
|
|
|
@@ -44,7 +44,7 @@ npm install -g sn-typescript-util
|
|
|
44
44
|
Build the TypeScript and configuration files. This only needs to be done once for an application.
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
snts
|
|
47
|
+
snts -b
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
In the application directory created by the ServiceNow Extension for VS Code, the build creates a `ts` directory from the JavaScript files in the `src` directory. This is where all the TypeScript code resides and where the workflow begins.
|
|
@@ -59,7 +59,7 @@ After installation & setup, simply run the TypeScript compiler `--watch` command
|
|
|
59
59
|
tsc --watch
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
The TypeScript will get transpiled
|
|
62
|
+
The TypeScript will get transpiled and moved to the `src` directory. Then changes are ready to sync with the target instance using the ServiceNow Extension for VS Code.
|
|
63
63
|
|
|
64
64
|
**[Back to top](#table-of-contents)**
|
|
65
65
|
|
package/bin/snts.js
CHANGED
|
@@ -20,7 +20,7 @@ async function addInterfaceFile() {
|
|
|
20
20
|
'scripts/templates',
|
|
21
21
|
'BaseTable.ts',
|
|
22
22
|
'ts/Types',
|
|
23
|
-
|
|
23
|
+
`Add a ${cyan('BaseTable.ts')} interface with global default fields?`
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
async function addPrettierFile() {
|
|
@@ -29,7 +29,7 @@ async function addPrettierFile() {
|
|
|
29
29
|
'scripts/templates',
|
|
30
30
|
'.prettierrc.json',
|
|
31
31
|
null,
|
|
32
|
-
|
|
32
|
+
`Add a ${cyan('.prettierrc.json')} default config?`
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
async function confirmFile(msg) {
|
|
@@ -104,14 +104,6 @@ function getConstants() {
|
|
|
104
104
|
Constants['projectName'] = 'SN TypeScript Util';
|
|
105
105
|
Constants['projectDescription'] =
|
|
106
106
|
'is a TS utility for ServiceNow developers using VS Code.';
|
|
107
|
-
Constants[
|
|
108
|
-
(Constants['confirmInterfaceMsg'] =
|
|
109
|
-
`Add a ${cyan('BaseTable.ts')} interface with global default fields?`)
|
|
110
|
-
] = 'confirmInterfaceMsg';
|
|
111
|
-
Constants[
|
|
112
|
-
(Constants['confirmPrettierMsg'] =
|
|
113
|
-
`Add a ${cyan('.prettierrc.json')} default config?`)
|
|
114
|
-
] = 'confirmPrettierMsg';
|
|
115
107
|
Constants['errorMsg'] =
|
|
116
108
|
'No active application detected. Please create a project with the ServiceNow Extension for VS Code.';
|
|
117
109
|
Constants['docsUrl'] =
|
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.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "A TypeScript utility for ServiceNow developers using VS Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"snts": "bin/snts.js"
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@clack/prompts": "^0.
|
|
27
|
+
"@clack/prompts": "^0.9.1",
|
|
28
28
|
"colorette": "^2.0.20",
|
|
29
|
-
"commander": "^
|
|
30
|
-
"execa": "^9.
|
|
31
|
-
"typescript": "^5.
|
|
29
|
+
"commander": "^13.0.0",
|
|
30
|
+
"execa": "^9.5.2",
|
|
31
|
+
"typescript": "^5.7.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@eslint/js": "^9.
|
|
35
|
-
"@types/commander": "^2.12.
|
|
36
|
-
"bun-types": "^1.1.
|
|
37
|
-
"eslint": "^9.
|
|
38
|
-
"prettier": "^3.2
|
|
39
|
-
"typescript-eslint": "^
|
|
34
|
+
"@eslint/js": "^9.18.0",
|
|
35
|
+
"@types/commander": "^2.12.5",
|
|
36
|
+
"bun-types": "^1.1.43",
|
|
37
|
+
"eslint": "^9.18.0",
|
|
38
|
+
"prettier": "^3.4.2",
|
|
39
|
+
"typescript-eslint": "^8.20.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/scripts/snts.ts
CHANGED
|
@@ -31,7 +31,7 @@ async function addInterfaceFile() {
|
|
|
31
31
|
'scripts/templates',
|
|
32
32
|
'BaseTable.ts',
|
|
33
33
|
'ts/Types',
|
|
34
|
-
|
|
34
|
+
`Add a ${cyan('BaseTable.ts')} interface with global default fields?`
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@ async function addPrettierFile() {
|
|
|
41
41
|
'scripts/templates',
|
|
42
42
|
'.prettierrc.json',
|
|
43
43
|
null,
|
|
44
|
-
|
|
44
|
+
`Add a ${cyan('.prettierrc.json')} default config?`
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -128,8 +128,6 @@ function getConstants() {
|
|
|
128
128
|
enum Constants {
|
|
129
129
|
projectName = 'SN TypeScript Util',
|
|
130
130
|
projectDescription = 'is a TS utility for ServiceNow developers using VS Code.',
|
|
131
|
-
confirmInterfaceMsg = `Add a ${cyan('BaseTable.ts')} interface with global default fields?`,
|
|
132
|
-
confirmPrettierMsg = `Add a ${cyan('.prettierrc.json')} default config?`,
|
|
133
131
|
errorMsg = 'No active application detected. Please create a project with the ServiceNow Extension for VS Code.',
|
|
134
132
|
docsUrl = 'https://docs.servicenow.com/bundle/washingtondc-application-development/page/build/applications/task/create-project.html',
|
|
135
133
|
buildOption = 'Build project utility files & package dependencies',
|
|
@@ -142,7 +140,7 @@ function getConstants() {
|
|
|
142
140
|
return Constants;
|
|
143
141
|
}
|
|
144
142
|
|
|
145
|
-
function getDescription(version: string) {
|
|
143
|
+
function getDescription(version: string): string {
|
|
146
144
|
const constants = getConstants();
|
|
147
145
|
const title: string = constants.projectName;
|
|
148
146
|
const description: string = constants.projectDescription;
|
|
@@ -155,7 +153,7 @@ function getErrorMsg() {
|
|
|
155
153
|
return console.error(bold(red(msg)));
|
|
156
154
|
}
|
|
157
155
|
|
|
158
|
-
function getFilePath(file: string, dir: string) {
|
|
156
|
+
function getFilePath(file: string, dir: string): string {
|
|
159
157
|
const fileName = fileURLToPath(import.meta.url);
|
|
160
158
|
const dirName = path.dirname(fileName);
|
|
161
159
|
return `${path.join(dirName, `../${dir}`)}/${file}`;
|
|
@@ -267,7 +265,7 @@ function introPrompt(msg: string) {
|
|
|
267
265
|
return intro(msg);
|
|
268
266
|
}
|
|
269
267
|
|
|
270
|
-
function parseOptions(program: Command) {
|
|
268
|
+
function parseOptions(program: Command): string {
|
|
271
269
|
const options = program.parse(process.argv).opts();
|
|
272
270
|
return options && Object.keys(program.opts()).toString();
|
|
273
271
|
}
|