jcc-express-mvc 1.3.14 → 1.3.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":"AAIA,qBAAa,aAAa;IAElB,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC;IAS7B,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;CAmBzE"}
1
+ {"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":"AAKA,qBAAa,aAAa;IAElB,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC;IAS7B,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;CAuBzE"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConsoleKernel = void 0;
4
+ const buildCommand_1 = require("./buildCommand");
4
5
  const DBCommand_1 = require("./DBCommand");
5
6
  const MakeCommand_1 = require("./MakeCommand");
6
7
  const MigrateCommand_1 = require("./MigrateCommand");
@@ -24,6 +25,9 @@ class ConsoleKernel {
24
25
  case "make":
25
26
  await (0, MakeCommand_1.makeCommand)(argvs);
26
27
  return;
28
+ case "build":
29
+ (0, buildCommand_1.BuildCommand)();
30
+ return;
27
31
  default:
28
32
  console.log("Sorry command not found");
29
33
  return;
@@ -0,0 +1,2 @@
1
+ export declare const BuildCommand: () => undefined;
2
+ //# sourceMappingURL=buildCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/buildCommand.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,iBAWxB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BuildCommand = void 0;
7
+ const TsConfig_1 = require("./files/TsConfig");
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
9
+ const colors_1 = __importDefault(require("colors"));
10
+ const fs_1 = __importDefault(require("fs"));
11
+ const app_root_path_1 = __importDefault(require("app-root-path"));
12
+ const BuildCommand = () => {
13
+ try {
14
+ fs_1.default.writeFileSync(`${app_root_path_1.default.path}/build/tsconfig.json`, (0, TsConfig_1.TsConfig)());
15
+ fs_extra_1.default.copySync("resources", "build/resources");
16
+ fs_extra_1.default.copySync("public", "build/public");
17
+ fs_extra_1.default.copyFileSync("package.json", "build/package.json");
18
+ console.log(colors_1.default.green(`App build successfully`));
19
+ return process.exit(0);
20
+ }
21
+ catch (error) {
22
+ console.log(error.message);
23
+ }
24
+ };
25
+ exports.BuildCommand = BuildCommand;
@@ -0,0 +1,2 @@
1
+ export declare const TsConfig: () => string;
2
+ //# sourceMappingURL=TsConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TsConfig.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/TsConfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,cAepB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TsConfig = void 0;
4
+ const TsConfig = () => {
5
+ return `{
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "paths": {
9
+ "@/Model/*": ["app/Models/*"],
10
+ "@Controllers/*": ["app/Http/Controllers/*"],
11
+ "@/Request/*": ["app/Http/Requests/*"],
12
+ "@Providers/*": ["app/Providers/*"],
13
+ "@/Services/*": ["app/Services/*"],
14
+ }
15
+ }
16
+ }
17
+
18
+ `;
19
+ };
20
+ exports.TsConfig = TsConfig;
@@ -41,5 +41,6 @@ export declare class EngineHelpers extends TemplateRegex {
41
41
  */
42
42
  protected removeQuotes(str: string): string;
43
43
  protected evaluateCondition(condition: string, locals: any): string | boolean;
44
+ protected getAssets(content: string): string;
44
45
  }
45
46
  //# sourceMappingURL=engineHelper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engineHelper.d.ts","sourceRoot":"","sources":["../../../framework/lib/Templating-engine/engineHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,qBAAa,aAAc,SAAQ,aAAa;IAG9C;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,WAAW;IAM3D;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IA2BhE;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAKxE;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IASxC;;;;OAIG;IACH,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI3C,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;CA+B3D"}
1
+ {"version":3,"file":"engineHelper.d.ts","sourceRoot":"","sources":["../../../framework/lib/Templating-engine/engineHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,qBAAa,aAAc,SAAQ,aAAa;IAG9C;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,WAAW;IAM3D;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IA2BhE;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAKxE;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IASxC;;;;OAIG;IACH,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI3C,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;IAgC1D,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM;CAUpC"}
@@ -123,5 +123,15 @@ class EngineHelpers extends expressions_1.TemplateRegex {
123
123
  return false;
124
124
  }
125
125
  }
126
+ getAssets(content) {
127
+ let value = content
128
+ .trim()
129
+ .match(/assets\((?<assetsPath>['"]([^'"]+)['"])\)/)?.groups || {
130
+ assetsPath: "",
131
+ };
132
+ const path = value.assetsPath.replace(/\./g, "/").replace(/\"/g, "").trim();
133
+ const assetType = path.split("/")[0] || "";
134
+ return assetType === "js" ? `${path}.js` : `${path}.css`;
135
+ }
126
136
  }
127
137
  exports.EngineHelpers = EngineHelpers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../framework/lib/Templating-engine/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aA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,OAAO,CAAC,KAAK;IASb;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAmCd;;;;OAIG;YACW,QAAQ;IAQhB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;CAa1D;AAED,eAAO,MAAM,aAAa,kBAAyB,CAAC"}
@@ -21,7 +21,12 @@ class TemplatingEngine extends engineHelper_1.EngineHelpers {
21
21
  * @returns {string} - Rendered content.
22
22
  */
23
23
  handleVariable(content, match, param) {
24
- const variableName = match.groups.param;
24
+ const variableName = match.groups.param || "";
25
+ if (variableName.trim().startsWith("assets")) {
26
+ const assets = this.getAssets(variableName);
27
+ const newContent = content.replace(/{{\s*([^}]+)\s*}}/, assets);
28
+ return this.parser(newContent, param);
29
+ }
25
30
  const variableValue = this.accessNestedProperty(param, variableName);
26
31
  const newContent = content.replace(/{{\s*([^}]+)\s*}}/, variableValue);
27
32
  return this.parser(newContent, param);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcc-express-mvc",
3
- "version": "1.3.14",
3
+ "version": "1.3.16",
4
4
  "description": "express mvc structure",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",