@usesocial/cli 0.2.3 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @usesocial/cli
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ef4d221`](https://github.com/usesocial/monorepo/commit/ef4d221adc93f52a7afd3cbcfbc35d5d4d5b6131) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Bundle the CLI environment helper so the npm tarball can run directly from Homebrew.
8
+
3
9
  ## 0.2.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.mjs CHANGED
@@ -5,7 +5,6 @@ import * as fs from "node:fs";
5
5
  import { createReadStream, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import { homedir } from "node:os";
7
7
  import { dirname, join, resolve } from "node:path";
8
- import { createEnv } from "@t3-oss/env-core";
9
8
  import { parseArgs, stripVTControlCharacters, styleText } from "node:util";
10
9
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
11
10
  import { createHash } from "node:crypto";
@@ -6280,6 +6279,87 @@ function createPageIterator(page, halt) {
6280
6279
  }
6281
6280
  const MARKUP_BPS = 5e3;
6282
6281
  //#endregion
6282
+ //#region ../../node_modules/.bun/@t3-oss+env-core@0.13.11+1cd18485b0404aca/node_modules/@t3-oss/env-core/dist/standard.js
6283
+ function ensureSynchronous(value, message) {
6284
+ if (value instanceof Promise) throw new Error(message);
6285
+ }
6286
+ function parseWithDictionary(dictionary, value) {
6287
+ const result = {};
6288
+ const issues = [];
6289
+ for (const key in dictionary) {
6290
+ const propResult = dictionary[key]["~standard"].validate(value[key]);
6291
+ ensureSynchronous(propResult, `Validation must be synchronous, but ${key} returned a Promise.`);
6292
+ if (propResult.issues) {
6293
+ issues.push(...propResult.issues.map((issue) => ({
6294
+ ...issue,
6295
+ message: issue.message,
6296
+ path: [key, ...issue.path ?? []]
6297
+ })));
6298
+ continue;
6299
+ }
6300
+ result[key] = propResult.value;
6301
+ }
6302
+ if (issues.length) return { issues };
6303
+ return { value: result };
6304
+ }
6305
+ //#endregion
6306
+ //#region ../../node_modules/.bun/@t3-oss+env-core@0.13.11+1cd18485b0404aca/node_modules/@t3-oss/env-core/dist/index.js
6307
+ /**
6308
+ * Create a new environment variable schema.
6309
+ */
6310
+ function createEnv(opts) {
6311
+ const runtimeEnv = opts.runtimeEnvStrict ?? opts.runtimeEnv ?? process.env;
6312
+ if (opts.emptyStringAsUndefined ?? false) {
6313
+ for (const [key, value] of Object.entries(runtimeEnv)) if (value === "") delete runtimeEnv[key];
6314
+ }
6315
+ if (!!opts.skipValidation) {
6316
+ if (opts.extends) for (const preset of opts.extends) preset.skipValidation = true;
6317
+ return runtimeEnv;
6318
+ }
6319
+ const _client = typeof opts.client === "object" ? opts.client : {};
6320
+ const _server = typeof opts.server === "object" ? opts.server : {};
6321
+ const _shared = typeof opts.shared === "object" ? opts.shared : {};
6322
+ const isServer = opts.isServer ?? (typeof window === "undefined" || "Deno" in window);
6323
+ const finalSchemaShape = isServer ? {
6324
+ ..._server,
6325
+ ..._shared,
6326
+ ..._client
6327
+ } : {
6328
+ ..._client,
6329
+ ..._shared
6330
+ };
6331
+ const parsed = (opts.createFinalSchema?.(finalSchemaShape, isServer))?.["~standard"].validate(runtimeEnv) ?? parseWithDictionary(finalSchemaShape, runtimeEnv);
6332
+ ensureSynchronous(parsed, "Validation must be synchronous");
6333
+ const onValidationError = opts.onValidationError ?? ((issues) => {
6334
+ console.error("❌ Invalid environment variables:", issues);
6335
+ throw new Error("Invalid environment variables");
6336
+ });
6337
+ const onInvalidAccess = opts.onInvalidAccess ?? (() => {
6338
+ throw new Error("❌ Attempted to access a server-side environment variable on the client");
6339
+ });
6340
+ if (parsed.issues) return onValidationError(parsed.issues);
6341
+ const isServerAccess = (prop) => {
6342
+ if (!opts.clientPrefix) return true;
6343
+ return !prop.startsWith(opts.clientPrefix) && !(prop in _shared);
6344
+ };
6345
+ const isValidServerAccess = (prop) => {
6346
+ return isServer || !isServerAccess(prop);
6347
+ };
6348
+ const ignoreProp = (prop) => {
6349
+ return prop === "__esModule" || prop === "$$typeof";
6350
+ };
6351
+ const extendedObj = (opts.extends ?? []).reduce((acc, curr) => {
6352
+ return Object.assign(acc, curr);
6353
+ }, {});
6354
+ const fullObj = Object.assign(extendedObj, parsed.value);
6355
+ return new Proxy(fullObj, { get(target, prop) {
6356
+ if (typeof prop !== "string") return void 0;
6357
+ if (ignoreProp(prop)) return void 0;
6358
+ if (!isValidServerAccess(prop)) return onInvalidAccess(prop);
6359
+ return Reflect.get(target, prop);
6360
+ } });
6361
+ }
6362
+ //#endregion
6283
6363
  //#region ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/iso.js
6284
6364
  const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
6285
6365
  $ZodISODateTime.init(inst, def);
@@ -20841,7 +20921,7 @@ const createInstance = (defaults) => {
20841
20921
  const ky = createInstance();
20842
20922
  //#endregion
20843
20923
  //#region package.json
20844
- var version$1 = "0.2.3";
20924
+ var version$1 = "0.2.4";
20845
20925
  //#endregion
20846
20926
  //#region src/lib/env.ts
20847
20927
  const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "private": false,
14
- "version": "0.2.3",
14
+ "version": "0.2.4",
15
15
  "type": "module",
16
16
  "engines": {
17
17
  "node": ">=22.5.0"