Skip to content

Add tests, docs, and examples for @varlock/expo-integration#1

Merged
ghandic merged 4 commits intoexpo-integrationfrom
copilot/add-expo-integration-support
Mar 11, 2026
Merged

Add tests, docs, and examples for @varlock/expo-integration#1
ghandic merged 4 commits intoexpo-integrationfrom
copilot/add-expo-integration-support

Conversation

Copy link

Copilot AI commented Mar 11, 2026

The Expo/React Native Babel plugin lacked tests, a docs page, and the surrounding package artifacts that every other integration has.

Tests (packages/integrations/expo/test/babel-plugin.test.ts)

14 Vitest unit tests driving the plugin's visitor directly via lightweight mock objects (no @babel/core runtime needed). Covers all decision branches:

  • Module init side-effects (execSyncVarlock, initVarlockEnv, patchGlobalConsole called at startup)
  • Static replacement for every value type: stringStringLiteral, numberNumericLiteral, booleanBooleanLiteral, nullNullLiteral, undefinedIdentifier('undefined'), objectJSON.parse(...) CallExpression
  • Sensitive keys (isSensitive: true) are never passed to replaceWith
  • Computed access (ENV["KEY"]), unknown keys, and non-ENV objects are all skipped
  • Plugin metadata: correct name, api.cache(false) called

Added test / test:ci scripts to package.json consistent with other packages.

Docs (packages/varlock-website/src/content/docs/integrations/expo.mdx)

New docs page following the astro.mdx / vite.mdx pattern:

  • Setup steps (install, varlock init, babel.config.js diff)
  • Compile-time replacement explained with before/after bundle example
  • Type-safety via @generateTypes
  • Multi-environment management with EAS build script examples
  • Sensitive value handling with bundle security callout

Also:

  • Added Expo / React Native entry (with new badge) to the sidebar in astro.config.ts
  • Added Expo to integrations/overview.mdx

Package housekeeping

  • Added CHANGELOG.md (present in every other integration package)
  • Fixed incorrect import in README.md: import ENV from '@varlock/env'import { ENV } from 'varlock/env'

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ghandic <23500353+ghandic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for expo integration similar to nextjs or vite feat: Add Expo/React Native integration (@varlock/expo-integration) Mar 11, 2026
Co-authored-by: ghandic <23500353+ghandic@users.noreply.github.com>
Copilot AI changed the title feat: Add Expo/React Native integration (@varlock/expo-integration) feat: Add @varlock/expo-integration (Babel plugin for Expo/React Native) Mar 11, 2026
… and CHANGELOG

Co-authored-by: ghandic <23500353+ghandic@users.noreply.github.com>
Copilot AI changed the title feat: Add @varlock/expo-integration (Babel plugin for Expo/React Native) Add tests, docs, and examples for @varlock/expo-integration Mar 11, 2026
@ghandic ghandic marked this pull request as ready for review March 11, 2026 23:36
@ghandic ghandic changed the base branch from main to expo-integration March 11, 2026 23:37
@ghandic ghandic merged commit 12b61fc into expo-integration Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants