Skip to content

Commit

Permalink
Generate runtime options file using Babel
Browse files Browse the repository at this point in the history
Previously runtime options were generated using manually created AST
nodes and `astring` module. This was hindersome to maintain, so I
decided to switch to using recast at first, but quickly found it doesn't
support some of AST types that we need, so I've migrated to Babel
modules instead, which provide all the nice APIs and generate more
correct code than recast.
  • Loading branch information
brawaru committed Oct 23, 2024
1 parent e3e82a7 commit 1583989
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 1,486 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-horses-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vintl/nuxt': patch
---

Switch to Babel for runtime options generation
4 changes: 3 additions & 1 deletion packages/vintl-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@nuxt/eslint-config": "^0.6.0",
"@nuxt/module-builder": "^0.8.4",
"@nuxt/schema": "^3.13.2",
"@types/babel__generator": "^7.6.8",
"@types/hash-sum": "^1.0.2",
"@types/node": "^18.19.56",
"@vintl-dev/eslint-config-peony": "workspace:^",
Expand All @@ -57,12 +58,13 @@
"vue-tsc": "^2.1.6"
},
"dependencies": {
"@babel/generator": "^7.25.9",
"@babel/types": "^7.25.9",
"@formatjs/intl": "^2.10.8",
"@formatjs/intl-localematcher": "^0.5.5",
"@nuxt/kit": "^3.13.2",
"@vintl/unplugin": "^2.0.0",
"@vintl/vintl": "^4.4.1",
"astring": "^1.9.0",
"consola": "^3.2.3",
"hash-sum": "^2.0.0",
"import-meta-resolve": "^4.1.0",
Expand Down
Loading

0 comments on commit 1583989

Please sign in to comment.