@atscript/typescript 0.1.0 → 0.1.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.cjs +9 -3
- package/dist/index.cjs +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -1011,13 +1011,19 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1011
1011
|
this.writeln("// prettier-ignore-end");
|
|
1012
1012
|
super.post();
|
|
1013
1013
|
}
|
|
1014
|
+
renderClassStatics(node) {
|
|
1015
|
+
this.writeln("static __is_atscript_annotated_type = true");
|
|
1016
|
+
this.writeln("static type = {}");
|
|
1017
|
+
this.writeln("static metadata = new Map()");
|
|
1018
|
+
this.renderJsonSchemaMethod(node);
|
|
1019
|
+
}
|
|
1014
1020
|
renderInterface(node) {
|
|
1015
1021
|
this.writeln();
|
|
1016
1022
|
const exported = node.token("export")?.text === "export";
|
|
1017
1023
|
this.write(exported ? "export " : "");
|
|
1018
1024
|
this.write(`class ${node.id} `);
|
|
1019
1025
|
this.blockln("{}");
|
|
1020
|
-
this.
|
|
1026
|
+
this.renderClassStatics(node);
|
|
1021
1027
|
this.popln();
|
|
1022
1028
|
this.postAnnotate.push(node);
|
|
1023
1029
|
this.writeln();
|
|
@@ -1028,7 +1034,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1028
1034
|
this.write(exported ? "export " : "");
|
|
1029
1035
|
this.write(`class ${node.id} `);
|
|
1030
1036
|
this.blockln("{}");
|
|
1031
|
-
this.
|
|
1037
|
+
this.renderClassStatics(node);
|
|
1032
1038
|
this.popln();
|
|
1033
1039
|
this.postAnnotate.push(node);
|
|
1034
1040
|
this.writeln();
|
|
@@ -1046,7 +1052,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1046
1052
|
this.write(exported ? "export " : "");
|
|
1047
1053
|
this.write(`class ${node.id} `);
|
|
1048
1054
|
this.blockln("{}");
|
|
1049
|
-
this.
|
|
1055
|
+
this.renderClassStatics(node);
|
|
1050
1056
|
this.popln();
|
|
1051
1057
|
this.postAnnotate.push(node);
|
|
1052
1058
|
this.writeln();
|
package/dist/index.cjs
CHANGED
|
@@ -1008,13 +1008,19 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1008
1008
|
this.writeln("// prettier-ignore-end");
|
|
1009
1009
|
super.post();
|
|
1010
1010
|
}
|
|
1011
|
+
renderClassStatics(node) {
|
|
1012
|
+
this.writeln("static __is_atscript_annotated_type = true");
|
|
1013
|
+
this.writeln("static type = {}");
|
|
1014
|
+
this.writeln("static metadata = new Map()");
|
|
1015
|
+
this.renderJsonSchemaMethod(node);
|
|
1016
|
+
}
|
|
1011
1017
|
renderInterface(node) {
|
|
1012
1018
|
this.writeln();
|
|
1013
1019
|
const exported = node.token("export")?.text === "export";
|
|
1014
1020
|
this.write(exported ? "export " : "");
|
|
1015
1021
|
this.write(`class ${node.id} `);
|
|
1016
1022
|
this.blockln("{}");
|
|
1017
|
-
this.
|
|
1023
|
+
this.renderClassStatics(node);
|
|
1018
1024
|
this.popln();
|
|
1019
1025
|
this.postAnnotate.push(node);
|
|
1020
1026
|
this.writeln();
|
|
@@ -1025,7 +1031,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1025
1031
|
this.write(exported ? "export " : "");
|
|
1026
1032
|
this.write(`class ${node.id} `);
|
|
1027
1033
|
this.blockln("{}");
|
|
1028
|
-
this.
|
|
1034
|
+
this.renderClassStatics(node);
|
|
1029
1035
|
this.popln();
|
|
1030
1036
|
this.postAnnotate.push(node);
|
|
1031
1037
|
this.writeln();
|
|
@@ -1043,7 +1049,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1043
1049
|
this.write(exported ? "export " : "");
|
|
1044
1050
|
this.write(`class ${node.id} `);
|
|
1045
1051
|
this.blockln("{}");
|
|
1046
|
-
this.
|
|
1052
|
+
this.renderClassStatics(node);
|
|
1047
1053
|
this.popln();
|
|
1048
1054
|
this.postAnnotate.push(node);
|
|
1049
1055
|
this.writeln();
|
package/dist/index.mjs
CHANGED
|
@@ -984,13 +984,19 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
984
984
|
this.writeln("// prettier-ignore-end");
|
|
985
985
|
super.post();
|
|
986
986
|
}
|
|
987
|
+
renderClassStatics(node) {
|
|
988
|
+
this.writeln("static __is_atscript_annotated_type = true");
|
|
989
|
+
this.writeln("static type = {}");
|
|
990
|
+
this.writeln("static metadata = new Map()");
|
|
991
|
+
this.renderJsonSchemaMethod(node);
|
|
992
|
+
}
|
|
987
993
|
renderInterface(node) {
|
|
988
994
|
this.writeln();
|
|
989
995
|
const exported = node.token("export")?.text === "export";
|
|
990
996
|
this.write(exported ? "export " : "");
|
|
991
997
|
this.write(`class ${node.id} `);
|
|
992
998
|
this.blockln("{}");
|
|
993
|
-
this.
|
|
999
|
+
this.renderClassStatics(node);
|
|
994
1000
|
this.popln();
|
|
995
1001
|
this.postAnnotate.push(node);
|
|
996
1002
|
this.writeln();
|
|
@@ -1001,7 +1007,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1001
1007
|
this.write(exported ? "export " : "");
|
|
1002
1008
|
this.write(`class ${node.id} `);
|
|
1003
1009
|
this.blockln("{}");
|
|
1004
|
-
this.
|
|
1010
|
+
this.renderClassStatics(node);
|
|
1005
1011
|
this.popln();
|
|
1006
1012
|
this.postAnnotate.push(node);
|
|
1007
1013
|
this.writeln();
|
|
@@ -1019,7 +1025,7 @@ var JsRenderer = class extends BaseRenderer {
|
|
|
1019
1025
|
this.write(exported ? "export " : "");
|
|
1020
1026
|
this.write(`class ${node.id} `);
|
|
1021
1027
|
this.blockln("{}");
|
|
1022
|
-
this.
|
|
1028
|
+
this.renderClassStatics(node);
|
|
1023
1029
|
this.popln();
|
|
1024
1030
|
this.postAnnotate.push(node);
|
|
1025
1031
|
this.writeln();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Atscript: typescript-gen support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"homepage": "https://github.com/moostjs/atscript/tree/main/packages/typescript#readme",
|
|
71
71
|
"license": "ISC",
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atscript/core": "^0.1.
|
|
73
|
+
"@atscript/core": "^0.1.1"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@moostjs/event-cli": "^0.5.32",
|