miqro 6.2.13 → 7.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/README.md +9 -17
- package/build/editor.bundle.js +11601 -10129
- package/build/esm/src/bin/types.js +10 -5
- package/build/esm/src/cluster.js +1 -1
- package/build/esm/src/common/arguments.d.ts +2 -1
- package/build/esm/src/common/arguments.js +42 -18
- package/build/esm/src/common/assets.d.ts +1 -1
- package/build/esm/src/common/assets.js +34 -13
- package/build/esm/src/common/esbuild.d.ts +4 -1
- package/build/esm/src/common/esbuild.js +31 -26
- package/build/esm/src/common/exit.js +4 -4
- package/build/esm/src/common/help.d.ts +1 -1
- package/build/esm/src/common/help.js +2 -2
- package/build/esm/src/common/jsx.d.ts +2 -3
- package/build/esm/src/common/jsx.js +70 -75
- package/build/esm/src/common/paths.d.ts +0 -1
- package/build/esm/src/common/paths.js +3 -3
- package/build/esm/src/common/watch.d.ts +0 -1
- package/build/esm/src/common/watch.js +4 -1
- package/build/esm/src/inflate/inflate-sea.js +35 -24
- package/build/esm/src/inflate/inflate.js +4 -4
- package/build/esm/src/inflate/setup-auth.js +1 -1
- package/build/esm/src/inflate/setup-cors.js +1 -1
- package/build/esm/src/inflate/setup-db.js +2 -2
- package/build/esm/src/inflate/setup-error.js +1 -1
- package/build/esm/src/inflate/setup-http.js +16 -16
- package/build/esm/src/inflate/setup-log.js +1 -1
- package/build/esm/src/inflate/setup-middleware.js +1 -1
- package/build/esm/src/inflate/setup-server-config.js +1 -1
- package/build/esm/src/inflate/setup-ws.js +1 -1
- package/build/esm/src/inflate/setup.doc.d.ts +2 -2
- package/build/esm/src/inflate/setup.doc.js +23 -2
- package/build/esm/src/inflate/utils/sea-utils.js +2 -2
- package/build/esm/src/lib.d.ts +10 -1
- package/build/esm/src/lib.js +16 -1
- package/build/esm/src/main.js +2 -1
- package/build/esm/src/services/app.d.ts +1 -0
- package/build/esm/src/services/app.js +4 -5
- package/build/esm/src/services/migrations.js +2 -2
- package/build/esm/src/services/utils/jwt.d.ts +2 -0
- package/build/esm/src/services/utils/jwt.js +23 -0
- package/build/esm/src/services/utils/middleware.d.ts +9 -0
- package/build/esm/src/services/utils/middleware.js +9 -0
- package/build/esm/src/services/utils/server-interface.js +33 -4
- package/build/esm/src/types.d.ts +50 -83
- package/build/lib.cjs +15694 -15619
- package/package.json +6 -8
- package/sea/basic-compile.base64.sh +1 -1
- package/sea/basic-compile.sh +1 -1
- package/sea/install-nodejs.sh +1 -1
- package/sea/node.version.tag +1 -1
- package/.eslintrc +0 -15
- package/build/esm/editor/auth.d.ts +0 -6
- package/build/esm/editor/auth.js +0 -41
- package/build/esm/editor/common/admin-interface.d.ts +0 -36
- package/build/esm/editor/common/admin-interface.js +0 -44
- package/build/esm/editor/common/constants.d.ts +0 -4
- package/build/esm/editor/common/constants.js +0 -20
- package/build/esm/editor/common/constants.server.d.ts +0 -2
- package/build/esm/editor/common/constants.server.js +0 -4
- package/build/esm/editor/common/editor-index.d.ts +0 -2
- package/build/esm/editor/common/editor-index.js +0 -14
- package/build/esm/editor/common/html-encode.d.ts +0 -1
- package/build/esm/editor/common/html-encode.js +0 -14
- package/build/esm/editor/common/log-socket.d.ts +0 -15
- package/build/esm/editor/common/log-socket.js +0 -70
- package/build/esm/editor/common/templates.d.ts +0 -11
- package/build/esm/editor/common/templates.js +0 -477
- package/build/esm/editor/components/api-preview.d.ts +0 -11
- package/build/esm/editor/components/api-preview.js +0 -90
- package/build/esm/editor/components/editor.d.ts +0 -16
- package/build/esm/editor/components/editor.js +0 -365
- package/build/esm/editor/components/file-browser.d.ts +0 -37
- package/build/esm/editor/components/file-browser.js +0 -126
- package/build/esm/editor/components/file-editor-toolbar.d.ts +0 -22
- package/build/esm/editor/components/file-editor-toolbar.js +0 -93
- package/build/esm/editor/components/file-editor.d.ts +0 -32
- package/build/esm/editor/components/file-editor.js +0 -59
- package/build/esm/editor/components/filter-query.d.ts +0 -1
- package/build/esm/editor/components/filter-query.js +0 -22
- package/build/esm/editor/components/highlight-text-area.d.ts +0 -11
- package/build/esm/editor/components/highlight-text-area.js +0 -125
- package/build/esm/editor/components/log-viewer.d.ts +0 -6
- package/build/esm/editor/components/log-viewer.js +0 -69
- package/build/esm/editor/components/new-file.d.ts +0 -10
- package/build/esm/editor/components/new-file.js +0 -117
- package/build/esm/editor/components/scroll-query.d.ts +0 -7
- package/build/esm/editor/components/scroll-query.js +0 -21
- package/build/esm/editor/components/start-page.d.ts +0 -13
- package/build/esm/editor/components/start-page.js +0 -30
- package/build/esm/editor/http/admin/editor/api/fs/delete.api.d.ts +0 -3
- package/build/esm/editor/http/admin/editor/api/fs/delete.api.js +0 -29
- package/build/esm/editor/http/admin/editor/api/fs/read.api.d.ts +0 -5
- package/build/esm/editor/http/admin/editor/api/fs/read.api.js +0 -49
- package/build/esm/editor/http/admin/editor/api/fs/rename.api.d.ts +0 -4
- package/build/esm/editor/http/admin/editor/api/fs/rename.api.js +0 -39
- package/build/esm/editor/http/admin/editor/api/fs/scan.api.d.ts +0 -26
- package/build/esm/editor/http/admin/editor/api/fs/scan.api.js +0 -149
- package/build/esm/editor/http/admin/editor/api/fs/write.api.d.ts +0 -3
- package/build/esm/editor/http/admin/editor/api/fs/write.api.js +0 -38
- package/build/esm/editor/http/admin/editor/api/server/reload.api.d.ts +0 -10
- package/build/esm/editor/http/admin/editor/api/server/reload.api.js +0 -46
- package/build/esm/editor/http/admin/editor/api/server/restart.api.d.ts +0 -10
- package/build/esm/editor/http/admin/editor/api/server/restart.api.js +0 -45
- package/build/esm/editor/http/admin/editor/editor.d.ts +0 -1
- package/build/esm/editor/http/admin/editor/editor.js +0 -7
- package/build/esm/editor/http/admin/editor/index.api.d.ts +0 -3
- package/build/esm/editor/http/admin/editor/index.api.js +0 -21
- package/build/esm/editor/server.d.ts +0 -3
- package/build/esm/editor/server.js +0 -49
- package/build/esm/editor/ws.d.ts +0 -3
- package/build/esm/editor/ws.js +0 -11
- package/build/esm/src/services/globals.d.ts +0 -3
- package/build/esm/src/services/globals.js +0 -182
- package/build/jsx.dom.js +0 -1587
- package/build/postject.base64.cjs +0 -1
- package/editor/auth.ts +0 -51
- package/editor/common/admin-interface.ts +0 -84
- package/editor/common/constants.server.ts +0 -5
- package/editor/common/constants.ts +0 -21
- package/editor/common/editor-index.tsx +0 -17
- package/editor/common/html-encode.ts +0 -14
- package/editor/common/log-socket.tsx +0 -85
- package/editor/common/templates.ts +0 -481
- package/editor/components/api-preview.tsx +0 -116
- package/editor/components/editor.tsx +0 -494
- package/editor/components/file-browser.tsx +0 -308
- package/editor/components/file-editor-toolbar.tsx +0 -191
- package/editor/components/file-editor.tsx +0 -122
- package/editor/components/filter-query.tsx +0 -22
- package/editor/components/highlight-text-area.tsx +0 -145
- package/editor/components/log-viewer.tsx +0 -110
- package/editor/components/new-file.tsx +0 -169
- package/editor/components/scroll-query.tsx +0 -22
- package/editor/components/start-page.tsx +0 -49
- package/editor/http/admin/editor/api/fs/delete.api.tsx +0 -32
- package/editor/http/admin/editor/api/fs/read.api.tsx +0 -55
- package/editor/http/admin/editor/api/fs/rename.api.tsx +0 -41
- package/editor/http/admin/editor/api/fs/scan.api.tsx +0 -181
- package/editor/http/admin/editor/api/fs/write.api.tsx +0 -41
- package/editor/http/admin/editor/api/server/reload.api.ts +0 -53
- package/editor/http/admin/editor/api/server/restart.api.tsx +0 -52
- package/editor/http/admin/editor/editor.tsx +0 -8
- package/editor/http/admin/editor/index.api.tsx +0 -39
- package/editor/server.ts +0 -57
- package/editor/ws.ts +0 -15
- package/sea/types.json +0 -1
- package/src/bin/compile.ts +0 -35
- package/src/bin/doc-md.ts +0 -210
- package/src/bin/generate-doc.ts +0 -64
- package/src/bin/test.ts +0 -92
- package/src/bin/types.ts +0 -29
- package/src/cluster.ts +0 -27
- package/src/common/arguments.ts +0 -733
- package/src/common/assets.ts +0 -128
- package/src/common/checksum.ts +0 -58
- package/src/common/constants.ts +0 -18
- package/src/common/content-type.ts +0 -84
- package/src/common/esbuild.ts +0 -94
- package/src/common/exit.ts +0 -91
- package/src/common/fs.ts +0 -82
- package/src/common/help.ts +0 -60
- package/src/common/jsx.ts +0 -547
- package/src/common/jwt.ts +0 -85
- package/src/common/paths.ts +0 -107
- package/src/common/watch.ts +0 -85
- package/src/inflate/inflate-sea.ts +0 -226
- package/src/inflate/inflate.ts +0 -101
- package/src/inflate/md.ts +0 -25
- package/src/inflate/setup-auth.ts +0 -41
- package/src/inflate/setup-cors.ts +0 -41
- package/src/inflate/setup-db.ts +0 -117
- package/src/inflate/setup-error.ts +0 -44
- package/src/inflate/setup-http.ts +0 -704
- package/src/inflate/setup-log.ts +0 -45
- package/src/inflate/setup-middleware.ts +0 -47
- package/src/inflate/setup-server-config.ts +0 -48
- package/src/inflate/setup-test.ts +0 -23
- package/src/inflate/setup-ws.ts +0 -50
- package/src/inflate/setup.doc.ts +0 -68
- package/src/inflate/utils/sea-utils.ts +0 -14
- package/src/lib.ts +0 -19
- package/src/main.ts +0 -100
- package/src/services/app.ts +0 -698
- package/src/services/editor.tsx +0 -101
- package/src/services/globals.ts +0 -186
- package/src/services/hot-reload.ts +0 -51
- package/src/services/migrations.ts +0 -68
- package/src/services/utils/admin-interface.ts +0 -37
- package/src/services/utils/cache.ts +0 -88
- package/src/services/utils/cluster-cache.ts +0 -230
- package/src/services/utils/cluster-ws.ts +0 -202
- package/src/services/utils/db-manager.ts +0 -92
- package/src/services/utils/get-route.ts +0 -70
- package/src/services/utils/log-transport.ts +0 -81
- package/src/services/utils/log.ts +0 -92
- package/src/services/utils/server-interface.ts +0 -92
- package/src/services/utils/websocketmanager.ts +0 -157
- package/src/types/@esbuild.d.ts +0 -1
- package/src/types/@miqro/core.d.ts +0 -2
- package/src/types/@miqro/jsx.d.ts +0 -2
- package/src/types/@miqro/parser.d.ts +0 -2
- package/src/types/@miqro/query.d.ts +0 -2
- package/src/types/@miqro/request.d.ts +0 -2
- package/src/types/@miqro/test.d.ts +0 -2
- package/src/types/@miqro.d.ts +0 -1
- package/src/types/@types.d.ts +0 -1
- package/src/types/browser.globals.d.ts +0 -1
- package/src/types/cookie.d.ts +0 -2
- package/src/types/globals.d.ts +0 -2
- package/src/types/jose.d.ts +0 -2
- package/src/types/jsx.globals.d.ts +0 -38
- package/src/types/miqro.d.ts +0 -228
- package/src/types/postject.d.ts +0 -1
- package/src/types/server.globals.d.ts +0 -47
- package/src/types.ts +0 -304
- package/tsconfig.json +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miqro",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/esm/src/lib.js",
|
|
@@ -16,15 +16,13 @@
|
|
|
16
16
|
"prerelease:package": "npm run compile",
|
|
17
17
|
"prebuild": "rm -Rf build/;",
|
|
18
18
|
"build": "tsc",
|
|
19
|
-
"postbuild": "npm run postbuild:lib && npm run postbuild:
|
|
19
|
+
"postbuild": "npm run postbuild:lib && npm run postbuild:sh && npm run postbuild:assets && npm run postbuild:editor && npm run postbuild:editor-assets && npm run postbuild:versiontag",
|
|
20
20
|
"postbuild:versiontag": "node sea/version.tag.js",
|
|
21
|
-
"postbuild:types": "sh sea/copy-types.sh && node sea/generate-global-types-asset-json.js",
|
|
22
21
|
"postbuild:editor-assets": "cp sea/editor-assets/font.ttf build/font.ttf && cp sea/editor-assets/style.css build/style.css",
|
|
23
|
-
"postbuild:editor": "esbuild --
|
|
24
|
-
"postbuild:
|
|
22
|
+
"postbuild:editor": "esbuild --external:node:process --external:node:path --bundle --loader:.js=jsx --jsx-factory=jsx.createElement --jsx-fragment=jsx.Fragment sea/editor-assets/editor.bundle.in.mjs --outfile=build/editor.bundle.js",
|
|
23
|
+
"postbuild:assets": "node sea/assets.js",
|
|
25
24
|
"postbuild:sh": "node sea/base64.js sea/basic-compile.sh > sea/basic-compile.base64.sh",
|
|
26
|
-
"postbuild:
|
|
27
|
-
"postbuild:lib": "esbuild src/lib.ts --log-level=silent --bundle --platform=node --outfile=build/lib.cjs --external:sqlite3 --external:pg --external:esbuild --external:node:assert --external:node:util --external:node:path",
|
|
25
|
+
"postbuild:lib": "esbuild src/lib.ts --bundle --platform=node --outfile=build/lib.cjs --external:sqlite3 --external:pg --external:esbuild --external:node:assert --external:node:util --external:node:path",
|
|
28
26
|
"compile": "npm run build && sh sea/compile.sh",
|
|
29
27
|
"start:editor": "node --enable-source-maps --disable-warning=ExperimentalWarning build/esm/src/main.js --service editor/",
|
|
30
28
|
"compile:editor": "node --enable-source-maps --disable-warning=ExperimentalWarning build/esm/src/main.js --compile --service editor/",
|
|
@@ -39,10 +37,10 @@
|
|
|
39
37
|
"@types/node": "^22.10.2",
|
|
40
38
|
"@types/showdown": "2.0.6",
|
|
41
39
|
"highlight.js": "11.11.1",
|
|
42
|
-
"postject": "1.0.0-alpha.6",
|
|
43
40
|
"typescript": "^5.7.2"
|
|
44
41
|
},
|
|
45
42
|
"dependencies": {
|
|
43
|
+
"postject": "1.0.0-alpha.6",
|
|
46
44
|
"@miqro/core": "^5.0.15",
|
|
47
45
|
"@miqro/jsx": "^1.0.1",
|
|
48
46
|
"@miqro/jsx-dom": "^1.0.4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
IyEvdXNyL2Jpbi9lbnYgc2gKCnJtIC1SZiBiaW47Cm1rZGlyIC1wIGJpbi87CgpzaCAuL2luc3RhbGwtbm9kZWpzLnNoCgpOT0RFX0JJTj0ic2ggc2VhL25vZGUuc2giClNJR05fUkVNT1ZFX0JJTj0ic2ggc2VhL3NpZ24tcmVtb3ZlLnNoIgpTSUdOX0FERF9CSU49InNoIHNlYS9zaWduLWFkZC5zaCIKUE9TVEpFQ1RfQklOPSIke05PREVfQklOfSAuLi9ub2RlX21vZHVsZXMvcG9zdGplY3QvZGlzdC9jbGkuanMiCkVTQlVJTERfQklOPSJzZWEvZXNidWlsZCIKCiMkRVNCVUl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D_BIN="sh sea/sign-add.sh"
|
|
11
|
-
POSTJECT_BIN="${NODE_BIN}
|
|
11
|
+
POSTJECT_BIN="${NODE_BIN} ../node_modules/postject/dist/cli.js"
|
|
12
12
|
ESBUILD_BIN="sea/esbuild"
|
|
13
13
|
|
|
14
14
|
#$ESBUILD_BIN sea/app.cjs --bundle --platform=node --external:sqlite3 --external:pg --external:esbuild --outfile=sea/app.bundle.cjs
|
package/sea/install-nodejs.sh
CHANGED
package/sea/node.version.tag
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
24.
|
|
1
|
+
24.3.0
|
package/.eslintrc
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"extends": [
|
|
4
|
-
"plugin:@typescript-eslint/recommended"
|
|
5
|
-
],
|
|
6
|
-
"parserOptions": {
|
|
7
|
-
"ecmaVersion": 2018,
|
|
8
|
-
"sourceType": "module"
|
|
9
|
-
},
|
|
10
|
-
"rules": {
|
|
11
|
-
// Aca puedes modificar alguna regla específica, por ejemplo:
|
|
12
|
-
// "@typescript-eslint/explicit-function-return-type": "off",
|
|
13
|
-
"@typescript-eslint/no-explicit-any": "off"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthConfig } from "../src/types.js";
|
|
2
|
-
export declare const ADMIN_EDITOR_AUTH_KEY = "$$ADMIN_EDITOR_AUTH_KEY$$";
|
|
3
|
-
export declare const ADMIN_EDITOR_AUTH_QUERY = "key";
|
|
4
|
-
export declare const ADMIN_EDITOR_AUTH_COOKIE = "$$ADMIN_EDITOR_AUTH_KEY$$";
|
|
5
|
-
declare const _default: AuthConfig;
|
|
6
|
-
export default _default;
|
package/build/esm/editor/auth.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export const ADMIN_EDITOR_AUTH_KEY = "$$ADMIN_EDITOR_AUTH_KEY$$";
|
|
2
|
-
export const ADMIN_EDITOR_AUTH_QUERY = "key";
|
|
3
|
-
export const ADMIN_EDITOR_AUTH_COOKIE = ADMIN_EDITOR_AUTH_KEY;
|
|
4
|
-
export default {
|
|
5
|
-
authService: {
|
|
6
|
-
verify: async (args) => {
|
|
7
|
-
const adminInterface = args.req.editor;
|
|
8
|
-
const serverInterface = args.req.server;
|
|
9
|
-
const KEY = (adminInterface ? adminInterface.getCache() : serverInterface.cache).get(ADMIN_EDITOR_AUTH_KEY);
|
|
10
|
-
const validSesson = {
|
|
11
|
-
username: "username",
|
|
12
|
-
account: "account",
|
|
13
|
-
groups: [],
|
|
14
|
-
token: args.token
|
|
15
|
-
};
|
|
16
|
-
const queryToken = args.req.query[ADMIN_EDITOR_AUTH_QUERY];
|
|
17
|
-
const cookieToken = args.req.cookies[ADMIN_EDITOR_AUTH_COOKIE];
|
|
18
|
-
//console.log("\n\nqueryToken[%s] cookieToken[%s] KEY[%s]\n\n", queryToken, cookieToken, KEY);
|
|
19
|
-
if (queryToken) {
|
|
20
|
-
if (queryToken === KEY) {
|
|
21
|
-
args.res.setCookie(ADMIN_EDITOR_AUTH_COOKIE, KEY, {
|
|
22
|
-
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 31 * 12 * 500),
|
|
23
|
-
httpOnly: true,
|
|
24
|
-
//secure: true,
|
|
25
|
-
path: "/",
|
|
26
|
-
//sameSite: "strict"
|
|
27
|
-
});
|
|
28
|
-
args.req.searchParams.delete(ADMIN_EDITOR_AUTH_QUERY);
|
|
29
|
-
const queryString = args.req.searchParams.toString();
|
|
30
|
-
const redirect = args.req.path + (queryString ? "?" + queryString : "");
|
|
31
|
-
await args.res.redirect(redirect);
|
|
32
|
-
return validSesson;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else if (cookieToken) {
|
|
36
|
-
return cookieToken === KEY ? validSesson : null;
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { RouterHandlerOptions } from "@miqro/core";
|
|
2
|
-
import { CacheInterface, ServerRequest } from "../../src/types.js";
|
|
3
|
-
import { MigrationModule } from "../../src/inflate/setup-db.js";
|
|
4
|
-
export interface EditorAdminInterface {
|
|
5
|
-
getCache: () => CacheInterface;
|
|
6
|
-
getMigrations(): MigrationModule[];
|
|
7
|
-
stop: () => Promise<void>;
|
|
8
|
-
reload: () => Promise<null | {
|
|
9
|
-
filePath: string;
|
|
10
|
-
error: Error;
|
|
11
|
-
}[]>;
|
|
12
|
-
restart: () => Promise<null | {
|
|
13
|
-
filePath: string;
|
|
14
|
-
error: Error;
|
|
15
|
-
}[]>;
|
|
16
|
-
getHotReloadHTML(): string;
|
|
17
|
-
getInflateErrors(): null | {
|
|
18
|
-
filePath: string;
|
|
19
|
-
error: Error;
|
|
20
|
-
}[];
|
|
21
|
-
getServices(): string[];
|
|
22
|
-
getRouteFileMap(): {
|
|
23
|
-
[filePath: string]: {
|
|
24
|
-
routes: {
|
|
25
|
-
path?: string;
|
|
26
|
-
method?: string | null;
|
|
27
|
-
options?: RouterHandlerOptions;
|
|
28
|
-
inflatePath?: string;
|
|
29
|
-
}[];
|
|
30
|
-
previewMethod: "api" | "html" | null;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface AdminRequest extends ServerRequest {
|
|
35
|
-
editor?: EditorAdminInterface;
|
|
36
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/*let currentAdminInterface: EditorAdminInterface | null = null;
|
|
3
|
-
function createFakeAdminInterface(server: any): EditorAdminInterface {
|
|
4
|
-
return {
|
|
5
|
-
getCache: () => {
|
|
6
|
-
return server.cache;
|
|
7
|
-
},
|
|
8
|
-
stop: async () => {
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
restart: async () => {
|
|
12
|
-
return null;
|
|
13
|
-
},
|
|
14
|
-
reload: async () => {
|
|
15
|
-
return null;
|
|
16
|
-
},
|
|
17
|
-
getHotReloadHTML: () => {
|
|
18
|
-
return "";
|
|
19
|
-
},
|
|
20
|
-
getMigrations: () => {
|
|
21
|
-
return [];
|
|
22
|
-
},
|
|
23
|
-
getServices: () => {
|
|
24
|
-
return ["."];
|
|
25
|
-
},
|
|
26
|
-
getRouteFileMap: () => {
|
|
27
|
-
return {};
|
|
28
|
-
},
|
|
29
|
-
getInflateErrors: () => {
|
|
30
|
-
return [];
|
|
31
|
-
},
|
|
32
|
-
inflateJSX: async function inflateJSX(path, minify: boolean = true) {
|
|
33
|
-
return "";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function getEditorAdmin(server): EditorAdminInterface {
|
|
39
|
-
return currentAdminInterface ? currentAdminInterface : createFakeAdminInterface(server);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function setEditorAdmin(admin: EditorAdminInterface): void {
|
|
43
|
-
currentAdminInterface = admin;
|
|
44
|
-
}*/
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const BASEEDITOR_PATH = "/admin/editor";
|
|
2
|
-
export const LOG_SOCKET_PATH = "/admin/socket";
|
|
3
|
-
export const LOG_WRITE_EVENT = "LogWrite";
|
|
4
|
-
export const SUPPORTED_LANGUAGES = [
|
|
5
|
-
"text",
|
|
6
|
-
"json",
|
|
7
|
-
"javascript",
|
|
8
|
-
"typescript",
|
|
9
|
-
"dockerfile",
|
|
10
|
-
"yaml",
|
|
11
|
-
"xml",
|
|
12
|
-
"html",
|
|
13
|
-
"css",
|
|
14
|
-
"scss",
|
|
15
|
-
"markdown",
|
|
16
|
-
"c",
|
|
17
|
-
"cpp",
|
|
18
|
-
"bash",
|
|
19
|
-
"python"
|
|
20
|
-
];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { scanDir } from "../http/admin/editor/api/fs/scan.api.js";
|
|
2
|
-
import { parseInflateErrors } from "../http/admin/editor/api/server/restart.api.js";
|
|
3
|
-
import { HTMLEncode } from "./html-encode.js";
|
|
4
|
-
export function EditorIndex(editorCSS, editorJS, enableHotReload) {
|
|
5
|
-
return async function editorIndex(req, res) {
|
|
6
|
-
const admin = req.editor;
|
|
7
|
-
const errors = parseInflateErrors(admin ? admin.getInflateErrors() : []);
|
|
8
|
-
const files = scanDir(req);
|
|
9
|
-
const migrations = admin ? admin.getMigrations().map(m => m.name) : [];
|
|
10
|
-
const services = admin ? admin.getServices() : ["."];
|
|
11
|
-
const hotReload = enableHotReload ? (admin ? admin.getHotReloadHTML() : "") : "";
|
|
12
|
-
res.html(`<!DOCTYPE html><html><body><style>${editorCSS}</style><script type="module">${editorJS}</script><editor-component class="main-container" reloadstring="${req.uuid}" migrations="${HTMLEncode(JSON.stringify(migrations))}" services="${HTMLEncode(JSON.stringify(services))}" errors="${HTMLEncode(JSON.stringify(errors))}" files="${HTMLEncode(JSON.stringify(files))}"><noscript>Enable JavaScript</noscript></editor-component>${hotReload}</body></html>`);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function HTMLEncode(str: string): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function HTMLEncode(str) {
|
|
2
|
-
let i = str.length;
|
|
3
|
-
const aRet = [];
|
|
4
|
-
while (i--) {
|
|
5
|
-
const iC = str[i].charCodeAt(0);
|
|
6
|
-
if (iC < 65 || iC > 127 || (iC > 90 && iC < 97)) {
|
|
7
|
-
aRet[i] = '&#' + iC + ';';
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
aRet[i] = str[i];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return aRet.join('');
|
|
14
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface LogLine {
|
|
2
|
-
out: string;
|
|
3
|
-
identifier: string;
|
|
4
|
-
level: "error" | "warn" | "debug" | "trace" | "info";
|
|
5
|
-
}
|
|
6
|
-
export interface LogSocket {
|
|
7
|
-
lines: LogLine[];
|
|
8
|
-
clearLog: () => void;
|
|
9
|
-
getMaxlogsize: () => number | "unlimited";
|
|
10
|
-
setMaxLogSize: (val: number | "unlimited") => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function useLogSocket(options: {
|
|
13
|
-
disableLog?: boolean;
|
|
14
|
-
}): LogSocket;
|
|
15
|
-
export {};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export function useLogSocket(options) {
|
|
2
|
-
const [_, setmaxLogSize, getMaxlogsize] = jsx.useState(1000000);
|
|
3
|
-
const [__, setlines, getLines] = jsx.useState([]);
|
|
4
|
-
const refresh = jsx.useRefresh();
|
|
5
|
-
jsx.useEffect(() => {
|
|
6
|
-
let timeout;
|
|
7
|
-
function setupSocket() {
|
|
8
|
-
try {
|
|
9
|
-
if (options.disableLog) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
console.log("setting up log socket");
|
|
13
|
-
const socket = new WebSocket("/admin/socket");
|
|
14
|
-
socket.addEventListener("error", (err) => {
|
|
15
|
-
console.error(err);
|
|
16
|
-
clearTimeout(timeout);
|
|
17
|
-
timeout = setTimeout(() => {
|
|
18
|
-
setupSocket();
|
|
19
|
-
}, 1000);
|
|
20
|
-
});
|
|
21
|
-
socket.addEventListener("open", () => {
|
|
22
|
-
console.log("log socket open");
|
|
23
|
-
clearTimeout(timeout);
|
|
24
|
-
socket.addEventListener("message", (msg) => {
|
|
25
|
-
const lines = getLines();
|
|
26
|
-
const data = JSON.parse(msg.data);
|
|
27
|
-
//console.log(data.out);
|
|
28
|
-
const maxLogSize = getMaxlogsize();
|
|
29
|
-
if (maxLogSize !== "unlimited" && lines.length >= maxLogSize) {
|
|
30
|
-
lines.splice(0, (lines.length - maxLogSize) + 1);
|
|
31
|
-
}
|
|
32
|
-
lines.push(data);
|
|
33
|
-
setlines(lines);
|
|
34
|
-
refresh();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
socket.addEventListener("close", () => {
|
|
38
|
-
console.log("log socket close");
|
|
39
|
-
clearTimeout(timeout);
|
|
40
|
-
timeout = setTimeout(() => {
|
|
41
|
-
setupSocket();
|
|
42
|
-
}, 1000);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
console.error(e);
|
|
47
|
-
clearTimeout(timeout);
|
|
48
|
-
timeout = setTimeout(() => {
|
|
49
|
-
setupSocket();
|
|
50
|
-
}, 1000);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
setupSocket();
|
|
54
|
-
}, []);
|
|
55
|
-
return {
|
|
56
|
-
lines: getLines(),
|
|
57
|
-
clearLog: () => {
|
|
58
|
-
setlines([]);
|
|
59
|
-
},
|
|
60
|
-
getMaxlogsize,
|
|
61
|
-
setMaxLogSize: (newValue) => {
|
|
62
|
-
if (newValue === "unlimited") {
|
|
63
|
-
setmaxLogSize(newValue);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
setmaxLogSize(newValue);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|