mudra-skills 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/bin/install.js +51 -1
  2. package/package.json +1 -1
package/bin/install.js CHANGED
@@ -7,11 +7,61 @@ import { execSync } from 'child_process';
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
8
  const pluginSrc = path.resolve(__dirname, '..');
9
9
  const homeDir = process.env.HOME || process.env.USERPROFILE;
10
- const target = path.join(homeDir, '.claude', 'plugins', 'mudra');
10
+ const pluginsDir = path.join(homeDir, '.claude', 'plugins');
11
11
 
12
+ const pkg = JSON.parse(fs.readFileSync(path.join(pluginSrc, 'package.json'), 'utf8'));
13
+ const version = pkg.version;
14
+ const MARKETPLACE = 'mudra-band';
15
+ const PLUGIN_NAME = 'mudra';
16
+ const PLUGIN_KEY = `${PLUGIN_NAME}@${MARKETPLACE}`;
17
+
18
+ // Install to top-level plugins directory (Claude Code scans here directly)
19
+ const target = path.join(pluginsDir, PLUGIN_NAME);
12
20
  fs.mkdirSync(target, { recursive: true });
13
21
  execSync(`cp -r "${pluginSrc}/." "${target}"`);
14
22
 
23
+ // Register the marketplace in known_marketplaces.json if not already there
24
+ const marketplacesFile = path.join(pluginsDir, 'known_marketplaces.json');
25
+ let marketplaces = {};
26
+ if (fs.existsSync(marketplacesFile)) {
27
+ marketplaces = JSON.parse(fs.readFileSync(marketplacesFile, 'utf8'));
28
+ }
29
+ if (!marketplaces[MARKETPLACE]) {
30
+ marketplaces[MARKETPLACE] = {
31
+ source: {
32
+ source: 'git',
33
+ url: 'https://github.com/jabbourWearable/mudra-skill.git',
34
+ },
35
+ installLocation: path.join(pluginsDir, 'marketplaces', MARKETPLACE),
36
+ lastUpdated: new Date().toISOString(),
37
+ };
38
+ fs.writeFileSync(marketplacesFile, JSON.stringify(marketplaces, null, 2));
39
+ }
40
+
41
+ // Register the plugin in installed_plugins.json with the correct marketplace key
42
+ const installedFile = path.join(pluginsDir, 'installed_plugins.json');
43
+ let installed = { version: 2, plugins: {} };
44
+ if (fs.existsSync(installedFile)) {
45
+ installed = JSON.parse(fs.readFileSync(installedFile, 'utf8'));
46
+ }
47
+
48
+ // Remove stale npm entry from previous installs
49
+ delete installed.plugins['mudra@npm'];
50
+
51
+ const now = new Date().toISOString();
52
+ const previousInstall = installed.plugins[PLUGIN_KEY]?.[0];
53
+ installed.plugins[PLUGIN_KEY] = [
54
+ {
55
+ scope: 'user',
56
+ installPath: target,
57
+ version,
58
+ installedAt: previousInstall?.installedAt ?? now,
59
+ lastUpdated: now,
60
+ },
61
+ ];
62
+
63
+ fs.writeFileSync(installedFile, JSON.stringify(installed, null, 2));
64
+
15
65
  console.log('');
16
66
  console.log('Mudra skills installed successfully!');
17
67
  console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudra-skills",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Claude Code skills for building Mudra Band apps — 2D, 3D/XR, or auto-classified",
5
5
  "type": "module",
6
6
  "bin": {