obsidian-plugin-config 1.4.4 → 1.4.7

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.
@@ -1 +1,5 @@
1
- {"injectorVersion": "1.1.20", "injectionDate": "2025-07-18T22:04:30.392Z", "injectorName": "obsidian-plugin-config"}
1
+ {
2
+ "injectorVersion": "1.1.20",
3
+ "injectionDate": "2025-07-18T22:04:30.392Z",
4
+ "injectorName": "obsidian-plugin-config"
5
+ }
@@ -1,118 +1,118 @@
1
1
  {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "label": "Build",
6
- "type": "shell",
7
- "command": "yarn build",
8
- "group": { "kind": "build", "isDefault": true },
9
- "presentation": { "reveal": "always", "panel": "shared" },
10
- "problemMatcher": ["$tsc"]
11
- },
12
- {
13
- "label": "Dev (watch)",
14
- "type": "shell",
15
- "command": "yarn dev",
16
- "group": "build",
17
- "presentation": { "reveal": "always", "panel": "shared" },
18
- "problemMatcher": ["$tsc-watch"],
19
- "isBackground": true
20
- },
21
- {
22
- "label": "Real (build to vault)",
23
- "type": "shell",
24
- "command": "yarn real",
25
- "group": "build",
26
- "presentation": { "reveal": "always", "panel": "shared" },
27
- "problemMatcher": ["$tsc"]
28
- },
29
- {
30
- "label": "Lint",
31
- "type": "shell",
32
- "command": "yarn lint",
33
- "group": "test",
34
- "presentation": { "reveal": "always", "panel": "shared" },
35
- "problemMatcher": ["$eslint-stylish"]
36
- },
37
- {
38
- "label": "Lint: Fix",
39
- "type": "shell",
40
- "command": "yarn lint:fix",
41
- "group": "test",
42
- "presentation": { "reveal": "always", "panel": "shared" },
43
- "problemMatcher": ["$eslint-stylish"]
44
- },
45
- {
46
- "label": "Prettier: Check",
47
- "type": "shell",
48
- "command": "npx prettier --check \"{src,scripts,templates}/**/*.{ts,json}\"",
49
- "group": "test",
50
- "presentation": { "reveal": "always", "panel": "shared" },
51
- "problemMatcher": []
52
- },
53
- {
54
- "label": "Prettier: Fix",
55
- "type": "shell",
56
- "command": "npx prettier --write \"{src,scripts,templates}/**/*.{ts,json}\"",
57
- "group": "test",
58
- "presentation": { "reveal": "always", "panel": "shared" },
59
- "problemMatcher": []
60
- },
61
- {
62
- "label": "Update Exports",
63
- "type": "shell",
64
- "command": "yarn update-exports",
65
- "group": "build",
66
- "presentation": { "reveal": "always", "panel": "shared" },
67
- "problemMatcher": []
68
- },
69
- {
70
- "label": "ACP (add, commit, push)",
71
- "type": "shell",
72
- "command": "yarn acp",
73
- "group": "build",
74
- "presentation": { "reveal": "always", "panel": "shared" },
75
- "problemMatcher": []
76
- },
77
- {
78
- "label": "BACP (build + acp)",
79
- "type": "shell",
80
- "command": "yarn bacp",
81
- "group": "build",
82
- "presentation": { "reveal": "always", "panel": "shared" },
83
- "problemMatcher": []
84
- },
85
- {
86
- "label": "Version update",
87
- "type": "shell",
88
- "command": "yarn v",
89
- "group": "build",
90
- "presentation": { "reveal": "always", "panel": "shared" },
91
- "problemMatcher": []
92
- },
93
- {
94
- "label": "Upgrade All (yarn upgrade + sync templates)",
95
- "type": "shell",
96
- "command": "yarn upgrade-all",
97
- "group": "build",
98
- "presentation": { "reveal": "always", "panel": "shared" },
99
- "problemMatcher": []
100
- },
101
- {
102
- "label": "NPM Publish",
103
- "type": "shell",
104
- "command": "yarn npm-publish",
105
- "group": "build",
106
- "presentation": { "reveal": "always", "panel": "shared" },
107
- "problemMatcher": []
108
- },
109
- {
110
- "label": "Cleanup: Lint + Prettier + Build",
111
- "dependsOrder": "sequence",
112
- "dependsOn": ["Lint: Fix", "Prettier: Fix", "Build"],
113
- "group": "build",
114
- "presentation": { "reveal": "always", "panel": "shared" },
115
- "problemMatcher": []
116
- }
117
- ]
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Build",
6
+ "type": "shell",
7
+ "command": "yarn build",
8
+ "group": { "kind": "build", "isDefault": true },
9
+ "presentation": { "reveal": "always", "panel": "shared" },
10
+ "problemMatcher": ["$tsc"]
11
+ },
12
+ {
13
+ "label": "Dev (watch)",
14
+ "type": "shell",
15
+ "command": "yarn dev",
16
+ "group": "build",
17
+ "presentation": { "reveal": "always", "panel": "shared" },
18
+ "problemMatcher": ["$tsc-watch"],
19
+ "isBackground": true
20
+ },
21
+ {
22
+ "label": "Real (build to vault)",
23
+ "type": "shell",
24
+ "command": "yarn real",
25
+ "group": "build",
26
+ "presentation": { "reveal": "always", "panel": "shared" },
27
+ "problemMatcher": ["$tsc"]
28
+ },
29
+ {
30
+ "label": "Lint",
31
+ "type": "shell",
32
+ "command": "yarn lint",
33
+ "group": "test",
34
+ "presentation": { "reveal": "always", "panel": "shared" },
35
+ "problemMatcher": ["$eslint-stylish"]
36
+ },
37
+ {
38
+ "label": "Lint: Fix",
39
+ "type": "shell",
40
+ "command": "yarn lint:fix",
41
+ "group": "test",
42
+ "presentation": { "reveal": "always", "panel": "shared" },
43
+ "problemMatcher": ["$eslint-stylish"]
44
+ },
45
+ {
46
+ "label": "Prettier: Check",
47
+ "type": "shell",
48
+ "command": "yarn prettier",
49
+ "group": "test",
50
+ "presentation": { "reveal": "always", "panel": "shared" },
51
+ "problemMatcher": []
52
+ },
53
+ {
54
+ "label": "Prettier: Fix",
55
+ "type": "shell",
56
+ "command": "yarn prettier:fix",
57
+ "group": "test",
58
+ "presentation": { "reveal": "always", "panel": "shared" },
59
+ "problemMatcher": []
60
+ },
61
+ {
62
+ "label": "Update Exports",
63
+ "type": "shell",
64
+ "command": "yarn update-exports",
65
+ "group": "build",
66
+ "presentation": { "reveal": "always", "panel": "shared" },
67
+ "problemMatcher": []
68
+ },
69
+ {
70
+ "label": "ACP (add, commit, push)",
71
+ "type": "shell",
72
+ "command": "yarn acp",
73
+ "group": "build",
74
+ "presentation": { "reveal": "always", "panel": "shared" },
75
+ "problemMatcher": []
76
+ },
77
+ {
78
+ "label": "BACP (build + acp)",
79
+ "type": "shell",
80
+ "command": "yarn bacp",
81
+ "group": "build",
82
+ "presentation": { "reveal": "always", "panel": "shared" },
83
+ "problemMatcher": []
84
+ },
85
+ {
86
+ "label": "Version update",
87
+ "type": "shell",
88
+ "command": "yarn v",
89
+ "group": "build",
90
+ "presentation": { "reveal": "always", "panel": "shared" },
91
+ "problemMatcher": []
92
+ },
93
+ {
94
+ "label": "Upgrade All (yarn upgrade + sync templates)",
95
+ "type": "shell",
96
+ "command": "yarn upgrade-all",
97
+ "group": "build",
98
+ "presentation": { "reveal": "always", "panel": "shared" },
99
+ "problemMatcher": []
100
+ },
101
+ {
102
+ "label": "NPM Publish",
103
+ "type": "shell",
104
+ "command": "yarn npm-publish",
105
+ "group": "build",
106
+ "presentation": { "reveal": "always", "panel": "shared" },
107
+ "problemMatcher": []
108
+ },
109
+ {
110
+ "label": "Cleanup: Lint + Prettier + Build",
111
+ "dependsOrder": "sequence",
112
+ "dependsOn": ["Lint: Fix", "Prettier: Fix", "Build"],
113
+ "group": "build",
114
+ "presentation": { "reveal": "always", "panel": "shared" },
115
+ "problemMatcher": []
116
+ }
117
+ ]
118
118
  }
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.4.4
6
+ * Version: 1.4.7
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.4.4",
3
+ "version": "1.4.7",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -31,6 +31,8 @@
31
31
  "real": "tsx scripts/esbuild.config.ts production real",
32
32
  "lint": "eslint . --ext .ts",
33
33
  "lint:fix": "eslint . --ext .ts --fix",
34
+ "prettier": "npx prettier --check '**/*.{ts,json}'",
35
+ "prettier:fix": "npx prettier --write '**/*.{ts,json}'",
34
36
  "inject-path": "tsx scripts/inject-path.ts",
35
37
  "inject-sass": "tsx scripts/inject-path.ts --sass",
36
38
  "inject-prompt": "tsx scripts/inject-prompt.ts",
package/scripts/acp.ts CHANGED
@@ -1,75 +1,83 @@
1
- import { execSync } from "child_process";
2
- import fs from "fs";
3
- import path from "path";
1
+ import { execSync } from 'child_process';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
4
  import {
5
- askQuestion,
6
- cleanInput,
7
- createReadlineInterface,
8
- gitExec,
9
- ensureGitSync
10
- } from "./utils.js";
5
+ askQuestion,
6
+ cleanInput,
7
+ createReadlineInterface,
8
+ gitExec,
9
+ ensureGitSync
10
+ } from './utils.js';
11
11
 
12
12
  const rl = createReadlineInterface();
13
13
 
14
14
  // Check if we're in the centralized config repo
15
15
  function isInCentralizedRepo(): boolean {
16
- const packageJsonPath = path.join(process.cwd(), "package.json");
17
- if (!fs.existsSync(packageJsonPath)) return false;
16
+ const packageJsonPath = path.join(process.cwd(), 'package.json');
17
+ if (!fs.existsSync(packageJsonPath)) return false;
18
18
 
19
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
20
- return packageJson.name === "obsidian-plugin-config";
19
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
20
+ return packageJson.name === 'obsidian-plugin-config';
21
21
  }
22
22
 
23
23
  async function main(): Promise<void> {
24
- try {
25
- if (process.argv.includes("-b")) {
26
- console.log("Building...");
27
- gitExec("yarn build");
28
- console.log("Build successful.");
29
- }
24
+ try {
25
+ if (process.argv.includes('-b')) {
26
+ console.log('Building...');
27
+ gitExec('yarn build');
28
+ console.log('Build successful.');
29
+ }
30
30
 
31
- // Only update exports if we're in the centralized repo and not explicitly disabled
32
- if (!process.argv.includes("-ne") && !process.argv.includes("--no-exports") && isInCentralizedRepo()) {
33
- console.log("Updating exports...");
34
- gitExec("yarn run update-exports");
35
- console.log("Exports updated.");
36
- }
31
+ // Only update exports if we're in the centralized repo and not explicitly disabled
32
+ if (
33
+ !process.argv.includes('-ne') &&
34
+ !process.argv.includes('--no-exports') &&
35
+ isInCentralizedRepo()
36
+ ) {
37
+ console.log('Updating exports...');
38
+ gitExec('yarn run update-exports');
39
+ console.log('Exports updated.');
40
+ }
37
41
 
38
- const input: string = await askQuestion("Enter commit message: ", rl);
42
+ const input: string = await askQuestion('Enter commit message: ', rl);
39
43
 
40
- const cleanedInput = cleanInput(input);
44
+ const cleanedInput = cleanInput(input);
41
45
 
42
- try {
43
- gitExec("git add -A");
44
- gitExec(`git commit -m "${cleanedInput}"`);
45
- } catch {
46
- console.log("Commit already exists or failed.");
47
- return;
48
- }
46
+ try {
47
+ gitExec('git add -A');
48
+ gitExec(`git commit -m "${cleanedInput}"`);
49
+ } catch {
50
+ console.log('Commit already exists or failed.');
51
+ return;
52
+ }
49
53
 
50
- // get current branch name
51
- const currentBranch = execSync("git rev-parse --abbrev-ref HEAD").toString().trim();
54
+ // get current branch name
55
+ const currentBranch = execSync('git rev-parse --abbrev-ref HEAD')
56
+ .toString()
57
+ .trim();
52
58
 
53
- // Ensure Git is synchronized before pushing
54
- await ensureGitSync();
59
+ // Ensure Git is synchronized before pushing
60
+ await ensureGitSync();
55
61
 
56
- try {
57
- gitExec(`git push origin ${currentBranch}`);
58
- console.log("Commit and push successful.");
59
- } catch {
60
- // new branch
61
- console.log(`New branch detected. Setting upstream for ${currentBranch}...`);
62
- gitExec(`git push --set-upstream origin ${currentBranch}`);
63
- console.log("Upstream branch set and push successful.");
64
- }
65
- } catch (error) {
66
- console.error("Error:", error instanceof Error ? error.message : String(error));
67
- } finally {
68
- rl.close();
69
- }
62
+ try {
63
+ gitExec(`git push origin ${currentBranch}`);
64
+ console.log('Commit and push successful.');
65
+ } catch {
66
+ // new branch
67
+ console.log(`New branch detected. Setting upstream for ${currentBranch}...`);
68
+ gitExec(`git push --set-upstream origin ${currentBranch}`);
69
+ console.log('Upstream branch set and push successful.');
70
+ }
71
+ } catch (error) {
72
+ console.error('Error:', error instanceof Error ? error.message : String(error));
73
+ } finally {
74
+ rl.close();
75
+ }
70
76
  }
71
77
 
72
- main().catch(console.error).finally(() => {
73
- console.log("Exiting...");
74
- process.exit();
75
- });
78
+ main()
79
+ .catch(console.error)
80
+ .finally(() => {
81
+ console.log('Exiting...');
82
+ process.exit();
83
+ });