@allanpk716/work-skills-setup 1.4.0 → 1.4.1

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,12 +1,12 @@
1
1
  {
2
2
  "name": "@allanpk716/work-skills-setup",
3
- "version": "0.1.0",
3
+ "version": "1.4.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@allanpk716/work-skills-setup",
9
- "version": "0.1.0",
9
+ "version": "1.4.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "boxen": "^5.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allanpk716/work-skills-setup",
3
- "version": "0.1.0",
3
+ "version": "1.4.1",
4
4
  "description": "Work Skills installer for Windows developers",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -287,17 +287,11 @@ function installHooks(options = {}) {
287
287
  }
288
288
 
289
289
  /**
290
- * Check if global hooks are already registered
290
+ * Check if global hooks are already registered in settings.json.
291
+ * Does NOT check script content - scripts are always re-copied on install.
291
292
  * @returns {boolean}
292
293
  */
293
- function isHooksInstalled() {
294
- const hooksDir = getHooksDir();
295
- const hasScripts = SCRIPT_MAPPINGS.every(
296
- ({ target }) => fs.existsSync(path.join(hooksDir, target))
297
- );
298
-
299
- if (!hasScripts) return false;
300
-
294
+ function isHooksRegistered() {
301
295
  const settings = readSettings();
302
296
  if (!settings.hooks) return false;
303
297
 
@@ -311,6 +305,17 @@ function isHooksInstalled() {
311
305
  return !!(stopEntry && notifyEntry);
312
306
  }
313
307
 
308
+ /**
309
+ * Check if hook scripts exist on disk (regardless of settings.json registration).
310
+ * @returns {boolean}
311
+ */
312
+ function isHooksInstalled() {
313
+ const hooksDir = getHooksDir();
314
+ return SCRIPT_MAPPINGS.every(
315
+ ({ target }) => fs.existsSync(path.join(hooksDir, target))
316
+ );
317
+ }
318
+
314
319
  /**
315
320
  * Get the global commands directory path
316
321
  * @returns {string} ~/.claude/commands/
@@ -500,6 +505,7 @@ module.exports = {
500
505
  findScriptsSourceDir,
501
506
  installHooks,
502
507
  isHooksInstalled,
508
+ isHooksRegistered,
503
509
  cleanMarketplaceCache,
504
510
  installCommands,
505
511
  isCommandsInstalled,
@@ -2,7 +2,7 @@
2
2
 
3
3
  const chalk = require('chalk');
4
4
  const { t } = require('../i18n/index.js');
5
- const { installHooks, isHooksInstalled, installCommands, isCommandsInstalled } = require('./hooks-installer.js');
5
+ const { installHooks, isHooksInstalled, isHooksRegistered, installCommands, isCommandsInstalled } = require('./hooks-installer.js');
6
6
 
7
7
  /**
8
8
  * Run hooks installation step in the npx installer pipeline.
@@ -13,33 +13,40 @@ const { installHooks, isHooksInstalled, installCommands, isCommandsInstalled } =
13
13
  async function runHooksInstallation() {
14
14
  console.log(chalk.bold.blue('\n=== Notification Hooks Setup ===\n'));
15
15
 
16
- if (isHooksInstalled()) {
17
- console.log(chalk.green(' Notification hooks already registered globally'));
16
+ // Always re-copy scripts to ensure deployed versions match source
17
+ const alreadyRegistered = isHooksRegistered();
18
+
19
+ if (alreadyRegistered && isHooksInstalled()) {
20
+ console.log(chalk.gray(' Updating notification hook scripts...'));
18
21
  } else {
19
22
  console.log(chalk.gray(' Registering notification hooks globally...'));
23
+ }
20
24
 
21
- const result = installHooks({
22
- onProgress: (stage) => {
23
- const messages = {
24
- locating: ' Locating notification scripts...',
25
- copying: ' Copying scripts to ~/.claude/hooks/...',
26
- registering: ' Registering hooks in settings.json...',
27
- cleaning: ' Cleaning up marketplace cache...'
28
- };
29
- if (messages[stage]) {
30
- console.log(chalk.gray(messages[stage]));
31
- }
25
+ const result = installHooks({
26
+ onProgress: (stage) => {
27
+ const messages = {
28
+ locating: ' Locating notification scripts...',
29
+ copying: ' Copying scripts to ~/.claude/hooks/...',
30
+ registering: ' Registering hooks in settings.json...',
31
+ cleaning: ' Cleaning up marketplace cache...'
32
+ };
33
+ if (messages[stage]) {
34
+ console.log(chalk.gray(messages[stage]));
32
35
  }
33
- });
36
+ }
37
+ });
34
38
 
35
- if (result.success) {
36
- console.log(chalk.green(' ✓ Notification hooks registered successfully'));
37
- result.copied.forEach(script => {
38
- console.log(chalk.gray(` - ${script}`));
39
- });
39
+ if (result.success) {
40
+ if (alreadyRegistered) {
41
+ console.log(chalk.green(' ✓ Notification hook scripts updated'));
40
42
  } else {
41
- console.log(chalk.yellow(' Notification hooks skipped: ' + (result.error || 'unknown error')));
43
+ console.log(chalk.green(' Notification hooks registered successfully'));
42
44
  }
45
+ result.copied.forEach(script => {
46
+ console.log(chalk.gray(` - ${script}`));
47
+ });
48
+ } else {
49
+ console.log(chalk.yellow(' ⊘ Notification hooks skipped: ' + (result.error || 'unknown error')));
43
50
  }
44
51
 
45
52
  // Install slash commands globally
@@ -96,6 +96,13 @@ async function runMarketplaceIntegration() {
96
96
  // Step 3: Display plugins and prompt for selection
97
97
  displayPluginTable(plugins);
98
98
 
99
+ // Check if all plugins are already installed
100
+ const allInstalled = plugins.every(p => isPluginInstalled(p.name));
101
+ if (allInstalled) {
102
+ console.log(chalk.green('\n ✓ All plugins are already installed'));
103
+ return { success: true, installed: 0, skipped: plugins.length, failed: 0 };
104
+ }
105
+
99
106
  const multiselect = new MultiSelect({
100
107
  name: 'plugins',
101
108
  message: t('marketplace.select_plugins'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allanpk716/work-skills-setup",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Work Skills installer for Windows developers",
5
5
  "main": "installer/src/index.js",
6
6
  "bin": {