Registry / testing / weex-vue-migration

weex-vue-migration

JSON →
library0.2.5jsnpmunverified

Transforms Weex *.we DSL files into Vue *.vue single-file components. Version 0.2.5 is the latest release (no active update cadence, appears unmaintained since 2018). It provides both a CLI tool (`weex-vue-migrate`) and a programmatic API (`transform`). Unlike manual migration, it automates conversion of Weex-specific syntax (e.g., `<template>`, `<style>`, `<element>`) to Vue-compatible code. Limited to basic transformations; does not handle complex bindings or third-party module compatibility.

npm install weex-vue-migration
INSTALL
IMPORT
SIG · WEEX-VUE-MIGRATION
W
weex-vue-migration
testingjavascriptv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transform
import { transform } from 'weex-vue-migration'
const transform = require('weex-vue-migration').default
Use named import for ESM; require returns the module directly (no .default).
migrater
const migrater = require('weex-vue-migration')
import migrater from 'weex-vue-migration'
CommonJS default export works only in Node; ESM users must use named import for `transform`.
transform result
const result = transform(weexCode); result.content
const result = new migrater().transform(weexCode)
transform is a plain function, not a constructor.

Converts a Weex `.we` file content to Vue `.vue` file content using the Node.js API.

const { transform } = require('weex-vue-migration'); const weexCode = ` <template> <div><text>Hello</text></div> </template> <style scoped> .text { color: red; } </style> <script> module.exports = { data: { msg: 'Hello' } } </script> `; const result = transform(weexCode); console.log(result.content);
Debug
Known issues
deprecatedPackage is no longer maintained; last release 2018.
fix
Consider manual migration or use alternative tools like weex-vue-transformer.
affects: >=0.0.0
gotchaCLI only processes `.we` files; does not handle inline styles or complex expressions.
fix
Review output and manually fix edge cases.
affects: <=0.2.5
breakingOutput Vue code may contain invalid HTML or missing imports for Weex-specific components.
fix
Post-process output to add Vue component registrations.
affects: <=0.2.5
Errors
Common errors & fixes
TypeError: migrater.transform is not a function
Using require and calling transform incorrectly (e.g., migrater.transform()).
fix
Use `const { transform } = require('weex-vue-migration');` or `const migrater = require('weex-vue-migration'); migrater.transform(code);`.
ENOENT: no such file or directory, open 'input.we'
CLI requires an existing input file; missing file path.
fix
Verify the file path or provide full path to `.we` file.
Upgrade
Version history
0.2.5latest on npm
Audit
Dependencies
commanderrequiredUsed for CLI argument parsing
Agent activity
18 hits · last 30 days
node
16
Amazon
1
Resources
weex-vue-migration — npm install weex-vue-migration · libregistry