miqro 1.7.23 → 1.8.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/dist/cli.js +9 -4
- package/dist/cmds/serve.js +1 -4
- package/dist/utils/db/index.d.ts +3 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/templates.d.ts +1 -1
- package/dist/utils/xml.d.ts +1 -0
- package/dist/utils/xml.js +96 -0
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,8 @@ const db_createmodel_1 = require("./cmds/db-createmodel");
|
|
|
24
24
|
const db_push_data_1 = require("./cmds/db-push-data");
|
|
25
25
|
const db_dump_data_1 = require("./cmds/db-dump-data");
|
|
26
26
|
const db_migrate_1 = require("./cmds/db-migrate");
|
|
27
|
-
|
|
27
|
+
//import {main as wcCompileSFC, usage as wcCompileSFCUsage} from "./cmds/wc-compile-sfc";
|
|
28
|
+
const wc_cache_templates_1 = require("./cmds/wc-cache-templates");
|
|
28
29
|
// noinspection SpellCheckingInspection
|
|
29
30
|
(0, utils_1.mainCMD)({
|
|
30
31
|
["new"]: { section: "quick start", cb: new_1.mainJS, tabs: 5, description: `create a new project. ${new_1.usageJS}` },
|
|
@@ -70,10 +71,14 @@ console.log("asldkjdkla");
|
|
|
70
71
|
tabs: 5,
|
|
71
72
|
cb: serve_1.main, description: `serve static files. ${serve_1.usage}`
|
|
72
73
|
},
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
["generate:template:cache"]: {
|
|
75
|
+
section: "web components",
|
|
76
|
+
tabs: 6,
|
|
77
|
+
cb: wc_cache_templates_1.main, description: `generate a cache.json for webcomponents. ${wc_cache_templates_1.usage}`
|
|
78
|
+
},
|
|
79
|
+
/*["sfc"]: {
|
|
75
80
|
tabs: 6,
|
|
76
|
-
cb:
|
|
81
|
+
cb: wcCompileSFC, description: `transpiles a single file webcomponent to commonjs file for packing. ${wcCompileSFCUsage}`
|
|
77
82
|
},*/
|
|
78
83
|
["doc"]: {
|
|
79
84
|
section: "api documentation",
|
package/dist/cmds/serve.js
CHANGED
|
@@ -8,7 +8,6 @@ const tokenize_match_1 = require("@miqro/core/dist/common/tokenize-match");
|
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
exports.usage = `usage: [NODE_ENV=development] npx miqro serve [directory=./] [path=/] [--index404 ./index.html] [--proxy-cert-ignore] [--port 8080] [--proxy /api=https://host/api]`;
|
|
10
10
|
const main = () => {
|
|
11
|
-
console.log("asldkjdkla");
|
|
12
11
|
const flags = (0, utils_1.extractFlags)(process.argv.slice(3), {
|
|
13
12
|
flags: {
|
|
14
13
|
"index404Status": {
|
|
@@ -47,8 +46,6 @@ const main = () => {
|
|
|
47
46
|
}
|
|
48
47
|
const app = new core_1.App();
|
|
49
48
|
app.use((0, core_1.LoggerHandler)());
|
|
50
|
-
console.log("asldkjdkla");
|
|
51
|
-
console.dir(flags);
|
|
52
49
|
const proxyList = flags.flags.proxy instanceof Array ? flags.flags.proxy : [flags.flags.proxy];
|
|
53
50
|
for (const proxy of proxyList) {
|
|
54
51
|
if (proxy) {
|
|
@@ -74,7 +71,7 @@ const main = () => {
|
|
|
74
71
|
index404Status: flags.flags.index404Status ? parseInt(flags.flags.index404Status, 10) : undefined
|
|
75
72
|
}), path);
|
|
76
73
|
app.listen(PORT, () => {
|
|
77
|
-
console.log("serving " + directory + " on "
|
|
74
|
+
console.log("serving " + directory + " on http://localhost:%s%s", PORT, path);
|
|
78
75
|
});
|
|
79
76
|
};
|
|
80
77
|
exports.main = main;
|
package/dist/utils/db/index.d.ts
CHANGED
|
@@ -5,16 +5,16 @@ export interface SequelizeRC {
|
|
|
5
5
|
"seeders-path": string;
|
|
6
6
|
"models-path": string;
|
|
7
7
|
}
|
|
8
|
-
export declare const loadSequelizeRC: (sequelizercPath?: string, logger?: Logger
|
|
8
|
+
export declare const loadSequelizeRC: (sequelizercPath?: string, logger?: Logger) => SequelizeRC;
|
|
9
9
|
export declare const loadModels: (args?: {
|
|
10
10
|
"models-path": string;
|
|
11
|
-
}
|
|
11
|
+
}) => {
|
|
12
12
|
path: string;
|
|
13
13
|
modelsModule: any;
|
|
14
14
|
};
|
|
15
15
|
export declare const loadSequelize: (args?: {
|
|
16
16
|
"models-path": string;
|
|
17
|
-
}
|
|
17
|
+
}, l?: Logger) => any;
|
|
18
18
|
export declare const initDBConfig: () => boolean;
|
|
19
19
|
export declare const makemigrations: () => void;
|
|
20
20
|
export declare const syncMakeMigrations: () => void;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ExecSyncOptionsWithBufferEncoding } from "child_process";
|
|
3
|
-
export declare const execSync: (cmd: string, options?: ExecSyncOptionsWithBufferEncoding
|
|
3
|
+
export declare const execSync: (cmd: string, options?: ExecSyncOptionsWithBufferEncoding) => void;
|
|
4
4
|
export declare type Callback<T = any> = (...args: any[]) => T;
|
|
5
5
|
export declare const extractFlags: (args: string[], options?: {
|
|
6
6
|
flags: {
|
|
@@ -5,7 +5,7 @@ export declare const authEnvFile = "####################\n## Auth\nTOKEN_LOCATIO
|
|
|
5
5
|
export declare const templates: {
|
|
6
6
|
modelsIndex: string;
|
|
7
7
|
dbConfig: string;
|
|
8
|
-
sequelizerc: (typescript?: boolean
|
|
8
|
+
sequelizerc: (typescript?: boolean) => string;
|
|
9
9
|
exampleModel: (modelName: string) => string;
|
|
10
10
|
logEnvFile: string;
|
|
11
11
|
authEnvFile: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseXML2JSON: (val: string) => Promise<any>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseXML2JSON = void 0;
|
|
4
|
+
const { parser } = require("sax");
|
|
5
|
+
const parseXML2JSON = async (val) => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const ret = {
|
|
8
|
+
name: "ROOT",
|
|
9
|
+
attributes: {},
|
|
10
|
+
type: "root",
|
|
11
|
+
isSelfClosing: false,
|
|
12
|
+
text: "",
|
|
13
|
+
children: []
|
|
14
|
+
};
|
|
15
|
+
let current = {
|
|
16
|
+
ref: ret
|
|
17
|
+
};
|
|
18
|
+
const p = parser(undefined, {
|
|
19
|
+
noscript: true,
|
|
20
|
+
trim: true
|
|
21
|
+
});
|
|
22
|
+
p.onerror = (e) => {
|
|
23
|
+
// an error happened.
|
|
24
|
+
console.error(e);
|
|
25
|
+
};
|
|
26
|
+
p.oncomment = (c) => {
|
|
27
|
+
if (!current) {
|
|
28
|
+
console.error("current null");
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const node = {
|
|
32
|
+
name: "COMMENT",
|
|
33
|
+
attributes: {},
|
|
34
|
+
type: "comment",
|
|
35
|
+
isSelfClosing: true,
|
|
36
|
+
text: c,
|
|
37
|
+
children: []
|
|
38
|
+
};
|
|
39
|
+
current.ref.children.push(node);
|
|
40
|
+
};
|
|
41
|
+
p.ontext = (t) => {
|
|
42
|
+
if (!current) {
|
|
43
|
+
console.error("current null");
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
const node = {
|
|
47
|
+
name: "TEXT",
|
|
48
|
+
attributes: {},
|
|
49
|
+
type: "text",
|
|
50
|
+
isSelfClosing: true,
|
|
51
|
+
text: t,
|
|
52
|
+
children: []
|
|
53
|
+
};
|
|
54
|
+
current.ref.children.push(node);
|
|
55
|
+
};
|
|
56
|
+
p.onopentag = (node) => {
|
|
57
|
+
// opened a tag. node has "name" and "attributes"
|
|
58
|
+
/*if (node.name.toLocaleLowerCase() === "bpmn:sequenceflow") {
|
|
59
|
+
console.log("open %o", node);
|
|
60
|
+
}*/
|
|
61
|
+
if (!current) {
|
|
62
|
+
console.error("current null");
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
node.type = "node";
|
|
66
|
+
node.text = "";
|
|
67
|
+
node.children = [];
|
|
68
|
+
current.ref.children.push(node);
|
|
69
|
+
current = {
|
|
70
|
+
parent: current,
|
|
71
|
+
ref: node
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
p.onattribute = (attr) => {
|
|
75
|
+
// console.dir(attr);
|
|
76
|
+
};
|
|
77
|
+
p.onclosetag = (node) => {
|
|
78
|
+
// opened a tag. node has "name" and "attributes"
|
|
79
|
+
// console.log("close %s", node);
|
|
80
|
+
if (!current) {
|
|
81
|
+
console.error("current null");
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
current = current.parent ? current.parent : {
|
|
85
|
+
ref: ret
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
p.onend = () => {
|
|
89
|
+
// console.log("end");
|
|
90
|
+
// parser stream is done, and ready to have more stuff written to it.
|
|
91
|
+
resolve(ret);
|
|
92
|
+
};
|
|
93
|
+
p.write(val).close();
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
exports.parseXML2JSON = parseXML2JSON;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miqro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"author": "claukers",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@miqro/core": "^1.
|
|
21
|
-
"@miqro/parser": "^0.1.
|
|
20
|
+
"@miqro/core": "^1.6.0",
|
|
21
|
+
"@miqro/parser": "^0.1.5",
|
|
22
22
|
"@miqro/runner": "^1.2.8",
|
|
23
|
-
"@miqro/test": "^0.2.
|
|
23
|
+
"@miqro/test": "^0.2.4",
|
|
24
24
|
"deep-diff": "1.0.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/cookie": "0.4.1",
|
|
28
28
|
"@types/deep-diff": "1.0.1",
|
|
29
29
|
"@types/node": "17.0.23",
|
|
30
|
-
"typescript": "4.
|
|
30
|
+
"typescript": "4.7.4"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=14.0.0",
|