ripple 0.3.39 → 0.3.40
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# ripple
|
|
2
2
|
|
|
3
|
+
## 0.3.40
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
[[`31193f2`](https://github.com/Ripple-TS/ripple/commit/31193f23aa6b6b5b79cd858f57e8aca69cd44b6d)]:
|
|
9
|
+
- @tsrx/ripple@0.0.22
|
|
10
|
+
- ripple@0.3.40
|
|
11
|
+
|
|
3
12
|
## 0.3.39
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ripple is an elegant TypeScript UI framework",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.40",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/runtime/index-client.js",
|
|
9
9
|
"main": "src/runtime/index-client.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"esm-env": "^1.2.2",
|
|
77
77
|
"@types/estree": "^1.0.8",
|
|
78
78
|
"@types/estree-jsx": "^1.0.5",
|
|
79
|
-
"@tsrx/ripple": "0.0.
|
|
79
|
+
"@tsrx/ripple": "0.0.22"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/node": "^24.3.0",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"typescript": "^5.9.3",
|
|
85
85
|
"@volar/language-core": "~2.4.28",
|
|
86
86
|
"vscode-languageserver-types": "^3.17.5",
|
|
87
|
-
"@tsrx/core": "0.0.
|
|
87
|
+
"@tsrx/core": "0.0.20"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"ripple": "0.3.
|
|
90
|
+
"ripple": "0.3.40"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parse, compile, compile_to_volar_mappings } from '@tsrx/ripple';
|
|
2
|
+
import { DIAGNOSTIC_CODES } from '@tsrx/core';
|
|
2
3
|
import type * as AST from 'estree';
|
|
3
4
|
import type * as ESTreeJSX from 'estree-jsx';
|
|
4
5
|
|
|
@@ -723,6 +724,16 @@ export component App() {
|
|
|
723
724
|
).toBe(true);
|
|
724
725
|
});
|
|
725
726
|
|
|
727
|
+
it('collects volar parser diagnostics outside loose mode', () => {
|
|
728
|
+
const result = compile_to_volar_mappings(`component App() {
|
|
729
|
+
return <div />;
|
|
730
|
+
}`, 'test.tsrx');
|
|
731
|
+
|
|
732
|
+
expect(result.errors.map((error) => error.code)).toContain(
|
|
733
|
+
DIAGNOSTIC_CODES.JSX_RETURN_IN_COMPONENT,
|
|
734
|
+
);
|
|
735
|
+
});
|
|
736
|
+
|
|
726
737
|
it('throws for unclosed tsx compat tags instead of hanging', () => {
|
|
727
738
|
const source = `export component App() {
|
|
728
739
|
<tsx:react>1
|
|
@@ -744,6 +755,32 @@ export component App() {
|
|
|
744
755
|
expect(result.errors).toEqual([]);
|
|
745
756
|
});
|
|
746
757
|
|
|
758
|
+
it('collects unclosed tsx compat tags outside loose mode', () => {
|
|
759
|
+
const source = `export component App() {
|
|
760
|
+
<tsx:react>1
|
|
761
|
+
}`;
|
|
762
|
+
|
|
763
|
+
const result = compile(source, 'test.tsrx', { collect: true });
|
|
764
|
+
expect(result.errors.map((error) => error.message)).toContain(
|
|
765
|
+
'Unclosed tag \'<tsx:react>\'. Expected \'</tsx:react>\' before end of component.',
|
|
766
|
+
);
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
it('collects analyzer errors outside loose mode', () => {
|
|
770
|
+
const source = `
|
|
771
|
+
import { track } from 'ripple';
|
|
772
|
+
|
|
773
|
+
const outside = track(0);
|
|
774
|
+
|
|
775
|
+
export component App() {}
|
|
776
|
+
`;
|
|
777
|
+
|
|
778
|
+
const result = compile(source, 'test.tsrx', { collect: true });
|
|
779
|
+
expect(result.errors.map((error) => error.message)).toContain(
|
|
780
|
+
'`track` can only be used within a reactive context, such as a component, function or class that is used or created from a component',
|
|
781
|
+
);
|
|
782
|
+
});
|
|
783
|
+
|
|
747
784
|
it('preserves class extends generic type arguments in volar output', () => {
|
|
748
785
|
const source = `class StringMap extends Map<string, string> {}
|
|
749
786
|
export component App() {}`;
|
|
@@ -820,7 +857,7 @@ export component App() {
|
|
|
820
857
|
const ast = parse(source);
|
|
821
858
|
const comp = ast.body[0] as unknown as AST.Component;
|
|
822
859
|
const ul = comp.body.find((n) => n.type === 'Element') as AST.Element;
|
|
823
|
-
expect(ul.id.name).toBe('ul');
|
|
860
|
+
expect((ul.id as AST.Identifier).name).toBe('ul');
|
|
824
861
|
expect(ul.children.length).toBeGreaterThanOrEqual(1);
|
|
825
862
|
const decl = ul.children[0] as unknown as AST.VariableDeclaration;
|
|
826
863
|
expect(decl.type).toBe('VariableDeclaration');
|