@hasna/connectors 0.0.1 → 0.0.2

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/bin/index.js CHANGED
@@ -4790,7 +4790,16 @@ import { existsSync, cpSync, mkdirSync, writeFileSync } from "fs";
4790
4790
  import { join, dirname } from "path";
4791
4791
  import { fileURLToPath } from "url";
4792
4792
  var __dirname2 = dirname(fileURLToPath(import.meta.url));
4793
- var CONNECTORS_DIR = join(__dirname2, "..", "..", "connectors");
4793
+ function resolveConnectorsDir() {
4794
+ const fromBin = join(__dirname2, "..", "connectors");
4795
+ if (existsSync(fromBin))
4796
+ return fromBin;
4797
+ const fromSrc = join(__dirname2, "..", "..", "connectors");
4798
+ if (existsSync(fromSrc))
4799
+ return fromSrc;
4800
+ return fromBin;
4801
+ }
4802
+ var CONNECTORS_DIR = resolveConnectorsDir();
4794
4803
  function getConnectorPath(name) {
4795
4804
  const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
4796
4805
  return join(CONNECTORS_DIR, connectorName);
package/dist/index.js CHANGED
@@ -473,7 +473,16 @@ import { existsSync, cpSync, mkdirSync, writeFileSync } from "fs";
473
473
  import { join, dirname } from "path";
474
474
  import { fileURLToPath } from "url";
475
475
  var __dirname2 = dirname(fileURLToPath(import.meta.url));
476
- var CONNECTORS_DIR = join(__dirname2, "..", "..", "connectors");
476
+ function resolveConnectorsDir() {
477
+ const fromBin = join(__dirname2, "..", "connectors");
478
+ if (existsSync(fromBin))
479
+ return fromBin;
480
+ const fromSrc = join(__dirname2, "..", "..", "connectors");
481
+ if (existsSync(fromSrc))
482
+ return fromSrc;
483
+ return fromBin;
484
+ }
485
+ var CONNECTORS_DIR = resolveConnectorsDir();
477
486
  function getConnectorPath(name) {
478
487
  const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
479
488
  return join(CONNECTORS_DIR, connectorName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/connectors",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Open source connector library - Install API connectors with a single command",
5
5
  "type": "module",
6
6
  "bin": {