obsidian-plugin-config 1.4.4 → 1.4.6
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/.injection-info.json +5 -1
- package/.vscode/tasks.json +116 -116
- package/bin/obsidian-inject.js +1 -1
- package/package.json +3 -1
- package/scripts/acp.ts +64 -56
- package/scripts/build-npm.ts +152 -135
- package/scripts/esbuild.config.ts +221 -196
- package/scripts/inject-core.ts +613 -619
- package/scripts/inject-path.ts +144 -130
- package/scripts/inject-prompt.ts +85 -78
- package/scripts/sync-template-deps.ts +44 -44
- package/scripts/update-version-config.ts +117 -98
- package/scripts/utils.ts +121 -118
- package/templates/.vscode/settings.json +9 -9
- package/templates/.vscode/tasks.json +53 -53
- package/templates/package.json +3 -1
- package/templates/scripts/acp.ts +64 -56
- package/templates/scripts/esbuild.config.ts +268 -232
- package/templates/scripts/release.ts +78 -79
- package/templates/scripts/update-version.ts +129 -106
- package/templates/scripts/utils.ts +129 -126
- package/tsconfig.json +30 -41
- package/versions.json +3 -1
|
@@ -1,98 +1,117 @@
|
|
|
1
|
-
import { readFile, writeFile } from
|
|
2
|
-
import dedent from
|
|
3
|
-
import { inc, valid } from
|
|
4
|
-
import { createReadlineInterface, askQuestion, gitExec } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Current version: ${currentVersion}
|
|
12
|
-
Kind of update:
|
|
13
|
-
patch(1.0.1) -> type 1 or p
|
|
14
|
-
minor(1.1.0) -> type 2 or min
|
|
15
|
-
major(2.0.0) -> type 3 or maj
|
|
16
|
-
or version number (e.g. 2.0.0)
|
|
17
|
-
Enter choice: `,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
1
|
+
import { readFile, writeFile } from 'fs/promises';
|
|
2
|
+
import dedent from 'dedent';
|
|
3
|
+
import { inc, valid } from 'semver';
|
|
4
|
+
import { createReadlineInterface, askQuestion, gitExec } from './utils.js';
|
|
5
|
+
|
|
6
|
+
const rl = createReadlineInterface();
|
|
7
|
+
|
|
8
|
+
async function getTargetVersion(currentVersion: string): Promise<string> {
|
|
9
|
+
const updateType = await askQuestion(
|
|
10
|
+
dedent`
|
|
11
|
+
Current version: ${currentVersion}
|
|
12
|
+
Kind of update:
|
|
13
|
+
patch(1.0.1) -> type 1 or p
|
|
14
|
+
minor(1.1.0) -> type 2 or min
|
|
15
|
+
major(2.0.0) -> type 3 or maj
|
|
16
|
+
or version number (e.g. 2.0.0)
|
|
17
|
+
Enter choice: `,
|
|
18
|
+
rl
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
switch (updateType.trim()) {
|
|
22
|
+
case 'p':
|
|
23
|
+
case '1':
|
|
24
|
+
return inc(currentVersion, 'patch') || '';
|
|
25
|
+
case 'min':
|
|
26
|
+
case '2':
|
|
27
|
+
return inc(currentVersion, 'minor') || '';
|
|
28
|
+
case 'maj':
|
|
29
|
+
case '3':
|
|
30
|
+
return inc(currentVersion, 'major') || '';
|
|
31
|
+
default:
|
|
32
|
+
return valid(updateType.trim()) || '';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function updateJsonFile(
|
|
37
|
+
filename: string,
|
|
38
|
+
updateFn: (json: Record<string, unknown>) => void
|
|
39
|
+
): Promise<void> {
|
|
40
|
+
try {
|
|
41
|
+
const content = JSON.parse(await readFile(filename, 'utf8'));
|
|
42
|
+
updateFn(content);
|
|
43
|
+
await writeFile(filename, JSON.stringify(content, null, '\t'));
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(
|
|
46
|
+
`Error updating ${filename}:`,
|
|
47
|
+
error instanceof Error ? error.message : String(error)
|
|
48
|
+
);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function updateConfigVersions(targetVersion: string): Promise<void> {
|
|
54
|
+
try {
|
|
55
|
+
await Promise.all([
|
|
56
|
+
updateJsonFile('package.json', (json) => (json.version = targetVersion)),
|
|
57
|
+
updateJsonFile('versions.json', (json) => (json[targetVersion] = '1.8.9'))
|
|
58
|
+
]);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(
|
|
61
|
+
'Error updating config versions:',
|
|
62
|
+
error instanceof Error ? error.message : String(error)
|
|
63
|
+
);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function updateVersion(): Promise<void> {
|
|
69
|
+
try {
|
|
70
|
+
const currentVersion = process.env.npm_package_version || '1.0.0';
|
|
71
|
+
const targetVersion = await getTargetVersion(currentVersion);
|
|
72
|
+
|
|
73
|
+
if (!targetVersion) {
|
|
74
|
+
console.log('Invalid version');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
// Update all files first
|
|
80
|
+
await updateConfigVersions(targetVersion);
|
|
81
|
+
console.log(`Files updated to version ${targetVersion}`);
|
|
82
|
+
|
|
83
|
+
// Add files to git
|
|
84
|
+
gitExec('git add package.json versions.json');
|
|
85
|
+
gitExec(`git commit -m "Updated to version ${targetVersion}"`);
|
|
86
|
+
console.log('Changes committed');
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error(
|
|
89
|
+
'Error during update or commit:',
|
|
90
|
+
error instanceof Error ? error.message : String(error)
|
|
91
|
+
);
|
|
92
|
+
console.log('Operation failed.');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
gitExec('git push');
|
|
98
|
+
console.log(`Version successfully updated to ${targetVersion} and pushed.`);
|
|
99
|
+
} catch (pushError) {
|
|
100
|
+
console.error(
|
|
101
|
+
'Failed to push version update:',
|
|
102
|
+
pushError instanceof Error ? pushError.message : String(pushError)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error('Error:', error instanceof Error ? error.message : String(error));
|
|
107
|
+
} finally {
|
|
108
|
+
rl.close();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
updateVersion()
|
|
113
|
+
.catch(console.error)
|
|
114
|
+
.finally(() => {
|
|
115
|
+
console.log('Exiting...');
|
|
116
|
+
process.exit();
|
|
117
|
+
});
|
package/scripts/utils.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
rm
|
|
6
|
-
} from "fs/promises";
|
|
7
|
-
import path from "path";
|
|
8
|
-
import * as readline from "readline";
|
|
9
|
-
import { execSync } from "child_process";
|
|
1
|
+
import { access, mkdir, copyFile, rm } from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import * as readline from 'readline';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
10
5
|
|
|
11
6
|
export function createReadlineInterface(): readline.Interface {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
return readline.createInterface({
|
|
8
|
+
input: process.stdin as NodeJS.ReadableStream,
|
|
9
|
+
output: process.stdout as NodeJS.WritableStream
|
|
10
|
+
});
|
|
16
11
|
}
|
|
17
12
|
|
|
18
|
-
export const askQuestion = async (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
export const askQuestion = async (
|
|
14
|
+
question: string,
|
|
15
|
+
rl: readline.Interface
|
|
16
|
+
): Promise<string> => {
|
|
17
|
+
try {
|
|
18
|
+
return await new Promise((resolve) =>
|
|
19
|
+
rl.question(question, (input) => resolve(input.trim()))
|
|
20
|
+
);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('Error asking question:', error);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -30,119 +30,122 @@ export const askQuestion = async (question: string, rl: readline.Interface): Pro
|
|
|
30
30
|
* Rejects: n, no, N, NO
|
|
31
31
|
* Invalid input defaults to no for safety
|
|
32
32
|
*/
|
|
33
|
-
export const askConfirmation = async (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
export const askConfirmation = async (
|
|
34
|
+
question: string,
|
|
35
|
+
rl: readline.Interface
|
|
36
|
+
): Promise<boolean> => {
|
|
37
|
+
const answer = await askQuestion(`${question} [Y/n]: `, rl);
|
|
38
|
+
const response = answer.toLowerCase();
|
|
39
|
+
|
|
40
|
+
// Accept: y, yes, Y, YES, or empty (default to yes)
|
|
41
|
+
// Reject: n, no, N, NO
|
|
42
|
+
const isYes = response === '' || response === 'y' || response === 'yes';
|
|
43
|
+
const isNo = response === 'n' || response === 'no';
|
|
44
|
+
|
|
45
|
+
if (isNo) {
|
|
46
|
+
return false;
|
|
47
|
+
} else if (isYes) {
|
|
48
|
+
return true;
|
|
49
|
+
} else {
|
|
50
|
+
console.log('Please answer Y (yes) or n (no). Defaulting to no for safety.');
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
export const cleanInput = (inputStr: string): string => {
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
if (!inputStr) return '';
|
|
57
|
+
return inputStr.trim().replace(/["`]/g, "'").replace(/\r\n/g, '\n');
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
export const isValidPath = async (pathToCheck: string): Promise<boolean> => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
if (!pathToCheck) return false;
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
// Using async fs.access is preferred over synchronous existsSync
|
|
65
|
+
// as it doesn't block the main thread/event loop
|
|
66
|
+
await access(pathToCheck.trim());
|
|
67
|
+
return true;
|
|
68
|
+
} catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
74
|
+
const pluginDir = process.cwd();
|
|
75
|
+
const manifestSrc = path.join(pluginDir, 'manifest.json');
|
|
76
|
+
const manifestDest = path.join(buildPath, 'manifest.json');
|
|
77
|
+
const cssDest = path.join(buildPath, 'styles.css');
|
|
78
|
+
const folderToRemove = path.join(buildPath, '_.._');
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
await mkdir(buildPath, { recursive: true });
|
|
82
|
+
} catch (error: unknown) {
|
|
83
|
+
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') {
|
|
84
|
+
console.error(`Error creating directory: ${(error as Error).message}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Copy manifest
|
|
89
|
+
try {
|
|
90
|
+
await copyFile(manifestSrc, manifestDest);
|
|
91
|
+
} catch (error: unknown) {
|
|
92
|
+
console.error(`Error copying manifest: ${(error as Error).message}`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Copy CSS
|
|
96
|
+
try {
|
|
97
|
+
const srcStylesPath = path.join(pluginDir, 'src/styles.css');
|
|
98
|
+
const rootStylesPath = path.join(pluginDir, 'styles.css');
|
|
99
|
+
|
|
100
|
+
// First check if CSS exists in src/styles.css
|
|
101
|
+
if (await isValidPath(srcStylesPath)) {
|
|
102
|
+
await copyFile(srcStylesPath, cssDest);
|
|
103
|
+
}
|
|
104
|
+
// Otherwise, check if it exists in the root
|
|
105
|
+
else if (await isValidPath(rootStylesPath)) {
|
|
106
|
+
await copyFile(rootStylesPath, cssDest);
|
|
107
|
+
if (await isValidPath(folderToRemove)) {
|
|
108
|
+
await rm(folderToRemove, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
} catch (error: unknown) {
|
|
114
|
+
console.error(`Error copying CSS: ${(error as Error).message}`);
|
|
115
|
+
}
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
export function gitExec(command: string): void {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
try {
|
|
120
|
+
execSync(command, { stdio: 'inherit' });
|
|
121
|
+
} catch (error: unknown) {
|
|
122
|
+
console.error(`Error executing '${command}':`, (error as Error).message);
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
/**
|
|
125
128
|
* Ensure Git repository is synchronized with remote before pushing
|
|
126
129
|
*/
|
|
127
130
|
export async function ensureGitSync(): Promise<void> {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
131
|
+
try {
|
|
132
|
+
console.log('🔄 Checking Git synchronization...');
|
|
133
|
+
|
|
134
|
+
// Fetch latest changes from remote
|
|
135
|
+
execSync('git fetch origin', { stdio: 'pipe' });
|
|
136
|
+
|
|
137
|
+
// Check if branch is behind remote
|
|
138
|
+
const status = execSync('git status --porcelain -b', { encoding: 'utf8' });
|
|
139
|
+
|
|
140
|
+
if (status.includes('behind')) {
|
|
141
|
+
console.log('📥 Branch behind remote. Pulling changes...');
|
|
142
|
+
execSync('git pull', { stdio: 'inherit' });
|
|
143
|
+
console.log('✅ Successfully pulled remote changes');
|
|
144
|
+
} else {
|
|
145
|
+
console.log('✅ Repository is synchronized with remote');
|
|
146
|
+
}
|
|
147
|
+
} catch (error: unknown) {
|
|
148
|
+
console.error(`❌ Git sync failed: ${(error as Error).message}`);
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"npm.packageManager": "yarn",
|
|
3
|
+
// "js/ts.preferences.includePackageJsonAutoImports": "off",
|
|
4
|
+
"[typescript]": {
|
|
5
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
6
|
+
},
|
|
7
|
+
"[markdown]": {
|
|
8
|
+
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
|
|
9
|
+
},
|
|
10
|
+
"editor.formatOnSave": true
|
|
11
11
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"label": "Lint",
|
|
6
|
+
"type": "shell",
|
|
7
|
+
"command": "yarn lint",
|
|
8
|
+
"group": "test",
|
|
9
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
10
|
+
"problemMatcher": ["$eslint-stylish"]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"label": "Lint: Fix",
|
|
14
|
+
"type": "shell",
|
|
15
|
+
"command": "yarn lint:fix",
|
|
16
|
+
"group": "test",
|
|
17
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
18
|
+
"problemMatcher": ["$eslint-stylish"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"label": "Prettier: Check",
|
|
22
|
+
"type": "shell",
|
|
23
|
+
"command": "yarn prettier",
|
|
24
|
+
"group": "test",
|
|
25
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
26
|
+
"problemMatcher": []
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "Prettier: Fix",
|
|
30
|
+
"type": "shell",
|
|
31
|
+
"command": "yarn prettier:fix",
|
|
32
|
+
"group": "test",
|
|
33
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
34
|
+
"problemMatcher": []
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"label": "Build",
|
|
38
|
+
"type": "shell",
|
|
39
|
+
"command": "yarn build",
|
|
40
|
+
"group": { "kind": "build", "isDefault": true },
|
|
41
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
42
|
+
"problemMatcher": ["$tsc"]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"label": "Cleanup: Lint + Prettier + Build",
|
|
46
|
+
"dependsOrder": "sequence",
|
|
47
|
+
"dependsOn": ["Lint: Fix", "Prettier: Fix", "Build"],
|
|
48
|
+
"group": "build",
|
|
49
|
+
"presentation": { "reveal": "always", "panel": "shared" },
|
|
50
|
+
"problemMatcher": []
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
package/templates/package.json
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"help": "tsx scripts/help.ts",
|
|
19
19
|
"h": "tsx scripts/help.ts",
|
|
20
20
|
"lint": "eslint . --ext .ts",
|
|
21
|
-
"lint:fix": "eslint . --ext .ts --fix"
|
|
21
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
22
|
+
"prettier": "npx prettier --check '**/*.{ts,json}'",
|
|
23
|
+
"prettier:fix": "npx prettier --write '**/*.{ts,json}'"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@types/eslint": "latest",
|