obsidian-plugin-config 1.4.1 → 1.4.2
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/obsidian-inject.js +1 -1
- package/eslint.config.mts +6 -0
- package/package.json +1 -1
- package/scripts/build-npm.ts +1 -1
- package/scripts/help.ts +1 -1
- package/scripts/inject-core.ts +2 -2
- package/src/main.ts +1 -3
- package/src/modals/GenericConfirmModal.ts +11 -0
- package/src/modals/index.ts +1 -1
- package/versions.json +2 -1
package/bin/obsidian-inject.js
CHANGED
package/eslint.config.mts
CHANGED
|
@@ -52,6 +52,12 @@ const configs: Linter.Config[] = [
|
|
|
52
52
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
53
53
|
"@typescript-eslint/no-unsafe-argument": "off"
|
|
54
54
|
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
files: ["src/**/*.ts"],
|
|
58
|
+
rules: {
|
|
59
|
+
"no-console": ["warn", { "allow": ["warn", "error", "debug"] }]
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
];
|
|
57
63
|
|
package/package.json
CHANGED
package/scripts/build-npm.ts
CHANGED
|
@@ -251,7 +251,7 @@ async function buildAndPublishNpm(): Promise<void> {
|
|
|
251
251
|
);
|
|
252
252
|
rl.close();
|
|
253
253
|
if (doUpdate) {
|
|
254
|
-
execSync('npm install -g obsidian-plugin-config@latest', { stdio: 'inherit' });
|
|
254
|
+
execSync('npm install -g obsidian-plugin-config@latest --force', { stdio: 'inherit' });
|
|
255
255
|
console.log(` ✅ Global CLI updated`);
|
|
256
256
|
}
|
|
257
257
|
|
package/scripts/help.ts
CHANGED
|
@@ -138,7 +138,7 @@ STANDARD DEVELOPMENT WORKFLOW:
|
|
|
138
138
|
(not required before npm-publish).
|
|
139
139
|
|
|
140
140
|
AFTER NPM PUBLISH - Update global CLI:
|
|
141
|
-
npm install -g obsidian-plugin-config@latest
|
|
141
|
+
npm install -g obsidian-plugin-config@latest --force
|
|
142
142
|
obsidian-inject # Test in current plugin dir
|
|
143
143
|
obsidian-inject ../test-plugin --sass
|
|
144
144
|
|
package/scripts/inject-core.ts
CHANGED
|
@@ -282,7 +282,7 @@ export async function cleanOldLintFiles(targetPath: string): Promise<void> {
|
|
|
282
282
|
/**
|
|
283
283
|
* Inject scripts and config files
|
|
284
284
|
*/
|
|
285
|
-
export async function injectScripts(targetPath: string
|
|
285
|
+
export async function injectScripts(targetPath: string): Promise<void> {
|
|
286
286
|
const scriptsPath = path.join(targetPath, "scripts");
|
|
287
287
|
|
|
288
288
|
if (!await isValidPath(scriptsPath)) {
|
|
@@ -708,7 +708,7 @@ export async function performInjection(
|
|
|
708
708
|
try {
|
|
709
709
|
await cleanNpmArtifactsIfNeeded(targetPath);
|
|
710
710
|
await ensureTsxInstalled(targetPath);
|
|
711
|
-
await injectScripts(targetPath
|
|
711
|
+
await injectScripts(targetPath);
|
|
712
712
|
|
|
713
713
|
console.log(`\n📦 Updating package.json...`);
|
|
714
714
|
await updatePackageJson(targetPath, useSass);
|
package/src/main.ts
CHANGED
|
@@ -15,7 +15,7 @@ export default class ObsidianPluginConfigPlugin extends Plugin {
|
|
|
15
15
|
settings: MyPluginSettings;
|
|
16
16
|
|
|
17
17
|
async onload(): Promise<void> {
|
|
18
|
-
console.
|
|
18
|
+
console.debug('Loading obsidian-plugin-config plugin for testing NPM exports');
|
|
19
19
|
await this.loadSettings();
|
|
20
20
|
|
|
21
21
|
this.addCommand({
|
|
@@ -52,11 +52,9 @@ export default class ObsidianPluginConfigPlugin extends Plugin {
|
|
|
52
52
|
cancelText: 'Annuler',
|
|
53
53
|
onConfirm: () => {
|
|
54
54
|
new Notice('Action confirmée !');
|
|
55
|
-
console.log("Action confirmée par l'utilisateur");
|
|
56
55
|
},
|
|
57
56
|
onCancel: () => {
|
|
58
57
|
new Notice('Action annulée.');
|
|
59
|
-
console.log("Action annulée par l'utilisateur");
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
60
|
}
|
|
@@ -66,3 +66,14 @@ export class GenericConfirmModal extends Modal {
|
|
|
66
66
|
export function showConfirmModal(app: App, options: ConfirmModalOptions): void {
|
|
67
67
|
new GenericConfirmModal(app, options).open();
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
export async function confirmation(app: App, message: string): Promise<boolean> {
|
|
71
|
+
return new Promise((resolve) => {
|
|
72
|
+
new GenericConfirmModal(app, {
|
|
73
|
+
title: 'Confirm',
|
|
74
|
+
message,
|
|
75
|
+
onConfirm: () => resolve(true),
|
|
76
|
+
onCancel: () => resolve(false)
|
|
77
|
+
}).open();
|
|
78
|
+
});
|
|
79
|
+
}
|
package/src/modals/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Export all modals for easy importing
|
|
2
|
-
export { GenericConfirmModal, showConfirmModal } from './GenericConfirmModal.js';
|
|
2
|
+
export { GenericConfirmModal, showConfirmModal, confirmation } from './GenericConfirmModal.js';
|
|
3
3
|
export type { ConfirmModalOptions } from './GenericConfirmModal.js';
|