@ldsg/create-app 0.1.0-alpha.18 → 0.2.0

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.
@@ -5,7 +5,7 @@ interface CreateAppParams {
5
5
  resources?: Resource[];
6
6
  resourceRecords?: ResourceRecord[];
7
7
  }
8
- type CreateApp = (params: CreateAppParams) => Promise<Express>;
8
+ type CreateApp = (params: CreateAppParams) => Express;
9
9
  export declare const createApp: CreateApp;
10
10
  export {};
11
11
  //# sourceMappingURL=create-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/utils/create-app.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACpC;AAED,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/D,eAAO,MAAM,SAAS,EAAE,SAgCvB,CAAC"}
1
+ {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/utils/create-app.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACpC;AAED,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC;AAEtD,eAAO,MAAM,SAAS,EAAE,SAgCvB,CAAC"}
@@ -1,18 +1,9 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.createApp = void 0;
13
4
  const application_1 = require("@ldsg/application");
14
5
  const resource_instantiator_1 = require("@ldsg/resource-instantiator");
15
- const createApp = (params) => __awaiter(void 0, void 0, void 0, function* () {
6
+ const createApp = (params) => {
16
7
  const { resources: paramsResources, resourceRecords } = params;
17
8
  let resources;
18
9
  if (paramsResources) {
@@ -32,7 +23,7 @@ const createApp = (params) => __awaiter(void 0, void 0, void 0, function* () {
32
23
  if (!applicationResource) {
33
24
  throw new Error("invalid application resource");
34
25
  }
35
- const res = yield applicationResource.createExpressApp();
26
+ const res = applicationResource.createExpressApp();
36
27
  return res;
37
- });
28
+ };
38
29
  exports.createApp = createApp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/create-app",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.2.0",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"
@@ -15,10 +15,10 @@
15
15
  "dependencies": {
16
16
  "express": "^4.18.2",
17
17
  "express-async-handler": "^1.2.0",
18
- "@ldsg/application": "0.1.0-alpha.18",
19
- "@ldsg/common": "0.1.0-alpha.18",
20
- "@ldsg/resource": "0.1.0-alpha.18",
21
- "@ldsg/resource-instantiator": "0.1.0-alpha.18"
18
+ "@ldsg/application": "0.2.0",
19
+ "@ldsg/common": "0.2.0",
20
+ "@ldsg/resource": "0.2.0",
21
+ "@ldsg/resource-instantiator": "0.2.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/express": "^4.17.17",
@@ -28,8 +28,8 @@
28
28
  "tslib": "^2.6.2",
29
29
  "supertest": "^6.3.4",
30
30
  "typescript": "^5.4.5",
31
- "@ldsg/constants": "0.1.0-alpha.18",
32
- "@ldsg/types": "0.1.0-alpha.18"
31
+ "@ldsg/constants": "0.2.0",
32
+ "@ldsg/types": "0.2.0"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pnpm clean && tsc --project tsconfig.build.json",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=create-app.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-app.test.d.ts","sourceRoot":"","sources":["../../src/utils/create-app.test.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const constants_1 = require("@ldsg/constants");
16
- const supertest_1 = __importDefault(require("supertest"));
17
- const create_app_1 = require("./create-app");
18
- test("create app", () => __awaiter(void 0, void 0, void 0, function* () {
19
- const app = yield (0, create_app_1.createApp)(constants_1.APP_MANIFEST);
20
- const response = yield (0, supertest_1.default)(app).get("/");
21
- expect(response.statusCode).toBe(200);
22
- expect(response.text).toBe("Hello, World!");
23
- }));