@tuya-sat/micro-dev-loader 1.0.0-rc.3 → 1.0.0-rc.4
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/index.d.ts +4 -0
- package/dist/manifestDom.d.ts +2 -0
- package/dist/plugins/layoutMock/index.d.ts +4 -0
- package/dist/transform.d.ts +27 -0
- package/dist/utils/getFakeMenu.d.ts +10 -0
- package/dist/utils/getLang.d.ts +1 -0
- package/dist/utils/parseManifest.d.ts +21 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ParseResult } from "@babel/core";
|
|
2
|
+
import { Manifest } from "./utils/parseManifest";
|
|
3
|
+
export declare type MICRO_FRAMEWORKS_TYPE = "REACT_TS" | "REACT_JS" | "VUE_TS" | "VUE_JS";
|
|
4
|
+
interface ChangeAstProps {
|
|
5
|
+
authedCode: string[];
|
|
6
|
+
manifest: Manifest;
|
|
7
|
+
}
|
|
8
|
+
interface CodeMakerProps {
|
|
9
|
+
sourceCode: string;
|
|
10
|
+
microFramework: MICRO_FRAMEWORKS_TYPE;
|
|
11
|
+
}
|
|
12
|
+
export default class CodeMaker {
|
|
13
|
+
private ast;
|
|
14
|
+
private microFramework;
|
|
15
|
+
constructor({ sourceCode, microFramework }: CodeMakerProps);
|
|
16
|
+
parse(code: string): ParseResult;
|
|
17
|
+
changeAst(props: ChangeAstProps): void;
|
|
18
|
+
gtAst(): string;
|
|
19
|
+
vueReRenderTemp(): string;
|
|
20
|
+
reactReRenderTemp(): string;
|
|
21
|
+
getMenuCode(manifest: Manifest): string;
|
|
22
|
+
getAuthTemp(props: {
|
|
23
|
+
privileges: Manifest["privileges"];
|
|
24
|
+
authedCode: ChangeAstProps["authedCode"];
|
|
25
|
+
}): string;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Manifest } from "./parseManifest";
|
|
2
|
+
interface FakeMenu {
|
|
3
|
+
micro_app_name: string[];
|
|
4
|
+
entry_name: string[];
|
|
5
|
+
path: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
sub_entry_list: FakeMenu[];
|
|
8
|
+
}
|
|
9
|
+
export declare function getFakeMenu(manifest: Manifest): FakeMenu;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nameProcesser2: (name: any) => any[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Privilege {
|
|
2
|
+
name: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Manifest {
|
|
6
|
+
name: string;
|
|
7
|
+
defaultMenuIcon?: {
|
|
8
|
+
type: "URL";
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
entries: {
|
|
12
|
+
type: string;
|
|
13
|
+
code: string;
|
|
14
|
+
appIcon?: Object;
|
|
15
|
+
name: string;
|
|
16
|
+
path: string;
|
|
17
|
+
ratio?: number;
|
|
18
|
+
}[];
|
|
19
|
+
privileges: Privilege[];
|
|
20
|
+
}
|
|
21
|
+
export default function parseManifest(): Manifest;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-dev-loader",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "rm -rf dist/ && swc src -D -w -d dist",
|
|
8
|
-
"build": "rm -rf dist/ && swc src -D -d dist",
|
|
7
|
+
"dev": "rm -rf dist/ && tsc --emitDeclarationOnly && swc src -D -w -d dist",
|
|
8
|
+
"build": "rm -rf dist/ && tsc --emitDeclarationOnly && swc src -D -d dist",
|
|
9
9
|
"prepublish": "yarn build",
|
|
10
10
|
"test": "jest --verbose ./__tests__"
|
|
11
11
|
},
|