@wuchale/svelte 0.19.0 → 0.19.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.
@@ -4,6 +4,7 @@ import { getKey } from 'wuchale';
4
4
  import { MixedVisitor, nonWhitespaceText, varNames } from 'wuchale/adapter-utils';
5
5
  import { parseScript, Transformer } from 'wuchale/adapter-vanilla';
6
6
  const nodesWithChildren = ['RegularElement', 'Component'];
7
+ const noWrapTopCalls = ['$props', '$state', '$derived', '$effect'];
7
8
  const rtComponent = 'W_tx_';
8
9
  const headerAdd = `\nimport ${rtComponent} from "@wuchale/svelte/runtime.svelte"`;
9
10
  const snipPrefix = '_w_snippet_';
@@ -36,8 +37,8 @@ export class SvelteTransformer extends Transformer {
36
37
  return msgs;
37
38
  }
38
39
  const needsWrapping = msgs.some(msg => {
39
- if (msg.details.topLevelCall &&
40
- ['$props', '$state', '$derived', '$derived.by'].includes(msg.details.topLevelCall)) {
40
+ const topCall = msg.details.topLevelCall ?? '';
41
+ if (noWrapTopCalls.includes(topCall) || noWrapTopCalls.some(c => topCall.startsWith(`${c}.`))) {
41
42
  return false;
42
43
  }
43
44
  if (msg.details.declaring !== 'variable') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wuchale/svelte",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Protobuf-like i18n from plain code: Svelte adapter",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "magic-string": "^0.30.21",
55
55
  "svelte": "^5",
56
- "wuchale": "^0.21.0"
56
+ "wuchale": "^0.21.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "acorn": "^8.16.0",