@wuchale/astro 0.3.2 → 0.3.4

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ export function createAstroHeuristic(opts) {
12
12
  if (msg.details.scope !== 'script') {
13
13
  return defRes;
14
14
  }
15
- if (msg.details.call?.startsWith('Astro.')) {
15
+ if (msg.details.call?.startsWith('Astro.') || (msg.details.funcName == null && msg.details.exported)) {
16
16
  return false;
17
17
  }
18
18
  return defRes;
@@ -21,7 +21,7 @@ export function createAstroHeuristic(opts) {
21
21
  export const astroDefaultHeuristic = createAstroHeuristic(defaultHeuristicOpts);
22
22
  export const defaultRuntime = {
23
23
  // Astro is SSR-only, so we use non-reactive runtime by default
24
- initReactive: ({ funcName }) => (funcName == null ? false : null), // Only init in top-level functions
24
+ initReactive: ({ funcName, nested }) => (funcName == null || !nested ? false : null), // Only init in top-level and top-level functions
25
25
  // Astro is SSR - always use non-reactive
26
26
  useReactive: () => false,
27
27
  reactive: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wuchale/astro",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Wuchale i18n adapter for Astro files",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",
@@ -52,7 +52,7 @@
52
52
  "@sveltejs/acorn-typescript": "^1.0.9",
53
53
  "acorn": "^8.16.0",
54
54
  "magic-string": "^0.30.21",
55
- "wuchale": "^0.23.0"
55
+ "wuchale": "^0.23.4"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/estree-jsx": "^1.0.5",