aeria-sdk 0.0.82 → 0.0.84

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/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const node_util_1 = require("node:util");
3
+ const util_1 = require("util");
4
4
  const mirror_js_1 = require("./mirror.js");
5
5
  const utils_js_1 = require("./utils.js");
6
- const { values: opts } = (0, node_util_1.parseArgs)({
6
+ const { values: opts } = (0, util_1.parseArgs)({
7
7
  options: {
8
8
  dev: {
9
9
  type: 'boolean',
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- import { parseArgs } from "node:util";
2
+ import { parseArgs } from "util";
3
3
  import { mirrorRemotely } from "./mirror.mjs";
4
4
  import { getConfig } from "./utils.mjs";
5
5
  const { values: opts } = parseArgs({
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { left, right, isLeft, isRight, unwrapEither, error, isError, unwrapError, throwIfLeft, } from '@aeriajs/common';
1
+ export { left, right, isLeft, isRight, unwrapEither, error, isError, unwrapError, throwIfLeft, throwIfError, } from '@aeriajs/common';
2
2
  export * from './auth.js';
3
3
  export * from './topLevel.js';
4
4
  export * from './constants.js';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.throwIfLeft = exports.unwrapError = exports.isError = exports.error = exports.unwrapEither = exports.isRight = exports.isLeft = exports.right = exports.left = void 0;
17
+ exports.throwIfError = exports.throwIfLeft = exports.unwrapError = exports.isError = exports.error = exports.unwrapEither = exports.isRight = exports.isLeft = exports.right = exports.left = void 0;
18
18
  var common_1 = require("@aeriajs/common");
19
19
  Object.defineProperty(exports, "left", { enumerable: true, get: function () { return common_1.left; } });
20
20
  Object.defineProperty(exports, "right", { enumerable: true, get: function () { return common_1.right; } });
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "error", { enumerable: true, get: function () { r
25
25
  Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return common_1.isError; } });
26
26
  Object.defineProperty(exports, "unwrapError", { enumerable: true, get: function () { return common_1.unwrapError; } });
27
27
  Object.defineProperty(exports, "throwIfLeft", { enumerable: true, get: function () { return common_1.throwIfLeft; } });
28
+ Object.defineProperty(exports, "throwIfError", { enumerable: true, get: function () { return common_1.throwIfError; } });
28
29
  __exportStar(require("./auth.js"), exports);
29
30
  __exportStar(require("./topLevel.js"), exports);
30
31
  __exportStar(require("./constants.js"), exports);
package/dist/index.mjs CHANGED
@@ -8,7 +8,8 @@ export {
8
8
  error,
9
9
  isError,
10
10
  unwrapError,
11
- throwIfLeft
11
+ throwIfLeft,
12
+ throwIfError
12
13
  } from "@aeriajs/common";
13
14
  export * from "./auth.mjs";
14
15
  export * from "./topLevel.mjs";
package/dist/mirror.js CHANGED
@@ -4,6 +4,7 @@ exports.mirrorRemotely = exports.writeMirrorFiles = exports.runtimeEsm = exports
4
4
  const path = require("path");
5
5
  const common_1 = require("@aeriajs/common");
6
6
  const promises_1 = require("fs/promises");
7
+ const module_1 = require("module");
7
8
  const topLevel_js_1 = require("./topLevel.js");
8
9
  const utils_js_1 = require("./utils.js");
9
10
  const mirrorDts = (mirrorObj, config) => {
@@ -107,7 +108,16 @@ export default aeria
107
108
  \n`;
108
109
  exports.runtimeEsm = runtimeEsm;
109
110
  const writeMirrorFiles = async (mirror, config, filesPath = path.join(process.cwd(), '.aeria')) => {
110
- const runtimeBase = path.dirname(require.resolve('aeria-sdk'));
111
+ const resolvedPath = (() => {
112
+ try {
113
+ return require.resolve('aeria-sdk');
114
+ }
115
+ catch (err) {
116
+ }
117
+ const syntheticRequire = (0, module_1.createRequire)(process.cwd());
118
+ return syntheticRequire.resolve('aeria-sdk');
119
+ })();
120
+ const runtimeBase = path.dirname(resolvedPath);
111
121
  await (0, promises_1.mkdir)(runtimeBase, {
112
122
  recursive: true,
113
123
  });
package/dist/mirror.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import * as path from "path";
3
3
  import { deserialize } from "@aeriajs/common";
4
4
  import { writeFile, mkdir } from "fs/promises";
5
+ import { createRequire } from "module";
5
6
  import { topLevel } from "./topLevel.mjs";
6
7
  import { publicUrl } from "./utils.mjs";
7
8
  const mirrorDts = (mirrorObj, config) => {
@@ -107,7 +108,15 @@ export default aeria
107
108
 
108
109
  `;
109
110
  export const writeMirrorFiles = async (mirror, config, filesPath = path.join(process.cwd(), ".aeria")) => {
110
- const runtimeBase = path.dirname(require.resolve("aeria-sdk"));
111
+ const resolvedPath = (() => {
112
+ try {
113
+ return require.resolve("aeria-sdk");
114
+ } catch (err) {
115
+ }
116
+ const syntheticRequire = createRequire(process.cwd());
117
+ return syntheticRequire.resolve("aeria-sdk");
118
+ })();
119
+ const runtimeBase = path.dirname(resolvedPath);
111
120
  await mkdir(runtimeBase, {
112
121
  recursive: true
113
122
  });
package/dist/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getConfig = exports.publicUrl = void 0;
4
- const common_1 = require("@aeriajs/common");
5
4
  const path = require("path");
5
+ const fs = require("fs/promises");
6
6
  const publicUrl = (config) => {
7
7
  if (typeof config.publicUrl === 'string') {
8
8
  return config.publicUrl;
@@ -13,7 +13,9 @@ const publicUrl = (config) => {
13
13
  };
14
14
  exports.publicUrl = publicUrl;
15
15
  const getConfig = async () => {
16
- const { aeriaSdk } = await (0, common_1.dynamicImport)(path.join(process.cwd(), 'package.json'));
16
+ const { aeriaSdk } = JSON.parse(await fs.readFile(path.join(process.cwd(), 'package.json'), {
17
+ encoding: 'utf8',
18
+ }));
17
19
  if (typeof aeriaSdk !== 'object' || !aeriaSdk) {
18
20
  throw new Error('aeriaSdk is absent in package.json');
19
21
  }
package/dist/utils.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- import { dynamicImport } from "@aeriajs/common";
3
2
  import * as path from "path";
3
+ import * as fs from "fs/promises";
4
4
  export const publicUrl = (config) => {
5
5
  if (typeof config.publicUrl === "string") {
6
6
  return config.publicUrl;
@@ -8,7 +8,9 @@ export const publicUrl = (config) => {
8
8
  return config.environment === "development" ? config.publicUrl.development : config.publicUrl.production;
9
9
  };
10
10
  export const getConfig = async () => {
11
- const { aeriaSdk } = await dynamicImport(path.join(process.cwd(), "package.json"));
11
+ const { aeriaSdk } = JSON.parse(await fs.readFile(path.join(process.cwd(), "package.json"), {
12
+ encoding: "utf8"
13
+ }));
12
14
  if (typeof aeriaSdk !== "object" || !aeriaSdk) {
13
15
  throw new Error("aeriaSdk is absent in package.json");
14
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aeria-sdk",
3
- "version": "0.0.82",
3
+ "version": "0.0.84",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",