form-tester 0.3.3 → 0.3.4

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/form-tester.js +32 -19
  2. package/package.json +1 -1
package/form-tester.js CHANGED
@@ -6,7 +6,7 @@ const { spawn, execSync } = require("child_process");
6
6
 
7
7
  const CONFIG_PATH = path.join(__dirname, "form-tester.config.json");
8
8
  const OUTPUT_BASE = path.resolve(__dirname, "output");
9
- const LOCAL_VERSION = "0.3.3";
9
+ const LOCAL_VERSION = "0.3.4";
10
10
  const RECOMMENDED_PERSON = "Uromantisk Direktør";
11
11
 
12
12
  const PERSONAS = [
@@ -947,36 +947,39 @@ function copyDirSync(src, dest) {
947
947
  }
948
948
  }
949
949
 
950
- function install(targetDir) {
950
+ function install(targetDir, isGlobal) {
951
951
  const pkgDir = __dirname;
952
952
  const skillsSrc = path.join(pkgDir, ".claude", "skills");
953
953
  const copilotSrc = path.join(pkgDir, ".github", "copilot-instructions.md");
954
954
  const configSrc = path.join(pkgDir, "form-tester.config.example.json");
955
955
 
956
956
  // Copy Claude Code skills
957
- const skillsDest = path.join(targetDir, ".claude", "skills");
957
+ const skillsDest = isGlobal
958
+ ? path.join(targetDir, "skills")
959
+ : path.join(targetDir, ".claude", "skills");
958
960
  for (const skill of ["form-tester", "playwright-cli"]) {
959
961
  const src = path.join(skillsSrc, skill);
960
962
  if (fs.existsSync(src)) {
961
963
  const dest = path.join(skillsDest, skill);
962
964
  copyDirSync(src, dest);
963
- console.log(` Installed .claude/skills/${skill}/`);
965
+ console.log(` Installed ${isGlobal ? "~/.claude" : ".claude"}/skills/${skill}/`);
964
966
  }
965
967
  }
966
968
 
967
- // Copy Copilot instructions
968
- if (fs.existsSync(copilotSrc)) {
969
- const copilotDest = path.join(targetDir, ".github", "copilot-instructions.md");
970
- fs.mkdirSync(path.dirname(copilotDest), { recursive: true });
971
- fs.copyFileSync(copilotSrc, copilotDest);
972
- console.log(" Installed .github/copilot-instructions.md");
973
- }
969
+ // Project-only files (skip for global install)
970
+ if (!isGlobal) {
971
+ if (fs.existsSync(copilotSrc)) {
972
+ const copilotDest = path.join(targetDir, ".github", "copilot-instructions.md");
973
+ fs.mkdirSync(path.dirname(copilotDest), { recursive: true });
974
+ fs.copyFileSync(copilotSrc, copilotDest);
975
+ console.log(" Installed .github/copilot-instructions.md");
976
+ }
974
977
 
975
- // Copy config example
976
- if (fs.existsSync(configSrc)) {
977
- const configDest = path.join(targetDir, "form-tester.config.example.json");
978
- fs.copyFileSync(configSrc, configDest);
979
- console.log(" Installed form-tester.config.example.json");
978
+ if (fs.existsSync(configSrc)) {
979
+ const configDest = path.join(targetDir, "form-tester.config.example.json");
980
+ fs.copyFileSync(configSrc, configDest);
981
+ console.log(" Installed form-tester.config.example.json");
982
+ }
980
983
  }
981
984
 
982
985
  // Install playwright-cli globally if not already available
@@ -1009,9 +1012,19 @@ async function main() {
1009
1012
  const args = process.argv.slice(2);
1010
1013
 
1011
1014
  if (args[0] === "install") {
1012
- const targetDir = args[1] ? path.resolve(args[1]) : process.cwd();
1013
- console.log(`Installing form-tester skills to ${targetDir} ...\n`);
1014
- install(targetDir);
1015
+ const isGlobal = args.includes("--global") || args.includes("-g");
1016
+ const remaining = args.slice(1).filter((a) => a !== "--global" && a !== "-g");
1017
+ let targetDir;
1018
+ if (isGlobal) {
1019
+ const home = process.env.HOME || process.env.USERPROFILE;
1020
+ targetDir = path.join(home, ".claude");
1021
+ // Global installs skills directly into ~/.claude/skills/
1022
+ console.log(`Installing form-tester skills globally to ${targetDir} ...\n`);
1023
+ } else {
1024
+ targetDir = remaining[0] ? path.resolve(remaining[0]) : process.cwd();
1025
+ console.log(`Installing form-tester skills to ${targetDir} ...\n`);
1026
+ }
1027
+ install(targetDir, isGlobal);
1015
1028
  process.exit(0);
1016
1029
  }
1017
1030
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-tester",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "AI-powered form testing skill for /skjemautfyller forms using Playwright CLI. Works with Claude Code and GitHub Copilot.",
5
5
  "main": "form-tester.js",
6
6
  "bin": {