@orderful/droid 0.40.0 → 0.40.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @orderful/droid
2
2
 
3
+ ## 0.40.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#246](https://github.com/Orderful/droid/pull/246) [`4fd0832`](https://github.com/Orderful/droid/commit/4fd0832b740b2fe168c438f6b3aa4e269098598a) Thanks [@frytyler](https://github.com/frytyler)! - Fix dynamic require('fs') error in ESM bundle for integrations setup
8
+
3
9
  ## 0.40.0
4
10
 
5
11
  ### Minor Changes
package/dist/bin/droid.js CHANGED
@@ -1,10 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined") return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
2
 
9
3
  // src/bin/droid.ts
10
4
  import { program } from "commander";
@@ -4968,7 +4962,7 @@ import inquirer5 from "inquirer";
4968
4962
  import chalk11 from "chalk";
4969
4963
  import { execSync as execSync6 } from "child_process";
4970
4964
  import { createServer } from "https";
4971
- import { readFileSync as readFileSync10 } from "fs";
4965
+ import { readFileSync as readFileSync10, mkdirSync as mkdirSync7, appendFileSync as appendFileSync2, writeFileSync as writeFileSync6 } from "fs";
4972
4966
  import { join as join13 } from "path";
4973
4967
 
4974
4968
  // src/integrations/slack/index.ts
@@ -5101,7 +5095,6 @@ function getOrCreateCert() {
5101
5095
  if (key && cert) return { key, cert };
5102
5096
  } catch {
5103
5097
  }
5104
- const { mkdirSync: mkdirSync7 } = __require("fs");
5105
5098
  mkdirSync7(CERT_DIR, { recursive: true });
5106
5099
  execSync6(
5107
5100
  `openssl req -x509 -newkey rsa:2048 -keyout "${CERT_KEY_PATH}" -out "${CERT_PATH}" -days 365 -nodes -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" 2>/dev/null`,
@@ -5171,8 +5164,7 @@ function writeTokenToShellRc(key, value) {
5171
5164
  const exportLine = buildExportLine(key, value, isFish);
5172
5165
  const fullPath = expandHome(rcPath);
5173
5166
  try {
5174
- const { readFileSync: readFs, appendFileSync: appendFileSync2 } = __require("fs");
5175
- const existing = readFs(fullPath, "utf-8");
5167
+ const existing = readFileSync10(fullPath, "utf-8");
5176
5168
  if (existing.includes(`${key}=`) || existing.includes(`${key} "`)) {
5177
5169
  const lines = existing.split("\n");
5178
5170
  const pattern = isFish ? new RegExp(`^set\\s+-gx\\s+${key}\\s+`) : new RegExp(`^export\\s+${key}=`);
@@ -5185,7 +5177,6 @@ function writeTokenToShellRc(key, value) {
5185
5177
  return line;
5186
5178
  });
5187
5179
  if (replaced) {
5188
- const { writeFileSync: writeFileSync6 } = __require("fs");
5189
5180
  writeFileSync6(fullPath, updated.join("\n"), "utf-8");
5190
5181
  } else {
5191
5182
  appendFileSync2(fullPath, `
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/commands/integrations.ts"],"names":[],"mappings":"AAuNA,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAuInE;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqC/D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCnF"}
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/commands/integrations.ts"],"names":[],"mappings":"AAoNA,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAuInE;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqC/D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCnF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderful/droid",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "AI workflow toolkit for sharing skills, commands, and agents across the team",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,7 +3,7 @@ import chalk from 'chalk';
3
3
  import { execSync } from 'child_process';
4
4
  import { type IncomingMessage, type ServerResponse } from 'http';
5
5
  import { createServer } from 'https';
6
- import { readFileSync } from 'fs';
6
+ import { readFileSync, mkdirSync, appendFileSync, writeFileSync } from 'fs';
7
7
  import { join } from 'path';
8
8
  import { hasSlackToken, exchangeOAuthCode, postMessage, editCanvas } from '../integrations/slack';
9
9
  import { setConfigValue, getConfigValue } from '../lib/config';
@@ -85,7 +85,6 @@ function getOrCreateCert(): { key: string; cert: string } {
85
85
  } catch { /* no cached cert, generate one */ }
86
86
 
87
87
  // Generate new cert (valid for 365 days)
88
- const { mkdirSync } = require('fs');
89
88
  mkdirSync(CERT_DIR, { recursive: true });
90
89
  execSync(
91
90
  `openssl req -x509 -newkey rsa:2048 -keyout "${CERT_KEY_PATH}" -out "${CERT_PATH}" -days 365 -nodes -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" 2>/dev/null`,
@@ -178,8 +177,7 @@ function writeTokenToShellRc(key: string, value: string): boolean {
178
177
  const fullPath = expandHome(rcPath);
179
178
 
180
179
  try {
181
- const { readFileSync: readFs, appendFileSync } = require('fs');
182
- const existing = readFs(fullPath, 'utf-8');
180
+ const existing = readFileSync(fullPath, 'utf-8');
183
181
 
184
182
  // Replace existing export if present, otherwise append
185
183
  if (existing.includes(`${key}=`) || existing.includes(`${key} "`)) {
@@ -198,7 +196,6 @@ function writeTokenToShellRc(key: string, value: string): boolean {
198
196
  });
199
197
 
200
198
  if (replaced) {
201
- const { writeFileSync } = require('fs');
202
199
  writeFileSync(fullPath, updated.join('\n'), 'utf-8');
203
200
  } else {
204
201
  appendFileSync(fullPath, `\n${exportLine}\n`, 'utf-8');