aeria 0.0.0 → 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2023 João Santos (joaosan177@gmail.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ export * from '@aeriajs/access-control';
2
+ export * from '@aeriajs/api';
3
+ export * from '@aeriajs/common';
4
+ export * from '@aeriajs/entrypoint';
5
+ export * from '@aeriajs/http';
6
+ export * from '@aeriajs/node-http';
7
+ export * from '@aeriajs/security';
8
+ export * from '@aeriajs/server';
9
+ export * from '@aeriajs/builtins';
10
+ export * from '@aeriajs/types';
11
+ export * from '@aeriajs/validation';
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@aeriajs/access-control"), exports);
18
+ __exportStar(require("@aeriajs/api"), exports);
19
+ __exportStar(require("@aeriajs/common"), exports);
20
+ __exportStar(require("@aeriajs/entrypoint"), exports);
21
+ __exportStar(require("@aeriajs/http"), exports);
22
+ __exportStar(require("@aeriajs/node-http"), exports);
23
+ __exportStar(require("@aeriajs/security"), exports);
24
+ __exportStar(require("@aeriajs/server"), exports);
25
+ __exportStar(require("@aeriajs/builtins"), exports);
26
+ __exportStar(require("@aeriajs/types"), exports);
27
+ __exportStar(require("@aeriajs/validation"), exports);
package/dist/index.mjs ADDED
@@ -0,0 +1,11 @@
1
+ export * from "@aeriajs/access-control";
2
+ export * from "@aeriajs/api";
3
+ export * from "@aeriajs/common";
4
+ export * from "@aeriajs/entrypoint";
5
+ export * from "@aeriajs/http";
6
+ export * from "@aeriajs/node-http";
7
+ export * from "@aeriajs/security";
8
+ export * from "@aeriajs/server";
9
+ export * from "@aeriajs/builtins";
10
+ export * from "@aeriajs/types";
11
+ export * from "@aeriajs/validation";
@@ -0,0 +1 @@
1
+ export {};
package/dist/loader.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("@aeriajs/common");
4
+ const main = async () => {
5
+ const entrypoint = await (0, common_1.dynamicImport)(process.argv[1]);
6
+ const entrypointMain = entrypoint.default
7
+ ? entrypoint.default
8
+ : entrypoint;
9
+ entrypointMain.listen();
10
+ };
11
+ main();
@@ -0,0 +1,150 @@
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
+ try {
3
+ var info = gen[key](arg);
4
+ var value = info.value;
5
+ } catch (error) {
6
+ reject(error);
7
+ return;
8
+ }
9
+ if (info.done) {
10
+ resolve(value);
11
+ } else {
12
+ Promise.resolve(value).then(_next, _throw);
13
+ }
14
+ }
15
+ function _async_to_generator(fn) {
16
+ return function() {
17
+ var self = this, args = arguments;
18
+ return new Promise(function(resolve, reject) {
19
+ var gen = fn.apply(self, args);
20
+ function _next(value) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
+ }
23
+ function _throw(err) {
24
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
+ }
26
+ _next(undefined);
27
+ });
28
+ };
29
+ }
30
+ function _ts_generator(thisArg, body) {
31
+ var f, y, t, g, _ = {
32
+ label: 0,
33
+ sent: function() {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
39
+ };
40
+ return g = {
41
+ next: verb(0),
42
+ "throw": verb(1),
43
+ "return": verb(2)
44
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
+ return this;
46
+ }), g;
47
+ function verb(n) {
48
+ return function(v) {
49
+ return step([
50
+ n,
51
+ v
52
+ ]);
53
+ };
54
+ }
55
+ function step(op) {
56
+ if (f) throw new TypeError("Generator is already executing.");
57
+ while(_)try {
58
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
+ if (y = 0, t) op = [
60
+ op[0] & 2,
61
+ t.value
62
+ ];
63
+ switch(op[0]){
64
+ case 0:
65
+ case 1:
66
+ t = op;
67
+ break;
68
+ case 4:
69
+ _.label++;
70
+ return {
71
+ value: op[1],
72
+ done: false
73
+ };
74
+ case 5:
75
+ _.label++;
76
+ y = op[1];
77
+ op = [
78
+ 0
79
+ ];
80
+ continue;
81
+ case 7:
82
+ op = _.ops.pop();
83
+ _.trys.pop();
84
+ continue;
85
+ default:
86
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
87
+ _ = 0;
88
+ continue;
89
+ }
90
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
91
+ _.label = op[1];
92
+ break;
93
+ }
94
+ if (op[0] === 6 && _.label < t[1]) {
95
+ _.label = t[1];
96
+ t = op;
97
+ break;
98
+ }
99
+ if (t && _.label < t[2]) {
100
+ _.label = t[2];
101
+ _.ops.push(op);
102
+ break;
103
+ }
104
+ if (t[2]) _.ops.pop();
105
+ _.trys.pop();
106
+ continue;
107
+ }
108
+ op = body.call(thisArg, _);
109
+ } catch (e) {
110
+ op = [
111
+ 6,
112
+ e
113
+ ];
114
+ y = 0;
115
+ } finally{
116
+ f = t = 0;
117
+ }
118
+ if (op[0] & 5) throw op[1];
119
+ return {
120
+ value: op[0] ? op[1] : void 0,
121
+ done: true
122
+ };
123
+ }
124
+ }
125
+ import { dynamicImport } from "@aeriajs/common";
126
+ var main = function() {
127
+ var _ref = _async_to_generator(function() {
128
+ var entrypoint, entrypointMain;
129
+ return _ts_generator(this, function(_state) {
130
+ switch(_state.label){
131
+ case 0:
132
+ return [
133
+ 4,
134
+ dynamicImport(process.argv[1])
135
+ ];
136
+ case 1:
137
+ entrypoint = _state.sent();
138
+ entrypointMain = entrypoint.default ? entrypoint.default : entrypoint;
139
+ entrypointMain.listen();
140
+ return [
141
+ 2
142
+ ];
143
+ }
144
+ });
145
+ });
146
+ return function main() {
147
+ return _ref.apply(this, arguments);
148
+ };
149
+ }();
150
+ main();
package/package.json CHANGED
@@ -1,12 +1,47 @@
1
1
  {
2
2
  "name": "aeria",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public"
8
10
  },
9
11
  "keywords": [],
10
12
  "author": "",
11
- "license": "ISC"
12
- }
13
+ "license": "ISC",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js",
18
+ "types": "./dist/index.d.ts"
19
+ },
20
+ "./loader": "./dist/loader.js"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "peerDependencies": {
26
+ "@aeriajs/access-control": "^0.0.0",
27
+ "@aeriajs/api": "^0.0.1",
28
+ "@aeriajs/common": "^0.0.0",
29
+ "@aeriajs/entrypoint": "^0.0.0",
30
+ "@aeriajs/http": "^0.0.1",
31
+ "@aeriajs/node-http": "^0.0.1",
32
+ "@aeriajs/security": "^0.0.1",
33
+ "@aeriajs/server": "^0.0.1",
34
+ "@aeriajs/builtins": "^0.0.1",
35
+ "@aeriajs/types": "^0.0.0",
36
+ "@aeriajs/validation": "^0.0.1"
37
+ },
38
+ "scripts": {
39
+ "test": "echo skipping",
40
+ "lint": "eslint src",
41
+ "lint:fix": "eslint src --fix",
42
+ "build": "pnpm build:cjs && pnpm build:esm",
43
+ "build:cjs": "tsc",
44
+ "build:esm": "swc src/* -d dist --strip-leading-paths -C module.type=es6 --out-file-extension=mjs && pnpm build:esm-transform",
45
+ "build:esm-transform": "pnpm -w esm-transform $PWD/dist"
46
+ }
47
+ }