@wuchale/astro 0.3.3 → 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.
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: {
@@ -24,7 +24,6 @@ export declare class AstroTransformer extends Transformer {
24
24
  };
25
25
  initMixedVisitor: () => MixedVisitorAstro;
26
26
  _parseAndVisitExpr: (expr: string, startOffset: number, asScript?: boolean) => Message[];
27
- visitExportNamedDeclaration: () => never[];
28
27
  visitexpression: (node: ExpressionNode) => Message[];
29
28
  _visitChildren: (nodes: Node[]) => Message[];
30
29
  visitFragmentNode: (node: FragmentNode) => Message[];
@@ -135,7 +135,6 @@ export class AstroTransformer extends Transformer {
135
135
  this.mstr.offset = 0; // restore
136
136
  return msgs;
137
137
  };
138
- visitExportNamedDeclaration = () => [];
139
138
  visitexpression = (node) => {
140
139
  if (!node.children?.length) {
141
140
  // can be undefined!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wuchale/astro",
3
- "version": "0.3.3",
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",