├── .eslintignore ├── .eslintrc.yml ├── .github └── workflows │ └── test.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── compiler.d.ts ├── eslint.config.js ├── package.json ├── playwright.config.js ├── src ├── constants.js ├── generators │ ├── css │ │ └── index.js │ ├── javascript │ │ ├── index.js │ │ └── utils.js │ └── template │ │ ├── bindings │ │ ├── each.js │ │ ├── if.js │ │ ├── simple.js │ │ ├── slot.js │ │ └── tag.js │ │ ├── builder.js │ │ ├── checks.js │ │ ├── constants.js │ │ ├── expressions │ │ ├── attribute.js │ │ ├── event.js │ │ ├── index.js │ │ ├── ref.js │ │ ├── text.js │ │ └── value.js │ │ ├── find.js │ │ ├── index.js │ │ └── utils.js ├── index.js ├── postprocessors.js ├── preprocessors.js ├── transformer.js └── utils │ ├── add-lines-offset.js │ ├── ast-nodes-checks.js │ ├── build-types.js │ ├── clone-deep.js │ ├── compose-sourcemaps.js │ ├── create-sourcemap.js │ ├── custom-ast-nodes.js │ ├── generate-ast.js │ ├── generate-javascript.js │ ├── get-line-and-column-by-position.js │ ├── get-preprocessor-type-by-attribute.js │ ├── has-html-outside-root-node.js │ ├── html-entities │ ├── encode.js │ └── entities.json │ ├── is-empty-array.js │ ├── is-empty-sourcemap.js │ ├── mock │ ├── assert-mock-api.js │ ├── os-mock-api.js │ └── sourcemap-mock-api.js │ ├── pre-process-source.js │ ├── preprocess-node.js │ ├── replace-in-range.js │ ├── sourcemap-as-json.js │ ├── split-string-by-EOL.js │ ├── trim-end.js │ ├── trim-start.js │ └── unescape-char.js └── test ├── api.spec.js ├── browser.runtime.js ├── commonjs.spec.cjs ├── core.spec.js ├── e2e.runtime.html ├── expected └── .gitkeep ├── fixtures ├── comments-component.riot ├── dynamic-import.riot ├── each-and-events.riot ├── empty-script.riot ├── empty-style.riot ├── empty-template-with-attributes.riot ├── multiline-expressions.riot ├── multiple-root-nodes-comment.riot ├── multiple-root-nodes-css.riot ├── multiple-root-nodes-html.riot ├── multiple-root-nodes-script.riot ├── my-babel-component.riot ├── my-component.riot ├── object-expression.riot ├── only-css.riot ├── only-html.riot ├── only-javascript.riot ├── pug-component.pug ├── root-app.riot ├── static-attributes.riot ├── svg-loader.riot ├── typescript-script-type.riot └── weird-namespace.riot ├── generators ├── css.spec.js ├── javascript.spec.js └── template.spec.js ├── helpers.js ├── postprocessors.spec.js ├── preprocessors.spec.js ├── sourcemap.spec.js ├── test.e2e.js ├── transformer.spec.js ├── tsconfig.json └── typing.spec.ts /.eslintignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/.eslintignore -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/.eslintrc.yml -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/.github/workflows/test.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/.gitignore -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /coverage 3 | /node_modules 4 | /.nyc_output 5 | /stats.html 6 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/.prettierrc.js -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/README.md -------------------------------------------------------------------------------- /compiler.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/compiler.d.ts -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/eslint.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/package.json -------------------------------------------------------------------------------- /playwright.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/playwright.config.js -------------------------------------------------------------------------------- /src/constants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/constants.js -------------------------------------------------------------------------------- /src/generators/css/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/css/index.js -------------------------------------------------------------------------------- /src/generators/javascript/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/javascript/index.js -------------------------------------------------------------------------------- /src/generators/javascript/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/javascript/utils.js -------------------------------------------------------------------------------- /src/generators/template/bindings/each.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/bindings/each.js -------------------------------------------------------------------------------- /src/generators/template/bindings/if.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/bindings/if.js -------------------------------------------------------------------------------- /src/generators/template/bindings/simple.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/bindings/simple.js -------------------------------------------------------------------------------- /src/generators/template/bindings/slot.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/bindings/slot.js -------------------------------------------------------------------------------- /src/generators/template/bindings/tag.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/bindings/tag.js -------------------------------------------------------------------------------- /src/generators/template/builder.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/builder.js -------------------------------------------------------------------------------- /src/generators/template/checks.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/checks.js -------------------------------------------------------------------------------- /src/generators/template/constants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/constants.js -------------------------------------------------------------------------------- /src/generators/template/expressions/attribute.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/attribute.js -------------------------------------------------------------------------------- /src/generators/template/expressions/event.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/event.js -------------------------------------------------------------------------------- /src/generators/template/expressions/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/index.js -------------------------------------------------------------------------------- /src/generators/template/expressions/ref.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/ref.js -------------------------------------------------------------------------------- /src/generators/template/expressions/text.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/text.js -------------------------------------------------------------------------------- /src/generators/template/expressions/value.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/expressions/value.js -------------------------------------------------------------------------------- /src/generators/template/find.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/find.js -------------------------------------------------------------------------------- /src/generators/template/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/index.js -------------------------------------------------------------------------------- /src/generators/template/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/generators/template/utils.js -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/index.js -------------------------------------------------------------------------------- /src/postprocessors.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/postprocessors.js -------------------------------------------------------------------------------- /src/preprocessors.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/preprocessors.js -------------------------------------------------------------------------------- /src/transformer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/transformer.js -------------------------------------------------------------------------------- /src/utils/add-lines-offset.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/add-lines-offset.js -------------------------------------------------------------------------------- /src/utils/ast-nodes-checks.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/ast-nodes-checks.js -------------------------------------------------------------------------------- /src/utils/build-types.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/build-types.js -------------------------------------------------------------------------------- /src/utils/clone-deep.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/clone-deep.js -------------------------------------------------------------------------------- /src/utils/compose-sourcemaps.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/compose-sourcemaps.js -------------------------------------------------------------------------------- /src/utils/create-sourcemap.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/create-sourcemap.js -------------------------------------------------------------------------------- /src/utils/custom-ast-nodes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/custom-ast-nodes.js -------------------------------------------------------------------------------- /src/utils/generate-ast.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/generate-ast.js -------------------------------------------------------------------------------- /src/utils/generate-javascript.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/generate-javascript.js -------------------------------------------------------------------------------- /src/utils/get-line-and-column-by-position.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/get-line-and-column-by-position.js -------------------------------------------------------------------------------- /src/utils/get-preprocessor-type-by-attribute.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/get-preprocessor-type-by-attribute.js -------------------------------------------------------------------------------- /src/utils/has-html-outside-root-node.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/has-html-outside-root-node.js -------------------------------------------------------------------------------- /src/utils/html-entities/encode.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/html-entities/encode.js -------------------------------------------------------------------------------- /src/utils/html-entities/entities.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/html-entities/entities.json -------------------------------------------------------------------------------- /src/utils/is-empty-array.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/is-empty-array.js -------------------------------------------------------------------------------- /src/utils/is-empty-sourcemap.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/is-empty-sourcemap.js -------------------------------------------------------------------------------- /src/utils/mock/assert-mock-api.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/mock/assert-mock-api.js -------------------------------------------------------------------------------- /src/utils/mock/os-mock-api.js: -------------------------------------------------------------------------------- 1 | export const EOL = '\n' 2 | -------------------------------------------------------------------------------- /src/utils/mock/sourcemap-mock-api.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/mock/sourcemap-mock-api.js -------------------------------------------------------------------------------- /src/utils/pre-process-source.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/pre-process-source.js -------------------------------------------------------------------------------- /src/utils/preprocess-node.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/preprocess-node.js -------------------------------------------------------------------------------- /src/utils/replace-in-range.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/replace-in-range.js -------------------------------------------------------------------------------- /src/utils/sourcemap-as-json.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/sourcemap-as-json.js -------------------------------------------------------------------------------- /src/utils/split-string-by-EOL.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/split-string-by-EOL.js -------------------------------------------------------------------------------- /src/utils/trim-end.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/trim-end.js -------------------------------------------------------------------------------- /src/utils/trim-start.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/trim-start.js -------------------------------------------------------------------------------- /src/utils/unescape-char.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/src/utils/unescape-char.js -------------------------------------------------------------------------------- /test/api.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/api.spec.js -------------------------------------------------------------------------------- /test/browser.runtime.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/browser.runtime.js -------------------------------------------------------------------------------- /test/commonjs.spec.cjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/commonjs.spec.cjs -------------------------------------------------------------------------------- /test/core.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/core.spec.js -------------------------------------------------------------------------------- /test/e2e.runtime.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/e2e.runtime.html -------------------------------------------------------------------------------- /test/expected/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/comments-component.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/comments-component.riot -------------------------------------------------------------------------------- /test/fixtures/dynamic-import.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/dynamic-import.riot -------------------------------------------------------------------------------- /test/fixtures/each-and-events.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/each-and-events.riot -------------------------------------------------------------------------------- /test/fixtures/empty-script.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/empty-script.riot -------------------------------------------------------------------------------- /test/fixtures/empty-style.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/empty-style.riot -------------------------------------------------------------------------------- /test/fixtures/empty-template-with-attributes.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/empty-template-with-attributes.riot -------------------------------------------------------------------------------- /test/fixtures/multiline-expressions.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/multiline-expressions.riot -------------------------------------------------------------------------------- /test/fixtures/multiple-root-nodes-comment.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/multiple-root-nodes-comment.riot -------------------------------------------------------------------------------- /test/fixtures/multiple-root-nodes-css.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/multiple-root-nodes-css.riot -------------------------------------------------------------------------------- /test/fixtures/multiple-root-nodes-html.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/multiple-root-nodes-html.riot -------------------------------------------------------------------------------- /test/fixtures/multiple-root-nodes-script.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/multiple-root-nodes-script.riot -------------------------------------------------------------------------------- /test/fixtures/my-babel-component.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/my-babel-component.riot -------------------------------------------------------------------------------- /test/fixtures/my-component.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/my-component.riot -------------------------------------------------------------------------------- /test/fixtures/object-expression.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/object-expression.riot -------------------------------------------------------------------------------- /test/fixtures/only-css.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/only-css.riot -------------------------------------------------------------------------------- /test/fixtures/only-html.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/only-html.riot -------------------------------------------------------------------------------- /test/fixtures/only-javascript.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/only-javascript.riot -------------------------------------------------------------------------------- /test/fixtures/pug-component.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/pug-component.pug -------------------------------------------------------------------------------- /test/fixtures/root-app.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/root-app.riot -------------------------------------------------------------------------------- /test/fixtures/static-attributes.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/static-attributes.riot -------------------------------------------------------------------------------- /test/fixtures/svg-loader.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/svg-loader.riot -------------------------------------------------------------------------------- /test/fixtures/typescript-script-type.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/typescript-script-type.riot -------------------------------------------------------------------------------- /test/fixtures/weird-namespace.riot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/fixtures/weird-namespace.riot -------------------------------------------------------------------------------- /test/generators/css.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/generators/css.spec.js -------------------------------------------------------------------------------- /test/generators/javascript.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/generators/javascript.spec.js -------------------------------------------------------------------------------- /test/generators/template.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/generators/template.spec.js -------------------------------------------------------------------------------- /test/helpers.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/helpers.js -------------------------------------------------------------------------------- /test/postprocessors.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/postprocessors.spec.js -------------------------------------------------------------------------------- /test/preprocessors.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/preprocessors.spec.js -------------------------------------------------------------------------------- /test/sourcemap.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/sourcemap.spec.js -------------------------------------------------------------------------------- /test/test.e2e.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/test.e2e.js -------------------------------------------------------------------------------- /test/transformer.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/transformer.spec.js -------------------------------------------------------------------------------- /test/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/tsconfig.json -------------------------------------------------------------------------------- /test/typing.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riot/compiler/HEAD/test/typing.spec.ts --------------------------------------------------------------------------------