{"_id":"jsx2qa-compiler","_rev":"1-d5852295e1dea72e7be66180dab52338","name":"jsx2qa-compiler","dist-tags":{"beta":"0.1.0-0","latest":"0.1.0-0"},"versions":{"0.1.0-0":{"name":"jsx2qa-compiler","version":"0.1.0-0","license":"BSD-3-Clause","description":"Parser for Rax JSX Statements.","main":"src/index.js","scripts":{"test":"jest --coverage --testPathIgnorePatterns=__modules__","test:watch":"npm run test -- --watchAll"},"homepage":"https://github.com/alibaba/rax#readme","engine":{"node":">=8"},"author":{"name":"Rax Team"},"dependencies":{"@babel/code-frame":"^7.0.0","@babel/generator":"^7.3.4","@babel/parser":"^7.3.4","@babel/traverse":"^7.3.4","@babel/types":"^7.3.4","chalk":"^2.4.2","colors":"^1.3.3","css":"^2.2.4","fs-extra":"^7.0.1","kebab-case":"^1.0.0","md5":"^2.2.1","resolve":"^1.12.0"},"devDependencies":{"handlebars":"^4.5.0","jest":"^24.5.0"},"_id":"jsx2qa-compiler@0.1.0-0","_nodeVersion":"10.16.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hpbPa7KVF+/a510zzrgdrc0JUjqlk9BBbxPPfVKNgW+kR8AskPnA+KfOy4ORrDKA/Ug2YldioJG49LqUm4+Qhg==","shasum":"5154afde11ff6ed5f15032d14fdc17b9e860d35a","tarball":"https://registry.npmjs.org/jsx2qa-compiler/-/jsx2qa-compiler-0.1.0-0.tgz","fileCount":74,"unpackedSize":214224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOMXCRA9TVsSAnZWagAAk9QP/00cKUSpKN8zrGHPrtjR\nI2fehWid/6llozUe5XpLqOMhD+sgodjTHfcUyjvoVwWyu5cBOGzhfqQiI0tL\nFadJUr7K7IYX/8CZux/J1KHKZzyKeDxv/LGZSoQ7dhHq7n/Wh8lnhAPe4anh\nGCwn1P7E5mYYeia1CFwEJAmy91VgKVFQQBeY6YRxfr0YAVSg33U5X2MBjq8I\n7aPIe4ipe9zcUENpAs+N39Tb8dl9ZhOyrizNcyAyhdGi3ivTRSkQHrffAA3y\n9r1f4F5deNV0kwcfIqGKMyh9dzmfPuogumr1Ge5Er0Me+TJuNaCX6zD7uIlg\njWhGmz2cXvWiplJtU7yP9YmkaAWyPll1Qogx1+mkXA+Bic+UUwVAYRsSrhVY\navPEQSgD/Ia6mdInhNXuuL+MhIfnUGe4AytGlgMQk+X/OQnAKNh4zoBebHRs\nuXp974KxJ6cnRYH6t0WBaFsKVLP5AhxI05rx6Ht21B5379Lm8KoDPE5vfAp2\nsu388RD+vyXk66pw9hUttEgW5nvuh2trgfN2eCb9wCxLNjzmC7RrBXXKrMMs\nSjAyfghrSZfYUCJLRf2YdtTqwE1bEpz6DDXxM9z62sjgWp04gG+S8yLD9QrD\niGP00zu8PvNnKzpk4h4r3T9GCdbkWetBm2AezjDoRNWQuFPbWV1/SI7QkdsQ\nY8iQ\r\n=k5Qr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOunpXxthiOzLFwjYV7ET39VHd4hSt5jmFR3okMGRAWAiB4ZL9qVwBvZ1VxKkWMGy2rgjn73+xJ3SvPKlfZTNduRw=="}]},"maintainers":[{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"}],"_npmUser":{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsx2qa-compiler_0.1.0-0_1590485783144_0.02761355898203477"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-26T09:36:23.144Z","0.1.0-0":"2020-05-26T09:36:23.241Z","modified":"2022-05-07T00:16:30.980Z"},"maintainers":[{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"}],"description":"Parser for Rax JSX Statements.","homepage":"https://github.com/alibaba/rax#readme","author":{"name":"Rax Team"},"license":"BSD-3-Clause","readme":"# jsx2qa-compiler\n\nTransform JSX styled Rax Components into quickapp parts.\n\n## example\n\ninput:\n\n```jsx\nimport { Component } from 'rax';\n\nexport default class extends Component {\n\n  render() {\n    return (<view>hello world</view>);\n  }\n}\n```\n\nRun jsx2qa compiler.\n\n- type: Required, enum of `app`, `page`, `component`.\n- outputPath: Required, string of dist path.\n- sourcePath: Required, string of source path.\n- resourcePath: Required, string of original file path.\n\n```js\nconst compile = require('jsx2qa-compiler');\nconst { baseOptions } = compile;\n\nconst output = compile(code, { ...baseOptions, type: 'component' });\n```\n\noutput:\n\n- ast\n  - Babel 7 format AST of JS code\n- imported\n  - Imported modules and local identifiers\n- exported\n  - Exported identifiers\n- template\n  - axml template for quickapp\n- code\n  - Transformed JS code.\n- map\n  - Source map of JS code\n- config\n  - JS Object, quickapp config\n- style\n  - String, acss of style.\n- usingComponents\n\neg.\n\n```js\n{\n  ast: ASTNodeTree,\n  imported: {\n    rax: [\n      {\n        local: \"Component\",\n        default: false,\n        importFrom: \"Component\",\n        name: \"rax\",\n        external: true\n      }\n    ]\n  },\n  exported: [\"default\"],\n  code:\n    'import { createComponent as __create_component__, Component as __component__ } from \"jsx2mp-runtime\";\\n\\nconst __def__ = class extends __component__ {\\n  render() {\\n    return {};\\n  }\\n\\n};\\n\\nComponent(__create_component__(__def__, {\\n  events: []\\n}));',\n  map: null,\n  config: {\n    component: true,\n    usingComponents: {}\n  },\n  style: \"\",\n  usingComponents: {},\n  iconfontMap: [],\n  template: \"<div>hello world</div>\"\n}\n```\n","readmeFilename":"README.md"}