@alloy-js/python 0.3.0-dev.1 → 0.3.0-dev.3
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/src/builtins/python.d.ts +3 -0
- package/dist/src/builtins/python.d.ts.map +1 -1
- package/dist/src/builtins/python.js +6 -0
- package/dist/src/builtins/python.js.map +1 -1
- package/dist/src/components/DataclassDeclaration.d.ts +41 -0
- package/dist/src/components/DataclassDeclaration.d.ts.map +1 -0
- package/dist/src/components/DataclassDeclaration.js +153 -0
- package/dist/src/components/DataclassDeclaration.js.map +1 -0
- package/dist/src/components/PyDoc.d.ts.map +1 -1
- package/dist/src/components/PyDoc.js +59 -15
- package/dist/src/components/PyDoc.js.map +1 -1
- package/dist/src/components/UnionTypeExpression.d.ts.map +1 -1
- package/dist/src/components/UnionTypeExpression.js +6 -6
- package/dist/src/components/UnionTypeExpression.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/test/dataclassdeclarations.test.d.ts +2 -0
- package/dist/test/dataclassdeclarations.test.d.ts.map +1 -0
- package/dist/test/dataclassdeclarations.test.js +696 -0
- package/dist/test/dataclassdeclarations.test.js.map +1 -0
- package/dist/test/pydocs.test.js +11 -19
- package/dist/test/pydocs.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/builtins/python.ts +7 -0
- package/src/components/DataclassDeclaration.tsx +190 -0
- package/src/components/PyDoc.tsx +66 -20
- package/src/components/UnionTypeExpression.tsx +4 -7
- package/src/components/index.ts +1 -0
- package/temp/api.json +267 -0
- package/test/dataclassdeclarations.test.tsx +646 -0
- package/test/pydocs.test.tsx +11 -24
package/test/pydocs.test.tsx
CHANGED
|
@@ -104,11 +104,7 @@ describe("PyDocExample", () => {
|
|
|
104
104
|
<py.PyDoc>
|
|
105
105
|
<Prose>This is an example of a docstring with a code sample.</Prose>
|
|
106
106
|
<py.PyDocExample>
|
|
107
|
-
print("Hello world!")
|
|
108
|
-
<br />
|
|
109
|
-
x = "Hello"
|
|
110
|
-
<br />
|
|
111
|
-
print(x)
|
|
107
|
+
{`print("Hello world!")\nx = "Hello"\nprint(x)`}
|
|
112
108
|
</py.PyDocExample>
|
|
113
109
|
</py.PyDoc>,
|
|
114
110
|
],
|
|
@@ -136,12 +132,14 @@ describe("SimpleCommentBlock", () => {
|
|
|
136
132
|
it("renders simple comment block", () => {
|
|
137
133
|
const res = toSourceText([
|
|
138
134
|
<py.SimpleCommentBlock>
|
|
139
|
-
This is a simple comment block that spans multiple lines
|
|
135
|
+
This is a simple comment block that spans multiple lines and should be
|
|
136
|
+
split automatically.
|
|
140
137
|
</py.SimpleCommentBlock>,
|
|
141
138
|
]);
|
|
142
139
|
expect(res).toRenderTo(
|
|
143
140
|
d`
|
|
144
|
-
# This is a simple comment block that spans multiple lines
|
|
141
|
+
# This is a simple comment block that spans multiple lines and should be split
|
|
142
|
+
# automatically.
|
|
145
143
|
|
|
146
144
|
`,
|
|
147
145
|
);
|
|
@@ -150,14 +148,13 @@ describe("SimpleCommentBlock", () => {
|
|
|
150
148
|
it("renders comment block with line breaks", () => {
|
|
151
149
|
const res = toSourceText([
|
|
152
150
|
<py.SimpleCommentBlock>
|
|
153
|
-
First line of comment.
|
|
154
|
-
<br />
|
|
155
|
-
Second line of comment.
|
|
151
|
+
First line of comment.\nSecond line of comment.
|
|
156
152
|
</py.SimpleCommentBlock>,
|
|
157
153
|
]);
|
|
158
154
|
expect(res).toRenderTo(
|
|
159
155
|
d`
|
|
160
|
-
# First line of comment.
|
|
156
|
+
# First line of comment.
|
|
157
|
+
# Second line of comment.
|
|
161
158
|
|
|
162
159
|
`,
|
|
163
160
|
);
|
|
@@ -877,9 +874,7 @@ describe("New Documentation Components", () => {
|
|
|
877
874
|
Generators have a Yields section instead of a Returns section.
|
|
878
875
|
</Prose>,
|
|
879
876
|
<py.PyDocExample>
|
|
880
|
-
print([i for i in example_generator(4)])
|
|
881
|
-
<br />
|
|
882
|
-
[0, 1, 2, 3]
|
|
877
|
+
{`print([i for i in example_generator(4)])\n[0, 1, 2, 3]`}
|
|
883
878
|
</py.PyDocExample>,
|
|
884
879
|
]}
|
|
885
880
|
parameters={[
|
|
@@ -928,11 +923,7 @@ describe("Full example", () => {
|
|
|
928
923
|
We will also render another paragraph after this one.
|
|
929
924
|
</Prose>,
|
|
930
925
|
<py.PyDocExample>
|
|
931
|
-
print("Hello world!")
|
|
932
|
-
<br />
|
|
933
|
-
x = "Hello"
|
|
934
|
-
<br />
|
|
935
|
-
print(x)
|
|
926
|
+
{`print("Hello world!")\nx = "Hello"\nprint(x)`}
|
|
936
927
|
</py.PyDocExample>,
|
|
937
928
|
]}
|
|
938
929
|
attributes={[
|
|
@@ -1050,11 +1041,7 @@ describe("Full example", () => {
|
|
|
1050
1041
|
We will also render another paragraph after this one.
|
|
1051
1042
|
</Prose>,
|
|
1052
1043
|
<py.PyDocExample>
|
|
1053
|
-
print("Hello world!")
|
|
1054
|
-
<br />
|
|
1055
|
-
x = "Hello"
|
|
1056
|
-
<br />
|
|
1057
|
-
print(x)
|
|
1044
|
+
{`print("Hello world!")\nx = "Hello"\nprint(x)`}
|
|
1058
1045
|
</py.PyDocExample>,
|
|
1059
1046
|
]}
|
|
1060
1047
|
parameters={[
|