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 +2 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/mirror.js +11 -1
- package/dist/mirror.mjs +10 -1
- package/dist/utils.js +4 -2
- package/dist/utils.mjs +4 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
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,
|
|
6
|
+
const { values: opts } = (0, util_1.parseArgs)({
|
|
7
7
|
options: {
|
|
8
8
|
dev: {
|
|
9
9
|
type: 'boolean',
|
package/dist/cli.mjs
CHANGED
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
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
|
|
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
|
|
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
|
|
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
|
|
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
|
}
|