@mistweaverco/kulala-core 0.1.1 → 0.1.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.
package/README.md CHANGED
@@ -75,6 +75,10 @@ is compatible with the IntelliJ HTTP Client:
75
75
  See the [examples][examples]
76
76
  directory for usage examples.
77
77
 
78
+ ### Vendored curl
78
79
 
80
+ - **`npm install` / `bun install`**: the `@mistweaverco/kulala-core` package runs `postinstall`, which downloads a pinned static curl for the **installing machine’s** OS and architecture into the user cache (or you can set `KULALA_CURL_PATH` to your own binary).
81
+ - **Published library** (`dist/`): the npm build sets `__KULALA_EMBED_CURL__=false`, so the tarball does **not** embed curl from the machine that ran `npm publish`.
82
+ - **`bun build --compile`** (your app or the examples): run `packages/core/scripts/generate-vendored-curl.ts` (optionally with `--target=bun-…` for cross-compiles), then compile with `--define __KULALA_EMBED_CURL__=true` so the correct curl is embedded for that build. For cross-compilation you must have the matching curl available under the cache path or under `vendor/curl/<platform>-<arch>/` in this repo.
79
83
 
80
84
  [examples]: https://github.com/mistweaverco/kulala-core/tree/main/examples
package/dist/index.js CHANGED
@@ -4,47 +4,48 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
29
47
  var __require = import.meta.require;
30
48
 
31
- // ../../../../../.cache/kulala/curl/linux-x64/curl
32
- var curl_default = "./curl-1ra9mcaj.";
33
- var init_curl = () => {};
34
-
35
- // src/lib/runner/vendored-curl.generated.ts
36
- var exports_vendored_curl_generated = {};
37
- __export(exports_vendored_curl_generated, {
38
- getVendoredCurl: () => getVendoredCurl
39
- });
40
- async function getVendoredCurl() {
41
- const bytes = Buffer.from(await Bun.file(curl_default).arrayBuffer());
42
- return { bytes, filename: "curl" };
43
- }
44
- var init_vendored_curl_generated = __esm(() => {
45
- init_curl();
46
- });
47
-
48
49
  // ../../node_modules/form-data-encoder/lib/index.js
49
50
  var exports_lib = {};
50
51
  __export(exports_lib, {
@@ -936,7 +937,7 @@ var require_lodash = __commonJS((exports, module) => {
936
937
  function unicodeWords(string) {
937
938
  return string.match(reUnicodeWord) || [];
938
939
  }
939
- var runInContext = function runInContext(context) {
940
+ var runInContext = function runInContext2(context) {
940
941
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
941
942
  var { Array: Array2, Date: Date2, Error: Error2, Function: Function2, Math: Math2, Object: Object2, RegExp: RegExp2, String: String2, TypeError: TypeError2 } = context;
942
943
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
@@ -5469,7 +5470,7 @@ __p += '`;
5469
5470
  lodash.replace = replace;
5470
5471
  lodash.result = result;
5471
5472
  lodash.round = round;
5472
- lodash.runInContext = runInContext;
5473
+ lodash.runInContext = runInContext2;
5473
5474
  lodash.sample = sample;
5474
5475
  lodash.size = size;
5475
5476
  lodash.snakeCase = snakeCase;
@@ -5692,7 +5693,7 @@ __p += '`;
5692
5693
 
5693
5694
  // ../../node_modules/wasmoon-lua5.1/dist/index.js
5694
5695
  var require_dist = __commonJS((exports, module) => {
5695
- var __filename = "/home/marco/projects/personal/kulala-core/node_modules/wasmoon-lua5.1/dist/index.js";
5696
+ var __filename = "/home/runner/work/kulala-core/kulala-core/node_modules/wasmoon-lua5.1/dist/index.js";
5696
5697
  (function(global2, factory) {
5697
5698
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require_lodash()) : typeof define === "function" && define.amd ? define(["exports", "lodash"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2["wasmoon-lua5"] = global2["wasmoon-lua5"] || {}, global2["wasmoon-lua5"]["1"] = {}), global2.lodash));
5698
5699
  })(exports, function(exports2, lodash) {
@@ -11542,16 +11543,7 @@ async function tryResolveCachedCurl() {
11542
11543
  return null;
11543
11544
  }
11544
11545
  async function tryResolveBundledCurl() {
11545
- if (typeof Bun !== "undefined") {
11546
- try {
11547
- const mod = await Promise.resolve().then(() => (init_vendored_curl_generated(), exports_vendored_curl_generated));
11548
- if (typeof mod.getVendoredCurl === "function") {
11549
- const res = await mod.getVendoredCurl();
11550
- if (res)
11551
- return res;
11552
- }
11553
- } catch {}
11554
- }
11546
+ if (false) {}
11555
11547
  const exe = process.platform === "win32" ? "curl.exe" : "curl";
11556
11548
  const assetUrl = new URL(`../../../vendor/curl/${platformVendorSubdir()}/${exe}`, import.meta.url);
11557
11549
  try {
@@ -11584,7 +11576,7 @@ async function resolveCurlPath() {
11584
11576
  }
11585
11577
  return target;
11586
11578
  }
11587
- throw new Error("Embedded curl is required but not bundled. Add vendor/curl/<platform>-<arch>/curl[.exe] to the build (or set KULALA_CURL_PATH explicitly).");
11579
+ throw new Error("Could not resolve vendored curl. Run the package postinstall (or bun run ./scripts/ensure-vendored-curl.ts from @mistweaverco/kulala-core), place curl under vendor/curl/<platform>-<arch>/, or set KULALA_CURL_PATH.");
11588
11580
  }
11589
11581
 
11590
11582
  // src/lib/runner/curl-transport.ts
@@ -11944,7 +11936,7 @@ async function nodeHttpRequest(options) {
11944
11936
  });
11945
11937
  }
11946
11938
  // package.json
11947
- var version = "0.1.1";
11939
+ var version = "0.1.4";
11948
11940
 
11949
11941
  // src/lib/runner/headers.ts
11950
11942
  function buildHeadersFromSection(headerSection) {
@@ -14819,5 +14811,5 @@ export {
14819
14811
  kulalaParser as KulalaParser
14820
14812
  };
14821
14813
 
14822
- //# debugId=B6CCDDD04C964EE764756E2164756E21
14814
+ //# debugId=D187D244FBE8704964756E2164756E21
14823
14815
  //# sourceMappingURL=index.js.map