@wuchale/astro 0.2.6 → 0.2.8

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 CHANGED
@@ -8,6 +8,7 @@ export declare function createAstroHeuristic(opts: CreateHeuristicOpts): Heurist
8
8
  export declare const astroDefaultHeuristic: HeuristicFunc;
9
9
  type LoadersAvailable = 'default';
10
10
  export type AstroArgs = AdapterArgs<LoadersAvailable>;
11
+ export declare const defaultArgs: AstroArgs;
11
12
  export declare function getDefaultLoaderPath(loader: LoaderChoice<LoadersAvailable>, bundle: boolean): string | null;
12
13
  /**
13
14
  * Create an Astro adapter for wuchale
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ const defaultRuntime = {
38
38
  wrapUse: expr => expr,
39
39
  },
40
40
  };
41
- const defaultArgs = {
41
+ export const defaultArgs = {
42
42
  files: 'src/**/*.astro',
43
43
  localesDir: './src/locales',
44
44
  patterns: [pluralPattern],
@@ -233,8 +233,10 @@ export class AstroTransformer extends Transformer {
233
233
  return this._parseAndVisitExpr(node.value, this.frontMatterStart, true);
234
234
  };
235
235
  visitroot = (node) => {
236
- this._saveCorrectedRanges(node.children, this.content.length);
237
- return this._visitChildren(node.children ?? []); // can be undefined!
236
+ // node.children can be undefined!
237
+ const children = node.children ?? [];
238
+ this._saveCorrectedRanges(children, this.content.length);
239
+ return this._visitChildren(children);
238
240
  };
239
241
  visitAs = (node) => this.visit(node);
240
242
  transformAs = async () => {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@wuchale/astro",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Wuchale i18n adapter for Astro files",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",
7
7
  "build": "tsc",
8
- "test": "node tests/index.ts"
8
+ "test": "node --import ../wuchale/testing/resolve.ts --test"
9
9
  },
10
10
  "keywords": [
11
11
  "i18n",
@@ -48,11 +48,11 @@
48
48
  "author": "K1DV5",
49
49
  "license": "MIT",
50
50
  "dependencies": {
51
- "@astrojs/compiler": "^2.13.0",
52
- "@sveltejs/acorn-typescript": "^1.0.8",
51
+ "@astrojs/compiler": "^2.13.1",
52
+ "@sveltejs/acorn-typescript": "^1.0.9",
53
53
  "acorn": "^8.15.0",
54
54
  "magic-string": "^0.30.21",
55
- "wuchale": "^0.19.2"
55
+ "wuchale": "^0.20.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/estree-jsx": "^1.0.5",