├── .babelrc ├── .gitignore ├── .prettierrc ├── README.md ├── docs ├── features.webloc └── tmp_header.svg ├── jest.config.js ├── jest.setup.js ├── lib ├── index.ts ├── model │ ├── component.ts │ ├── script.ts │ ├── style.ts │ └── template.ts ├── parser │ ├── component.ts │ ├── generator.ts │ ├── index.ts │ ├── script.ts │ ├── style.ts │ ├── template.ts │ ├── template.xml2js.ts │ ├── walker-ts.ts │ ├── walker.d.ts │ └── walker.js ├── serializer │ └── react │ │ ├── fragments │ │ ├── component.ts │ │ ├── htmlElement.ts │ │ ├── text.ts │ │ └── v-for.ts │ │ ├── index.ts │ │ └── vdom.ts └── transpiler │ └── react │ ├── component.ts │ ├── script.ts │ ├── style.ts │ ├── template.ts │ └── transpiler.ts ├── package.json ├── test ├── compiler.ts ├── dummy.vue ├── fixtures │ └── components │ │ ├── 0-SingleHtmlTag.tsx │ │ ├── 0-SingleHtmlTag.vue │ │ ├── 1-SingleHtmlTagWithText.tsx │ │ ├── 1-SingleHtmlTagWithText.vue │ │ ├── 10-Directive-Else.vue │ │ ├── 2-NestedHtml.tsx │ │ ├── 2-NestedHtml.vue │ │ ├── 3-HtmlWithAttributes.tsx │ │ ├── 3-HtmlWithAttributes.vue │ │ ├── 4-HtmlWithChildComponent.tsx │ │ ├── 4-HtmlWithChildComponent.vue │ │ ├── 5-HtmlWithChildComponentAndProps.tsx │ │ ├── 5-HtmlWithChildComponentAndProps.vue │ │ ├── 6-Props.tsx │ │ ├── 6-Props.vue │ │ ├── 7-Data.tsx │ │ ├── 7-Data.vue │ │ ├── 8-Directive-ForLoop.vue │ │ ├── 9-Directive-If.vue │ │ ├── WithCss.vue │ │ ├── WithSubTemplate.vue │ │ ├── X-ChildComponent.tsx │ │ ├── X-ChildComponent.vue │ │ └── X-Complex.vue ├── index.test.tsx ├── parser │ ├── script.test-disabled.ts │ └── template.test-disabled.ts ├── serializer │ ├── fixtures │ │ ├── attrs.tsx │ │ ├── childComponent.tsx │ │ ├── forLoop.tsx │ │ ├── forLoopWithIndexAndChildAndAttrs.tsx │ │ ├── nestedHtml.tsx │ │ ├── props.tsx │ │ ├── singleTag.tsx │ │ ├── state.tsx │ │ ├── text.tsx │ │ └── v-if-true.tsx │ ├── react.test-disabled-2.tsx │ └── react.test-disabled.tsx └── utils │ ├── importVueAndReact.tsx │ ├── jsonFromTemplate.ts │ └── stringToReact.ts ├── tsconfig.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/.babelrc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 1000 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/README.md -------------------------------------------------------------------------------- /docs/features.webloc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/docs/features.webloc -------------------------------------------------------------------------------- /docs/tmp_header.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/docs/tmp_header.svg -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/jest.config.js -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/jest.setup.js -------------------------------------------------------------------------------- /lib/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/index.ts -------------------------------------------------------------------------------- /lib/model/component.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/model/component.ts -------------------------------------------------------------------------------- /lib/model/script.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/model/script.ts -------------------------------------------------------------------------------- /lib/model/style.ts: -------------------------------------------------------------------------------- 1 | export default interface Style { 2 | contents: string[]; 3 | } 4 | -------------------------------------------------------------------------------- /lib/model/template.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/model/template.ts -------------------------------------------------------------------------------- /lib/parser/component.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/component.ts -------------------------------------------------------------------------------- /lib/parser/generator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/generator.ts -------------------------------------------------------------------------------- /lib/parser/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/index.ts -------------------------------------------------------------------------------- /lib/parser/script.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/script.ts -------------------------------------------------------------------------------- /lib/parser/style.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/style.ts -------------------------------------------------------------------------------- /lib/parser/template.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/template.ts -------------------------------------------------------------------------------- /lib/parser/template.xml2js.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/template.xml2js.ts -------------------------------------------------------------------------------- /lib/parser/walker-ts.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/walker-ts.ts -------------------------------------------------------------------------------- /lib/parser/walker.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/walker.d.ts -------------------------------------------------------------------------------- /lib/parser/walker.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/parser/walker.js -------------------------------------------------------------------------------- /lib/serializer/react/fragments/component.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/fragments/component.ts -------------------------------------------------------------------------------- /lib/serializer/react/fragments/htmlElement.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/fragments/htmlElement.ts -------------------------------------------------------------------------------- /lib/serializer/react/fragments/text.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/fragments/text.ts -------------------------------------------------------------------------------- /lib/serializer/react/fragments/v-for.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/fragments/v-for.ts -------------------------------------------------------------------------------- /lib/serializer/react/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/index.ts -------------------------------------------------------------------------------- /lib/serializer/react/vdom.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/serializer/react/vdom.ts -------------------------------------------------------------------------------- /lib/transpiler/react/component.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/transpiler/react/component.ts -------------------------------------------------------------------------------- /lib/transpiler/react/script.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/transpiler/react/script.ts -------------------------------------------------------------------------------- /lib/transpiler/react/style.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/transpiler/react/style.ts -------------------------------------------------------------------------------- /lib/transpiler/react/template.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/transpiler/react/template.ts -------------------------------------------------------------------------------- /lib/transpiler/react/transpiler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/lib/transpiler/react/transpiler.ts -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/package.json -------------------------------------------------------------------------------- /test/compiler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/compiler.ts -------------------------------------------------------------------------------- /test/dummy.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/dummy.vue -------------------------------------------------------------------------------- /test/fixtures/components/0-SingleHtmlTag.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/0-SingleHtmlTag.tsx -------------------------------------------------------------------------------- /test/fixtures/components/0-SingleHtmlTag.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/0-SingleHtmlTag.vue -------------------------------------------------------------------------------- /test/fixtures/components/1-SingleHtmlTagWithText.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/1-SingleHtmlTagWithText.tsx -------------------------------------------------------------------------------- /test/fixtures/components/1-SingleHtmlTagWithText.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/1-SingleHtmlTagWithText.vue -------------------------------------------------------------------------------- /test/fixtures/components/10-Directive-Else.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/10-Directive-Else.vue -------------------------------------------------------------------------------- /test/fixtures/components/2-NestedHtml.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/2-NestedHtml.tsx -------------------------------------------------------------------------------- /test/fixtures/components/2-NestedHtml.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/2-NestedHtml.vue -------------------------------------------------------------------------------- /test/fixtures/components/3-HtmlWithAttributes.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/3-HtmlWithAttributes.tsx -------------------------------------------------------------------------------- /test/fixtures/components/3-HtmlWithAttributes.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/3-HtmlWithAttributes.vue -------------------------------------------------------------------------------- /test/fixtures/components/4-HtmlWithChildComponent.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/4-HtmlWithChildComponent.tsx -------------------------------------------------------------------------------- /test/fixtures/components/4-HtmlWithChildComponent.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/4-HtmlWithChildComponent.vue -------------------------------------------------------------------------------- /test/fixtures/components/5-HtmlWithChildComponentAndProps.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/5-HtmlWithChildComponentAndProps.tsx -------------------------------------------------------------------------------- /test/fixtures/components/5-HtmlWithChildComponentAndProps.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/5-HtmlWithChildComponentAndProps.vue -------------------------------------------------------------------------------- /test/fixtures/components/6-Props.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/6-Props.tsx -------------------------------------------------------------------------------- /test/fixtures/components/6-Props.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/6-Props.vue -------------------------------------------------------------------------------- /test/fixtures/components/7-Data.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/7-Data.tsx -------------------------------------------------------------------------------- /test/fixtures/components/7-Data.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/7-Data.vue -------------------------------------------------------------------------------- /test/fixtures/components/8-Directive-ForLoop.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/8-Directive-ForLoop.vue -------------------------------------------------------------------------------- /test/fixtures/components/9-Directive-If.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/9-Directive-If.vue -------------------------------------------------------------------------------- /test/fixtures/components/WithCss.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/WithCss.vue -------------------------------------------------------------------------------- /test/fixtures/components/WithSubTemplate.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/WithSubTemplate.vue -------------------------------------------------------------------------------- /test/fixtures/components/X-ChildComponent.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/X-ChildComponent.tsx -------------------------------------------------------------------------------- /test/fixtures/components/X-ChildComponent.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/X-ChildComponent.vue -------------------------------------------------------------------------------- /test/fixtures/components/X-Complex.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/fixtures/components/X-Complex.vue -------------------------------------------------------------------------------- /test/index.test.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/index.test.tsx -------------------------------------------------------------------------------- /test/parser/script.test-disabled.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/parser/script.test-disabled.ts -------------------------------------------------------------------------------- /test/parser/template.test-disabled.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/parser/template.test-disabled.ts -------------------------------------------------------------------------------- /test/serializer/fixtures/attrs.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/attrs.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/childComponent.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/childComponent.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/forLoop.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/forLoop.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/forLoopWithIndexAndChildAndAttrs.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/forLoopWithIndexAndChildAndAttrs.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/nestedHtml.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/nestedHtml.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/props.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/props.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/singleTag.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/singleTag.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/state.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/state.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/text.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/text.tsx -------------------------------------------------------------------------------- /test/serializer/fixtures/v-if-true.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/fixtures/v-if-true.tsx -------------------------------------------------------------------------------- /test/serializer/react.test-disabled-2.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/react.test-disabled-2.tsx -------------------------------------------------------------------------------- /test/serializer/react.test-disabled.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/serializer/react.test-disabled.tsx -------------------------------------------------------------------------------- /test/utils/importVueAndReact.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/utils/importVueAndReact.tsx -------------------------------------------------------------------------------- /test/utils/jsonFromTemplate.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/utils/jsonFromTemplate.ts -------------------------------------------------------------------------------- /test/utils/stringToReact.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/test/utils/stringToReact.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/tsconfig.json -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LukasBombach/single-file-components/HEAD/yarn.lock --------------------------------------------------------------------------------