sn-typescript-util 1.3.10 → 1.3.11
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 +11 -8
- package/bun.lockb +0 -0
- package/package.json +5 -5
- package/scripts/{build.rb → build/build.rb} +1 -1
- package/scripts/snts.ts +33 -21
- package/scripts/types/metadata.ts +8 -0
- package/scripts/types/workspace.ts +8 -0
- package/scripts/workspace.ts +0 -4
- /package/scripts/{compile.rb → build/compile.rb} +0 -0
- /package/scripts/{init.rb → build/init.rb} +0 -0
- /package/scripts/{sync.sh → build/sync.sh} +0 -0
- /package/{templates → scripts/templates}/.prettierrc.json +0 -0
- /package/{templates → scripts/templates}/tsconfig.json +0 -0
- /package/scripts/{options.ts → types/options.ts} +0 -0
- /package/scripts/{release.sh → utils/release.sh} +0 -0
- /package/scripts/{utils.rb → utils/util.rb} +0 -0
package/bin/snts.js
CHANGED
|
@@ -8,7 +8,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');
|
|
11
|
-
return await execFile(getFilePath('init.rb'), (stdout) => {
|
|
11
|
+
return await execFile(getFilePath('init.rb', 'scripts/build'), (stdout) => {
|
|
12
12
|
stopPrompt(s, 'Configs installed');
|
|
13
13
|
runSync();
|
|
14
14
|
return stdout;
|
|
@@ -16,10 +16,13 @@ async function doBuild() {
|
|
|
16
16
|
}
|
|
17
17
|
async function doCompile() {
|
|
18
18
|
const s = startPrompts('Processing', 'Compile started');
|
|
19
|
-
return await execFile(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return await execFile(
|
|
20
|
+
getFilePath('compile.rb', 'scripts/build'),
|
|
21
|
+
(stdout) => {
|
|
22
|
+
stopPrompt(s, 'Completed');
|
|
23
|
+
return stdout;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
23
26
|
}
|
|
24
27
|
function doOptions(program, version) {
|
|
25
28
|
program.parse(process.argv).opts();
|
|
@@ -46,7 +49,7 @@ function doOptions(program, version) {
|
|
|
46
49
|
}
|
|
47
50
|
async function doSync() {
|
|
48
51
|
const s = startPrompts('Processing', 'Sync started');
|
|
49
|
-
return await execFile(getFilePath('sync.sh'), (stdout) => {
|
|
52
|
+
return await execFile(getFilePath('sync.sh', 'scripts/build'), (stdout) => {
|
|
50
53
|
stopPrompt(s, 'Completed');
|
|
51
54
|
return stdout;
|
|
52
55
|
});
|
|
@@ -62,7 +65,7 @@ function getErrorMsg() {
|
|
|
62
65
|
const msg = `No active application detected. Please create a project with the ServiceNow Extension for VS Code.\n\n${url}`;
|
|
63
66
|
return console.error(bold(red(msg)));
|
|
64
67
|
}
|
|
65
|
-
function getFilePath(file, dir = 'scripts') {
|
|
68
|
+
function getFilePath(file, dir = 'scripts/build') {
|
|
66
69
|
const fileName = fileURLToPath(import.meta.url);
|
|
67
70
|
const dirName = path.dirname(fileName);
|
|
68
71
|
return `${path.join(dirName, `../${dir}`)}/${file}`;
|
|
@@ -125,7 +128,7 @@ function introPrompt(msg) {
|
|
|
125
128
|
}
|
|
126
129
|
async function runSync() {
|
|
127
130
|
const s = startPrompts('Syncing', null);
|
|
128
|
-
return await execFile(getFilePath('sync.sh'), (stdout) => {
|
|
131
|
+
return await execFile(getFilePath('sync.sh', 'scripts/build'), (stdout) => {
|
|
129
132
|
stopPrompt(s, 'Sync completed');
|
|
130
133
|
outro('Completed');
|
|
131
134
|
return stdout;
|
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.11",
|
|
4
4
|
"description": "A TypeScript utility for ServiceNow developers using VS Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"snts": "bin/snts.js"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"format": "prettier --write ./bin/*.js ./scripts/*.ts",
|
|
21
21
|
"lint": "eslint .",
|
|
22
|
-
"release": "./scripts/release.sh",
|
|
22
|
+
"release": "./scripts/utils/release.sh",
|
|
23
23
|
"watch": "tsc --watch"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
@@ -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.18.1",
|
|
37
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
38
|
+
"bun-types": "^1.0.22",
|
|
39
39
|
"eslint": "^8.56.0",
|
|
40
40
|
"prettier": "^3.1.1"
|
|
41
41
|
}
|
package/scripts/snts.ts
CHANGED
|
@@ -7,24 +7,30 @@ import { readFileSync } from 'fs';
|
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { bold, cyan, gray, magenta, red } from 'colorette';
|
|
9
9
|
import { intro, outro, spinner } from '@clack/prompts';
|
|
10
|
-
import { Options } from './options.js';
|
|
11
|
-
import { Workspace } from './workspace.js';
|
|
10
|
+
import { Options } from './types/options.js';
|
|
11
|
+
import { Workspace } from './types/workspace.js';
|
|
12
12
|
|
|
13
13
|
async function doBuild() {
|
|
14
14
|
const s = startPrompts('Installing configs', 'Build started');
|
|
15
|
-
return await execFile(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
return await execFile(
|
|
16
|
+
getFilePath('init.rb', 'scripts/build'),
|
|
17
|
+
(stdout: unknown) => {
|
|
18
|
+
stopPrompt(s, 'Configs installed');
|
|
19
|
+
runSync();
|
|
20
|
+
return stdout;
|
|
21
|
+
}
|
|
22
|
+
);
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
async function doCompile() {
|
|
23
26
|
const s = startPrompts('Processing', 'Compile started');
|
|
24
|
-
return await execFile(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
return await execFile(
|
|
28
|
+
getFilePath('compile.rb', 'scripts/build'),
|
|
29
|
+
(stdout: unknown) => {
|
|
30
|
+
stopPrompt(s, 'Completed');
|
|
31
|
+
return stdout;
|
|
32
|
+
}
|
|
33
|
+
);
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
function doOptions(program: Command, version: string) {
|
|
@@ -53,10 +59,13 @@ function doOptions(program: Command, version: string) {
|
|
|
53
59
|
|
|
54
60
|
async function doSync() {
|
|
55
61
|
const s = startPrompts('Processing', 'Sync started');
|
|
56
|
-
return await execFile(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
return await execFile(
|
|
63
|
+
getFilePath('sync.sh', 'scripts/build'),
|
|
64
|
+
(stdout: unknown) => {
|
|
65
|
+
stopPrompt(s, 'Completed');
|
|
66
|
+
return stdout;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
60
69
|
}
|
|
61
70
|
|
|
62
71
|
function getDescription(version: string) {
|
|
@@ -72,7 +81,7 @@ function getErrorMsg() {
|
|
|
72
81
|
return console.error(bold(red(msg)));
|
|
73
82
|
}
|
|
74
83
|
|
|
75
|
-
function getFilePath(file: string, dir: string = 'scripts') {
|
|
84
|
+
function getFilePath(file: string, dir: string = 'scripts/build') {
|
|
76
85
|
const fileName = fileURLToPath(import.meta.url);
|
|
77
86
|
const dirName = path.dirname(fileName);
|
|
78
87
|
return `${path.join(dirName, `../${dir}`)}/${file}`;
|
|
@@ -149,11 +158,14 @@ function introPrompt(msg: string) {
|
|
|
149
158
|
|
|
150
159
|
async function runSync() {
|
|
151
160
|
const s = startPrompts('Syncing', null);
|
|
152
|
-
return await execFile(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
return await execFile(
|
|
162
|
+
getFilePath('sync.sh', 'scripts/build'),
|
|
163
|
+
(stdout: unknown) => {
|
|
164
|
+
stopPrompt(s, 'Sync completed');
|
|
165
|
+
outro('Completed');
|
|
166
|
+
return stdout;
|
|
167
|
+
}
|
|
168
|
+
);
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
function shouldShowHelp(program: Command, option: string) {
|
package/scripts/workspace.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|