crates icon indicating copy to clipboard operation
crates copied to clipboard

Support for standard .vue files

Open Armaldio opened this issue 7 years ago • 5 comments

I've tried to generate files from a standard vue file

<template></template>

<script>
	import T from 'crates'
	
	export default {
		name      : 'installer',
		mounted() {
			console.log(T("Hello world"));
		}
	}
</script>

<style></style>

I get the following error:

compiling file:src/renderer/App.vueParser: { SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag (12:0)
    at Parser.pp$5.raise (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:4454:13)
    at Parser.pp$9.jsxParseElementAt (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:7213:10)
    at Parser.pp$9.jsxParseElement (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:7224:15)
    at Parser.parseExprAtom (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:7236:21)
    at Parser.pp$3.parseExprSubscripts (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3494:19)
    at Parser.pp$3.parseMaybeUnary (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3474:19)
    at Parser.pp$3.parseExprOps (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3404:19)
    at Parser.pp$3.parseMaybeConditional (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3381:19)
    at Parser.pp$3.parseMaybeAssign (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3344:19)
    at Parser.parseMaybeAssign (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:6433:24)
    at Parser.pp$3.parseExpression (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:3306:19)
    at Parser.pp$1.parseStatement (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:1906:19)
    at Parser.parseStatement (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:5910:22)
    at Parser.pp$1.parseBlockBody (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:2268:21)
    at Parser.pp$1.parseTopLevel (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:1778:8)
    at Parser.parse (D:\Projects\ConstructAddonInstaller\Installer\node_modules\babylon\lib\index.js:1673:17) pos: 223, loc: Position { line: 12, column: 0 } }

Armaldio avatar Mar 01 '18 21:03 Armaldio

Ok, I have to test it here.

dleitee avatar Mar 01 '18 22:03 dleitee

Is there an update on this issue? :)

nop33 avatar Mar 28 '18 10:03 nop33

Nope, I can't test it yet.

dleitee avatar Mar 28 '18 13:03 dleitee

With the proper guidance in the codebase, I could help with this issue. Let me know if I can help somehow.

nop33 avatar Apr 06 '18 09:04 nop33

Sure @nop33, can you open a (work in progress) PR? and we'll discuss the implementation.

What do you think?

dleitee avatar Apr 09 '18 21:04 dleitee