diff --git a/tests/tsx/Dockerfile b/tests/tsx/Dockerfile index 8eb387c..0a55816 100644 --- a/tests/tsx/Dockerfile +++ b/tests/tsx/Dockerfile @@ -35,6 +35,8 @@ RUN cd / \ COPY tests/tsx/test.tsx /scripts/ COPY tests/tsx/tsconfig.json /scripts/ +COPY tests/tsx/package.json /scripts/ +COPY tests/tsx/package-lock.json /scripts/ # Needed in order to load the tsconfig.json WORKDIR /scripts/ @@ -43,7 +45,7 @@ ARG CACHE_INVALIDATE RUN echo "Running tests ${CACHE_INVALIDATE}" \ && export PATH="/gnu/bin:${PATH}" \ - && npm install metacall react react-dom + && npm install RUN export LOADER_SCRIPT_PATH="/scripts/" \ && export METACALL_PATH="/gnu/store/`ls /gnu/store/ | grep metacall | head -n 1`" \ diff --git a/tests/tsx/package-lock.json b/tests/tsx/package-lock.json new file mode 100644 index 0000000..2f4aa09 --- /dev/null +++ b/tests/tsx/package-lock.json @@ -0,0 +1,120 @@ +{ + "name": "templating-tsx", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "templating-tsx", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "react": "^17.0.2", + "react-dom": "^17.0.2" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + } + }, + "node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + } + }, + "scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } + } +} diff --git a/tests/tsx/package.json b/tests/tsx/package.json new file mode 100644 index 0000000..1a182f9 --- /dev/null +++ b/tests/tsx/package.json @@ -0,0 +1,13 @@ +{ + "name": "templating-tsx", + "version": "1.0.0", + "main": "templating.tsx", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "license": "Apache-2.0", + "dependencies": { + "react": "^17.0.2", + "react-dom": "^17.0.2" + } +} diff --git a/tests/tsx/test.tsx b/tests/tsx/test.tsx index 70409f8..b4827c4 100644 --- a/tests/tsx/test.tsx +++ b/tests/tsx/test.tsx @@ -2,5 +2,5 @@ import React from 'react'; import { renderToString } from 'react-dom/server'; export function hello(text: string): string { - return renderToString(

Hello ${text}

); + return renderToString(

{`Hello ${text}`}

); } diff --git a/tests/tsx/tsconfig.json b/tests/tsx/tsconfig.json index d51b502..aa4a87b 100644 --- a/tests/tsx/tsconfig.json +++ b/tests/tsx/tsconfig.json @@ -3,8 +3,10 @@ "templating.tsx" ], "compilerOptions": { - "target": "es5", + "target": "es6", + "module": "commonjs", + "esModuleInterop": true, "jsx": "react", - "lib": ["es2015", "dom"] + "lib": ["es2016", "dom"] } }