@wuchale/jsx 0.9.6 → 0.9.7
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 +3 -3
- package/dist/runtime.jsx +6 -7
- package/dist/transformer.js +1 -1
- package/package.json +6 -16
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export declare function createJsxHeuristic(opts: CreateHeuristicOpts): Heuristic
|
|
|
4
4
|
export declare const jsxDefaultHeuristic: HeuristicFunc;
|
|
5
5
|
type LoadersAvailable = 'default' | 'react' | 'solidjs';
|
|
6
6
|
export type JSXArgs = AdapterArgs<LoadersAvailable> & {
|
|
7
|
-
variant
|
|
7
|
+
variant: JSXLib;
|
|
8
8
|
};
|
|
9
9
|
export declare function getDefaultLoaderPath(loader: LoaderChoice<LoadersAvailable>, bundle: boolean): string | {
|
|
10
10
|
client: string;
|
|
11
11
|
server: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const adapter: (args?: JSXArgs) => Adapter;
|
|
12
|
+
} | null;
|
|
13
|
+
export declare const adapter: (args?: Partial<JSXArgs>) => Adapter;
|
|
14
14
|
export {};
|
package/dist/runtime.jsx
CHANGED
|
@@ -6,15 +6,14 @@ export function selectFragment({ n, x, t, a }, i) {
|
|
|
6
6
|
if (!n || i > 0) {
|
|
7
7
|
return a[x];
|
|
8
8
|
}
|
|
9
|
+
return `i18n-400:${x}`;
|
|
10
|
+
}
|
|
11
|
+
const tag = t[x[0]];
|
|
12
|
+
if (tag == null) {
|
|
13
|
+
return 'i18n-404:tag';
|
|
9
14
|
}
|
|
10
15
|
else {
|
|
11
|
-
|
|
12
|
-
if (tag == null) {
|
|
13
|
-
return 'i18n-404:tag';
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return tag(x);
|
|
17
|
-
}
|
|
16
|
+
return tag(x);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
export default (props) => {
|
package/dist/transformer.js
CHANGED
|
@@ -228,7 +228,7 @@ export class JSXTransformer extends Transformer {
|
|
|
228
228
|
const msgs = this.visitJx(ast);
|
|
229
229
|
const header = [
|
|
230
230
|
`import ${rtComponent} from "@wuchale/jsx/runtime${lib === 'solidjs' ? '.solid' : ''}.jsx"`,
|
|
231
|
-
this.initRuntime(this.filename
|
|
231
|
+
this.initRuntime(this.filename),
|
|
232
232
|
].join('\n');
|
|
233
233
|
const bodyStart = this.getRealBodyStart(ast.body);
|
|
234
234
|
return this.finalize(msgs, bodyStart, header);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wuchale/jsx",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "Protobuf-like i18n from plain code: JSX adapter",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "tsc --watch",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"gettext",
|
|
15
15
|
"jsx",
|
|
16
16
|
"react",
|
|
17
|
-
"
|
|
17
|
+
"preact",
|
|
18
|
+
"solidjs",
|
|
18
19
|
"vite",
|
|
19
20
|
"po",
|
|
20
21
|
"react-i18n",
|
|
@@ -56,22 +57,11 @@
|
|
|
56
57
|
"bugs": "https://github.com/wuchalejs/wuchale/issues",
|
|
57
58
|
"author": "K1DV5",
|
|
58
59
|
"license": "MIT",
|
|
59
|
-
"peerDependencies": {
|
|
60
|
-
"react": "^19.1.1",
|
|
61
|
-
"solid-js": "^1.9.9"
|
|
62
|
-
},
|
|
63
|
-
"peerDependenciesMeta": {
|
|
64
|
-
"solid-js": {
|
|
65
|
-
"optional": true
|
|
66
|
-
},
|
|
67
|
-
"react": {
|
|
68
|
-
"optional": true
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
60
|
"dependencies": {
|
|
72
|
-
"@sveltejs/acorn-typescript": "^1.0.
|
|
61
|
+
"@sveltejs/acorn-typescript": "^1.0.8",
|
|
73
62
|
"acorn": "^8.15.0",
|
|
74
|
-
"
|
|
63
|
+
"magic-string": "^0.30.21",
|
|
64
|
+
"wuchale": "^0.18.8"
|
|
75
65
|
},
|
|
76
66
|
"devDependencies": {
|
|
77
67
|
"@types/estree-jsx": "^1.0.5",
|