@syengup/friday-channel-next 0.0.25 → 0.0.27

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.
@@ -29,9 +29,7 @@ function realHome() {
29
29
  const USER_HOME = realHome();
30
30
  const PLUGIN_DIR = process.argv[2] || join(USER_HOME, ".openclaw", "extensions", "friday-channel-next");
31
31
  const OPENCLAW_CONFIG = join(USER_HOME, ".openclaw", "openclaw.json");
32
- const REPO_URL = process.env.FRIDAY_NEXT_REPO || "https://github.com/SyengUp/openclaw-fridaynext-channel.git";
33
32
 
34
- const G = (s) => `\x1b[32m${s}\x1b[0m`;
35
33
  const Y = (s) => `\x1b[33m${s}\x1b[0m`;
36
34
  const R = (s) => `\x1b[31m${s}\x1b[0m`;
37
35
  function log(msg) {
@@ -124,18 +122,7 @@ if (!existsSync(OPENCLAW_CONFIG)) {
124
122
 
125
123
  // --------------- acquire source ---------------
126
124
 
127
- if (existsSync(PLUGIN_DIR)) {
128
- log(`Plugin directory found: ${PLUGIN_DIR}`);
129
- if (existsSync(join(PLUGIN_DIR, ".git"))) {
130
- try {
131
- log("Pulling latest changes...");
132
- execSync("git fetch origin && git checkout -f origin/main", { cwd: PLUGIN_DIR, stdio: "pipe" });
133
- log("Updated to latest version.");
134
- } catch {
135
- warn("Could not update from git — continuing with existing source.");
136
- }
137
- }
138
- } else if (isRunningFromNpmPackage()) {
125
+ function copyFromNpmPackage() {
139
126
  log(`Copying plugin from npm package to ${PLUGIN_DIR} ...`);
140
127
  cpSync(__dirname, PLUGIN_DIR, {
141
128
  recursive: true,
@@ -146,13 +133,22 @@ if (existsSync(PLUGIN_DIR)) {
146
133
  return ![".git", "node_modules", "dist", "attachments", ".claude"].includes(top);
147
134
  },
148
135
  });
149
- } else {
150
- if (!has("git")) {
151
- err("git is required for installation from GitHub. Install git first or use npx @openclaw/friday-channel-next.");
152
- process.exit(1);
136
+ }
137
+
138
+ if (isRunningFromNpmPackage()) {
139
+ copyFromNpmPackage();
140
+ } else if (existsSync(PLUGIN_DIR)) {
141
+ log(`Plugin directory found: ${PLUGIN_DIR}`);
142
+ log("Updating via npx...");
143
+ try {
144
+ execSync("npx -y @syengup/friday-channel-next", { stdio: "inherit" });
145
+ process.exit(0);
146
+ } catch {
147
+ warn("Could not update via npx — continuing with existing source.");
153
148
  }
154
- log(`Cloning plugin to ${PLUGIN_DIR} ...`);
155
- execSync(`git clone "${REPO_URL}" "${PLUGIN_DIR}"`, { stdio: "inherit" });
149
+ } else {
150
+ err("This plugin is installed via npx. Run: npx -y @syengup/friday-channel-next");
151
+ process.exit(1);
156
152
  }
157
153
 
158
154
  process.chdir(PLUGIN_DIR);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "index.ts",
8
8
  "src/",
9
- "install.js",
9
+ "cli.js",
10
10
  "tsconfig.json",
11
11
  "openclaw.plugin.json"
12
12
  ],
@@ -19,8 +19,7 @@
19
19
  "test:msg-live": "node scripts/message-roundtrip-live.mjs"
20
20
  },
21
21
  "bin": {
22
- "friday-channel-next": "./install.js",
23
- "install-friday-next": "./install.js"
22
+ "friday-channel-next": "./cli.js"
24
23
  },
25
24
  "main": "./dist/index.js",
26
25
  "types": "./dist/index.d.ts",