obsidian-plugin-config 1.4.1 → 1.4.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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.4.1
6
+ * Version: 1.4.3
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -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 --ignore-engines', { 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
 
@@ -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, useSass: boolean = false): Promise<void> {
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)) {
@@ -483,12 +483,7 @@ export async function updatePackageJson(
483
483
  ...templatePkg.scripts
484
484
  };
485
485
 
486
- if (packageJson.dependencies?.["obsidian-plugin-config"]) {
487
- delete packageJson.dependencies["obsidian-plugin-config"];
488
- console.log(` 🗑️ Removed obsidian-plugin-config dependency`);
489
- }
490
-
491
- if (!packageJson.devDependencies) packageJson.devDependencies = {};
486
+ if (!packageJson.devDependencies) packageJson.devDependencies = {};
492
487
 
493
488
  const requiredDeps: Record<string, string> = templatePkg.devDependencies;
494
489
 
@@ -708,7 +703,7 @@ export async function performInjection(
708
703
  try {
709
704
  await cleanNpmArtifactsIfNeeded(targetPath);
710
705
  await ensureTsxInstalled(targetPath);
711
- await injectScripts(targetPath, useSass);
706
+ await injectScripts(targetPath);
712
707
 
713
708
  console.log(`\n📦 Updating package.json...`);
714
709
  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.log('Loading obsidian-plugin-config plugin for testing NPM exports');
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
+ }
@@ -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';
@@ -34,6 +34,7 @@
34
34
  "eslint-import-resolver-typescript": "latest",
35
35
  "jiti": "latest",
36
36
  "obsidian": "*",
37
+ "obsidian-plugin-config": "latest",
37
38
  "obsidian-typings": "latest",
38
39
  "prettier": "latest",
39
40
  "semver": "latest",
package/versions.json CHANGED
@@ -40,5 +40,7 @@
40
40
  "1.3.11": "1.8.9",
41
41
  "1.3.12": "1.8.9",
42
42
  "1.4.0": "1.8.9",
43
- "1.4.1": "1.8.9"
43
+ "1.4.1": "1.8.9",
44
+ "1.4.2": "1.8.9",
45
+ "1.4.3": "1.8.9"
44
46
  }