miqro 1.7.16 → 1.7.19

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
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const utils_1 = require("./utils");
5
5
  const start_1 = require("./cmds/start");
6
+ const test_1 = require("./cmds/test");
6
7
  const watch_1 = require("./cmds/watch");
7
8
  const new_1 = require("./cmds/new");
8
9
  const doc_json_1 = require("./cmds/doc-json");
@@ -65,7 +66,7 @@ const db_migrate_1 = require("./cmds/db-migrate");
65
66
  },
66
67
  ["serve"]: {
67
68
  //section: "serve static files",
68
- tabs: 6,
69
+ tabs: 5,
69
70
  cb: serve_1.main, description: `serve static files. ${serve_1.usage}`
70
71
  },
71
72
  /*["generate:html:cache"]: {
@@ -84,7 +85,8 @@ const db_migrate_1 = require("./cmds/db-migrate");
84
85
  tabs: 5,
85
86
  description: `outputs to a file an api folder auto doc as a markdown. ${doc_md_1.usage}`
86
87
  },
87
- ["new:test"]: { section: "testing", cb: new_test_1.main, tabs: 4, description: `create new test.js file. ${new_test_1.usage}` },
88
+ ["test"]: { section: "testing", cb: test_1.main, tabs: 5, description: `run test files. ${test_1.usage}` },
89
+ ["new:test"]: { cb: new_test_1.main, tabs: 4, description: `create new test.js file. ${new_test_1.usage}` },
88
90
  ["db:console"]: {
89
91
  section: "sequelize helpers",
90
92
  cb: db_console_1.main,
@@ -99,7 +101,7 @@ const db_migrate_1 = require("./cmds/db-migrate");
99
101
  ["db:push:data"]: { cb: db_push_data_1.main, tabs: 4, description: `push a dump to the database. ${db_push_data_1.usage}` },
100
102
  ["db:make:migration"]: {
101
103
  cb: db_makemigrations_1.main,
102
- tabs: 2,
104
+ tabs: 3,
103
105
  description: `seeks changes in your models and creates migrations. ${db_makemigrations_1.usage}`
104
106
  },
105
107
  ["db:make:migration:force:clean:state"]: {
@@ -6,19 +6,9 @@ const fs_1 = require("fs");
6
6
  const path_1 = require("path");
7
7
  exports.usage = `usage: [NODE_ENV=development] npx miqro new:test <identifier ex: TEST_SOMEFILE>`;
8
8
  const testTemplates = {
9
- js: (category) => `const options = {
10
- category: "${category}",
11
- before: async () => {
9
+ js: (category) => `it("happy path", async () => {
12
10
 
13
- },
14
- after: async () => {
15
-
16
- }
17
- };
18
-
19
- it("happy path", async () => {
20
-
21
- }, options)
11
+ })
22
12
  `
23
13
  };
24
14
  const main = () => {
@@ -0,0 +1,2 @@
1
+ export declare const usage = "usage: npx miqro test <test_files> [-r <folder>] [-i] [-n testname]";
2
+ export declare const main: () => void;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = exports.usage = void 0;
4
+ const utils_1 = require("../utils");
5
+ const test_1 = require("@miqro/test");
6
+ const core_1 = require("@miqro/core");
7
+ exports.usage = "usage: npx miqro test <test_files> [-r <folder>] [-i] [-n testname]";
8
+ const main = () => {
9
+ if (process.argv.length <= 3) {
10
+ throw new Error(`invalid number of args\n${exports.usage}`);
11
+ }
12
+ (0, core_1.loadConfig)();
13
+ (0, utils_1.execSync)(`${process.argv[0]} ${(0, test_1.mainPath)()} ${process.argv.slice(3).join(" ")}`);
14
+ };
15
+ exports.main = main;
@@ -1,2 +1,2 @@
1
- export declare const usage = "npx miqro generate:template:cache <src> <out.js>";
1
+ export declare const usage = "npx miqro generate:template:cache <src> <out.json>";
2
2
  export declare const main: () => Promise<void>;
@@ -20,7 +20,7 @@ function recursiveSearch(path, found = []) {
20
20
  }
21
21
  return found;
22
22
  }
23
- exports.usage = "npx miqro generate:template:cache <src> <out.js>";
23
+ exports.usage = "npx miqro generate:template:cache <src> <out.json>";
24
24
  const main = async () => {
25
25
  if (process.argv.length !== 5 || process.argv[3].length < 1 || process.argv[4].length < 1) {
26
26
  throw new Error(exports.usage);
@@ -39,15 +39,9 @@ const main = async () => {
39
39
  for (const template of foundTemplates) {
40
40
  if (template) {
41
41
  const url = (0, path_1.relative)(path, template);
42
- const content = (0, fs_1.readFileSync)(template).toString("utf-8");
43
- cache[url] = {
44
- location: {
45
- url
46
- },
47
- content
48
- };
42
+ cache[url] = (0, fs_1.readFileSync)(template).toString("utf-8");
49
43
  }
50
44
  }
51
- (0, fs_1.writeFileSync)(outFilePath, `module.exports = ${JSON.stringify(cache, undefined, 0)};`);
45
+ (0, fs_1.writeFileSync)(outFilePath, `${JSON.stringify(cache, undefined, 0)}`);
52
46
  };
53
47
  exports.main = main;
@@ -81,13 +81,14 @@ const mainCMD = (cmds, usage, logger, cmdArg = process.argv[2], exit = true) =>
81
81
  logger.info(`${usage}`);
82
82
  logger.info(`Available commands:\n`);
83
83
  for (const cmd of Object.keys(cmds)) {
84
- /*if (cmds[cmd].section) {
85
- logger.info(`\n${cmds[cmd].section}\n`);
86
- }*/
84
+ if (cmds[cmd].section) {
85
+ logger.info(`\n${cmds[cmd].section}\n`);
86
+ }
87
87
  //const description = cmds[cmd].description.split("\n").map(s => `${getTabs(/*cmds[cmd].tabs*/2)}${s}`).join("\n");
88
- const description = cmds[cmd].description.split("\n").map(s => `${getTabs(/*cmds[cmd].tabs*/ 1)}${s}`).join("\n");
89
- //logger.info(`\t${cmd}\n${description}`);
90
- logger.info(`${cmd}\n${description}`);
88
+ //const description = cmds[cmd].description.split("\n").map(s => `${getTabs(/*cmds[cmd].tabs*/1)}${s}`).join("\n");
89
+ const description = cmds[cmd].description.split("\n").map(s => `${getTabs(cmds[cmd].tabs)}${s}`).join("\n");
90
+ logger.info(`\t${cmd}${description}`);
91
+ //logger.info(`${cmd}\n${description}`);
91
92
  }
92
93
  logger.info("");
93
94
  if (exit) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miqro",
3
- "version": "1.7.16",
3
+ "version": "1.7.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,13 +17,13 @@
17
17
  "author": "claukers",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@miqro/core": "^1.5.13",
21
- "@miqro/parser": "^0.0.7",
22
- "@miqro/runner": "^1.2.6",
20
+ "@miqro/core": "^1.5.16",
21
+ "@miqro/parser": "^0.1.2",
22
+ "@miqro/runner": "^1.2.7",
23
+ "@miqro/test": "^0.2.0",
23
24
  "deep-diff": "1.0.2"
24
25
  },
25
26
  "devDependencies": {
26
- "@miqro/test": "0.0.12",
27
27
  "@types/cookie": "0.4.1",
28
28
  "@types/deep-diff": "1.0.1",
29
29
  "@types/node": "17.0.23",