obsidian-plugin-config 1.1.11 → 1.1.12

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.1.11
6
+ * Version: 1.1.12
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
@@ -22,30 +22,30 @@ const injectScriptPath = join(packageRoot, 'scripts', 'inject-path.ts');
22
22
  function showHelp() {
23
23
  console.log(`
24
24
  Obsidian Plugin Config - Global CLI
25
- Système d'injection pour plugins Obsidian autonomes
25
+ Injection system for autonomous Obsidian plugins
26
26
 
27
- UTILISATION:
28
- obsidian-inject # Injection dans le répertoire courant
29
- obsidian-inject <chemin> # Injection par chemin
30
- obsidian-inject --help, -h # Afficher cette aide
27
+ USAGE:
28
+ obsidian-inject # Inject in current directory
29
+ obsidian-inject <path> # Inject by path
30
+ obsidian-inject --help, -h # Show this help
31
31
 
32
- EXEMPLES:
33
- cd mon-plugin && obsidian-inject
34
- obsidian-inject ../mon-autre-plugin
35
- obsidian-inject "C:\\Users\\dev\\plugins\\mon-plugin"
32
+ EXAMPLES:
33
+ cd my-plugin && obsidian-inject
34
+ obsidian-inject ../my-other-plugin
35
+ obsidian-inject "C:\\Users\\dev\\plugins\\my-plugin"
36
36
 
37
- CE QUI EST INJECTÉ:
38
- Scripts locaux (esbuild.config.ts, acp.ts, utils.ts, etc.)
39
- Configuration package.json (scripts, dépendances)
40
- Protection yarn obligatoire
41
- Installation automatique des dépendances
37
+ WHAT IS INJECTED:
38
+ Local scripts (esbuild.config.ts, acp.ts, utils.ts, etc.)
39
+ Package.json configuration (scripts, dependencies)
40
+ Yarn protection enforced
41
+ Automatic dependency installation
42
42
 
43
43
  ARCHITECTURE:
44
- - Plugin devient AUTONOME avec scripts locaux
45
- - Aucune dépendance externe requise après injection
46
- - Mise à jour possible via re-injection
44
+ - Plugin becomes AUTONOMOUS with local scripts
45
+ - No external dependencies required after injection
46
+ - Updates possible via re-injection
47
47
 
48
- Pour plus d'informations: https://github.com/3C0D/obsidian-plugin-config
48
+ More info: https://github.com/3C0D/obsidian-plugin-config
49
49
  `);
50
50
  }
51
51
 
@@ -60,8 +60,8 @@ function main() {
60
60
 
61
61
  // Check if injection script exists
62
62
  if (!fs.existsSync(injectScriptPath)) {
63
- console.error(`❌ Erreur: Script d'injection non trouvé à ${injectScriptPath}`);
64
- console.error(` Vérifiez que obsidian-plugin-config est correctement installé.`);
63
+ console.error(`❌ Error: Injection script not found at ${injectScriptPath}`);
64
+ console.error(` Make sure obsidian-plugin-config is properly installed.`);
65
65
  process.exit(1);
66
66
  }
67
67
 
@@ -74,41 +74,41 @@ function main() {
74
74
  targetPath = resolve(userCwd, args[0]);
75
75
  }
76
76
 
77
- console.log(`🎯 Obsidian Plugin Config - Injection Globale`);
78
- console.log(`📁 Cible: ${targetPath}`);
79
- console.log(`📦 Depuis: ${packageRoot}\n`);
77
+ console.log(`🎯 Obsidian Plugin Config - Global Injection`);
78
+ console.log(`📁 Target: ${targetPath}`);
79
+ console.log(`📦 From: ${packageRoot}\n`);
80
80
 
81
81
  try {
82
82
  // Check if target directory has package.json
83
83
  const targetPackageJson = join(targetPath, 'package.json');
84
84
  if (!fs.existsSync(targetPackageJson)) {
85
- console.error(`❌ Erreur: package.json non trouvé dans ${targetPath}`);
86
- console.error(` Assurez-vous que c'est un projet Node.js valide.`);
85
+ console.error(`❌ Error: package.json not found in ${targetPath}`);
86
+ console.error(` Make sure this is a valid Node.js project.`);
87
87
  process.exit(1);
88
88
  }
89
89
 
90
90
  // Clean NPM artifacts if package-lock.json exists
91
91
  const packageLockPath = join(targetPath, 'package-lock.json');
92
92
  if (fs.existsSync(packageLockPath)) {
93
- console.log(`🧹 Installation NPM détectée, nettoyage...`);
93
+ console.log(`🧹 NPM installation detected, cleaning...`);
94
94
 
95
95
  try {
96
96
  // Remove package-lock.json
97
97
  fs.unlinkSync(packageLockPath);
98
- console.log(` 🗑️ package-lock.json supprimé`);
98
+ console.log(` 🗑️ package-lock.json removed`);
99
99
 
100
100
  // Remove node_modules if it exists
101
101
  const nodeModulesPath = join(targetPath, 'node_modules');
102
102
  if (fs.existsSync(nodeModulesPath)) {
103
103
  fs.rmSync(nodeModulesPath, { recursive: true, force: true });
104
- console.log(` 🗑️ node_modules supprimé (sera réinstallé avec Yarn)`);
104
+ console.log(` 🗑️ node_modules removed (will be reinstalled with Yarn)`);
105
105
  }
106
106
 
107
- console.log(` ✅ Artefacts NPM nettoyés pour éviter les conflits Yarn`);
107
+ console.log(` ✅ NPM artifacts cleaned to avoid Yarn conflicts`);
108
108
 
109
109
  } catch (cleanError) {
110
- console.error(` ❌ Échec du nettoyage:`, cleanError.message);
111
- console.log(` 💡 Supprimez manuellement package-lock.json et node_modules`);
110
+ console.error(` ❌ Cleanup failed:`, cleanError.message);
111
+ console.log(` 💡 Manually remove package-lock.json and node_modules`);
112
112
  }
113
113
  }
114
114
 
@@ -119,9 +119,9 @@ function main() {
119
119
  cwd: targetPath,
120
120
  stdio: 'pipe'
121
121
  });
122
- console.log(`✅ tsx disponible localement`);
122
+ console.log(`✅ tsx available locally`);
123
123
  } catch {
124
- console.log(`⚠️ tsx non trouvé, installation en cours...`);
124
+ console.log(`⚠️ tsx not found, installing...`);
125
125
 
126
126
  // Install tsx locally in target directory
127
127
  try {
@@ -129,10 +129,10 @@ function main() {
129
129
  cwd: targetPath,
130
130
  stdio: 'inherit'
131
131
  });
132
- console.log(`✅ tsx installé avec succès`);
132
+ console.log(`✅ tsx installed successfully`);
133
133
  } catch (installError) {
134
- console.error(`❌ Échec de l'installation de tsx:`, installError.message);
135
- console.error(` Essayez d'installer tsx manuellement: cd "${targetPath}" && yarn add -D tsx`);
134
+ console.error(`❌ tsx installation failed:`, installError.message);
135
+ console.error(` Try installing tsx manually: cd "${targetPath}" && yarn add -D tsx`);
136
136
  process.exit(1);
137
137
  }
138
138
  }
@@ -145,10 +145,10 @@ function main() {
145
145
  cwd: targetPath // Use target directory to ensure tsx is available
146
146
  });
147
147
 
148
- console.log(`\n✅ Injection terminée avec succès !`);
148
+ console.log(`\n✅ Injection completed successfully!`);
149
149
 
150
150
  } catch (error) {
151
- console.error(`\n❌ Erreur lors de l'injection:`, error.message);
151
+ console.error(`\n❌ Injection error:`, error.message);
152
152
  process.exit(1);
153
153
  }
154
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -46,30 +46,30 @@ const injectScriptPath = join(packageRoot, 'scripts', 'inject-path.ts');
46
46
  function showHelp() {
47
47
  console.log(\`
48
48
  Obsidian Plugin Config - Global CLI
49
- Système d'injection pour plugins Obsidian autonomes
49
+ Injection system for autonomous Obsidian plugins
50
50
 
51
- UTILISATION:
52
- obsidian-inject # Injection dans le répertoire courant
53
- obsidian-inject <chemin> # Injection par chemin
54
- obsidian-inject --help, -h # Afficher cette aide
51
+ USAGE:
52
+ obsidian-inject # Inject in current directory
53
+ obsidian-inject <path> # Inject by path
54
+ obsidian-inject --help, -h # Show this help
55
55
 
56
- EXEMPLES:
57
- cd mon-plugin && obsidian-inject
58
- obsidian-inject ../mon-autre-plugin
59
- obsidian-inject "C:\\\\Users\\\\dev\\\\plugins\\\\mon-plugin"
56
+ EXAMPLES:
57
+ cd my-plugin && obsidian-inject
58
+ obsidian-inject ../my-other-plugin
59
+ obsidian-inject "C:\\\\Users\\\\dev\\\\plugins\\\\my-plugin"
60
60
 
61
- CE QUI EST INJECTÉ:
62
- Scripts locaux (esbuild.config.ts, acp.ts, utils.ts, etc.)
63
- Configuration package.json (scripts, dépendances)
64
- Protection yarn obligatoire
65
- Installation automatique des dépendances
61
+ WHAT IS INJECTED:
62
+ Local scripts (esbuild.config.ts, acp.ts, utils.ts, etc.)
63
+ Package.json configuration (scripts, dependencies)
64
+ Yarn protection enforced
65
+ Automatic dependency installation
66
66
 
67
67
  ARCHITECTURE:
68
- - Plugin devient AUTONOME avec scripts locaux
69
- - Aucune dépendance externe requise après injection
70
- - Mise à jour possible via re-injection
68
+ - Plugin becomes AUTONOMOUS with local scripts
69
+ - No external dependencies required after injection
70
+ - Updates possible via re-injection
71
71
 
72
- Pour plus d'informations: https://github.com/3C0D/obsidian-plugin-config
72
+ More info: https://github.com/3C0D/obsidian-plugin-config
73
73
  \`);
74
74
  }
75
75
 
@@ -84,8 +84,8 @@ function main() {
84
84
 
85
85
  // Check if injection script exists
86
86
  if (!fs.existsSync(injectScriptPath)) {
87
- console.error(\`❌ Erreur: Script d'injection non trouvé à \${injectScriptPath}\`);
88
- console.error(\` Vérifiez que obsidian-plugin-config est correctement installé.\`);
87
+ console.error(\`❌ Error: Injection script not found at \${injectScriptPath}\`);
88
+ console.error(\` Make sure obsidian-plugin-config is properly installed.\`);
89
89
  process.exit(1);
90
90
  }
91
91
 
@@ -98,41 +98,41 @@ function main() {
98
98
  targetPath = resolve(userCwd, args[0]);
99
99
  }
100
100
 
101
- console.log(\`🎯 Obsidian Plugin Config - Injection Globale\`);
102
- console.log(\`📁 Cible: \${targetPath}\`);
103
- console.log(\`📦 Depuis: \${packageRoot}\\n\`);
101
+ console.log(\`🎯 Obsidian Plugin Config - Global Injection\`);
102
+ console.log(\`📁 Target: \${targetPath}\`);
103
+ console.log(\`📦 From: \${packageRoot}\\n\`);
104
104
 
105
105
  try {
106
106
  // Check if target directory has package.json
107
107
  const targetPackageJson = join(targetPath, 'package.json');
108
108
  if (!fs.existsSync(targetPackageJson)) {
109
- console.error(\`❌ Erreur: package.json non trouvé dans \${targetPath}\`);
110
- console.error(\` Assurez-vous que c'est un projet Node.js valide.\`);
109
+ console.error(\`❌ Error: package.json not found in \${targetPath}\`);
110
+ console.error(\` Make sure this is a valid Node.js project.\`);
111
111
  process.exit(1);
112
112
  }
113
113
 
114
114
  // Clean NPM artifacts if package-lock.json exists
115
115
  const packageLockPath = join(targetPath, 'package-lock.json');
116
116
  if (fs.existsSync(packageLockPath)) {
117
- console.log(\`🧹 Installation NPM détectée, nettoyage...\`);
117
+ console.log(\`🧹 NPM installation detected, cleaning...\`);
118
118
 
119
119
  try {
120
120
  // Remove package-lock.json
121
121
  fs.unlinkSync(packageLockPath);
122
- console.log(\` 🗑️ package-lock.json supprimé\`);
122
+ console.log(\` 🗑️ package-lock.json removed\`);
123
123
 
124
124
  // Remove node_modules if it exists
125
125
  const nodeModulesPath = join(targetPath, 'node_modules');
126
126
  if (fs.existsSync(nodeModulesPath)) {
127
127
  fs.rmSync(nodeModulesPath, { recursive: true, force: true });
128
- console.log(\` 🗑️ node_modules supprimé (sera réinstallé avec Yarn)\`);
128
+ console.log(\` 🗑️ node_modules removed (will be reinstalled with Yarn)\`);
129
129
  }
130
130
 
131
- console.log(\` ✅ Artefacts NPM nettoyés pour éviter les conflits Yarn\`);
131
+ console.log(\` ✅ NPM artifacts cleaned to avoid Yarn conflicts\`);
132
132
 
133
133
  } catch (cleanError) {
134
- console.error(\` ❌ Échec du nettoyage:\`, cleanError.message);
135
- console.log(\` 💡 Supprimez manuellement package-lock.json et node_modules\`);
134
+ console.error(\` ❌ Cleanup failed:\`, cleanError.message);
135
+ console.log(\` 💡 Manually remove package-lock.json and node_modules\`);
136
136
  }
137
137
  }
138
138
 
@@ -143,9 +143,9 @@ function main() {
143
143
  cwd: targetPath,
144
144
  stdio: 'pipe'
145
145
  });
146
- console.log(\`✅ tsx disponible localement\`);
146
+ console.log(\`✅ tsx available locally\`);
147
147
  } catch {
148
- console.log(\`⚠️ tsx non trouvé, installation en cours...\`);
148
+ console.log(\`⚠️ tsx not found, installing...\`);
149
149
 
150
150
  // Install tsx locally in target directory
151
151
  try {
@@ -153,10 +153,10 @@ function main() {
153
153
  cwd: targetPath,
154
154
  stdio: 'inherit'
155
155
  });
156
- console.log(\`✅ tsx installé avec succès\`);
156
+ console.log(\`✅ tsx installed successfully\`);
157
157
  } catch (installError) {
158
- console.error(\`❌ Échec de l'installation de tsx:\`, installError.message);
159
- console.error(\` Essayez d'installer tsx manuellement: cd "\${targetPath}" && yarn add -D tsx\`);
158
+ console.error(\`❌ tsx installation failed:\`, installError.message);
159
+ console.error(\` Try installing tsx manually: cd "\${targetPath}" && yarn add -D tsx\`);
160
160
  process.exit(1);
161
161
  }
162
162
  }
@@ -169,10 +169,10 @@ function main() {
169
169
  cwd: targetPath // Use target directory to ensure tsx is available
170
170
  });
171
171
 
172
- console.log(\`\\n✅ Injection terminée avec succès !\`);
172
+ console.log(\`\\n✅ Injection completed successfully!\`);
173
173
 
174
174
  } catch (error) {
175
- console.error(\`\\n❌ Erreur lors de l'injection:\`, error.message);
175
+ console.error(\`\\n❌ Injection error:\`, error.message);
176
176
  process.exit(1);
177
177
  }
178
178
  }
@@ -186,36 +186,48 @@ main();
186
186
  }
187
187
 
188
188
  /**
189
- * Build and publish NPM package - Complete workflow
189
+ * Complete NPM workflow - Version, Commit, Push, Publish
190
190
  */
191
191
  function buildAndPublishNpm(): void {
192
- console.log(`🚀 Obsidian Plugin Config - NPM Build & Publish`);
193
- console.log(`Complete workflow: exportsbinverify → publish\n`);
192
+ console.log(`🚀 Obsidian Plugin Config - Complete NPM Workflow`);
193
+ console.log(`Full automation: versioncommitpushexports → bin → publish\n`);
194
194
 
195
195
  try {
196
- // Step 1: Update exports automatically
197
- console.log(`📦 Step 1/4: Updating exports...`);
196
+ // Step 1: Update version and push to GitHub
197
+ console.log(`📋 Step 1/6: Updating version...`);
198
+ execSync('echo 1 | tsx scripts/update-version-config.ts', { stdio: 'inherit' });
199
+
200
+ // Step 2: Commit and push any remaining changes
201
+ console.log(`\n📤 Step 2/6: Committing and pushing changes...`);
202
+ try {
203
+ execSync('echo "Prepare NPM package publication" | tsx scripts/acp.ts -b', { stdio: 'inherit' });
204
+ } catch (acpError) {
205
+ console.log(` ℹ️ No additional changes to commit`);
206
+ }
207
+
208
+ // Step 3: Update exports automatically
209
+ console.log(`\n📦 Step 3/6: Updating exports...`);
198
210
  execSync('yarn update-exports', { stdio: 'inherit' });
199
211
 
200
- // Step 2: Generate bin file
201
- console.log(`\n🔧 Step 2/4: Generating bin/obsidian-inject.js...`);
212
+ // Step 4: Generate bin file
213
+ console.log(`\n🔧 Step 4/6: Generating bin/obsidian-inject.js...`);
202
214
  generateBinFile();
203
215
 
204
- // Step 3: Verify package is ready
205
- console.log(`\n📋 Step 3/4: Verifying package...`);
216
+ // Step 5: Verify package is ready
217
+ console.log(`\n📋 Step 5/6: Verifying package...`);
206
218
  verifyPackage();
207
219
 
208
- // Step 4: Publish to NPM
209
- console.log(`\n📤 Step 4/4: Publishing to NPM...`);
220
+ // Step 6: Publish to NPM
221
+ console.log(`\n📤 Step 6/6: Publishing to NPM...`);
210
222
  execSync('npm publish --registry https://registry.npmjs.org/', { stdio: 'inherit' });
211
223
 
212
- console.log(`\n🎉 Package published successfully!`);
224
+ console.log(`\n🎉 Complete workflow successful!`);
213
225
  console.log(`\n📋 Next steps:`);
214
226
  console.log(` 1. npm install -g obsidian-plugin-config`);
215
227
  console.log(` 2. Test injection: cd any-plugin && obsidian-inject`);
216
228
 
217
229
  } catch (error) {
218
- console.error(`\n❌ Build failed: ${error instanceof Error ? error.message : String(error)}`);
230
+ console.error(`\n❌ Workflow failed: ${error instanceof Error ? error.message : String(error)}`);
219
231
  process.exit(1);
220
232
  }
221
233
  }
package/scripts/help.ts CHANGED
@@ -48,23 +48,28 @@ Usage:
48
48
 
49
49
  ═══════════════════════════════════════════════════════════════════
50
50
 
51
- 🚀 COMPLETE WORKFLOW (Development → GitHub → NPM)
51
+ 🚀 COMPLETE WORKFLOWS
52
52
 
53
+ DEVELOPMENT WORKFLOW (Manual control):
53
54
  1. Make changes to obsidian-plugin-config
54
55
  2. yarn lint:fix # Fix any linting issues
55
- 3. yarn v # Update version (package.json + versions.json + push)
56
- 4. yarn bacp # Commit and push changes to GitHub
57
- 5. yarn npm-publish # Complete NPM workflow (exports + bin + publish)
58
- 6. npm install -g obsidian-plugin-config # Update global package
59
- 7. Test injection: cd any-plugin && obsidian-inject
60
-
61
- SIMPLE NPM WORKFLOW:
62
- yarn npm-publish # One command does everything:
56
+ 3. yarn v # Update version + commit + push GitHub
57
+ 4. yarn bacp # Commit other changes + push GitHub
58
+ 5. yarn npm-publish # Complete NPM workflow
59
+
60
+ AUTOMATED WORKFLOW (One command):
61
+ yarn npm-publish # Does EVERYTHING automatically:
62
+ # Update version (patch)
63
+ # Commit and push to GitHub
63
64
  # → Update exports
64
65
  # → Generate bin/obsidian-inject.js
65
66
  # → Verify package
66
67
  # → Publish to NPM
67
68
 
69
+ AFTER NPM PUBLISH:
70
+ npm install -g obsidian-plugin-config # Update global package
71
+ Test injection: cd any-plugin && obsidian-inject
72
+
68
73
  ═══════════════════════════════════════════════════════════════════
69
74
 
70
75
  `);
package/versions.json CHANGED
@@ -15,5 +15,6 @@
15
15
  "1.1.8": "1.8.9",
16
16
  "1.1.9": "1.8.9",
17
17
  "1.1.10": "1.8.9",
18
- "1.1.11": "1.8.9"
18
+ "1.1.11": "1.8.9",
19
+ "1.1.12": "1.8.9"
19
20
  }