diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aab30a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.parcel-cache/ +dist/ +node_modules/ + diff --git a/.parcelrc b/.parcelrc new file mode 100644 index 0000000..f1cb3d9 --- /dev/null +++ b/.parcelrc @@ -0,0 +1,9 @@ +{ + "extends": "@parcel/config-default", + "transformers": { + "*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"] + }, + "validators": { + "*.{ts,tsx}": ["@parcel/validator-typescript"] + } +} diff --git a/index.js b/index.js index 7256b15..c5690b6 100644 --- a/index.js +++ b/index.js @@ -75,14 +75,17 @@ function importStylesheet(xsl) { } async function createXSLTProcessor() { - return fetch("/MessageLog.xsl") + return fetch(new URL("/MessageLog.xsl")) .then(resp => { if (resp.ok) return resp.text(); else throw new Error(resp.status + ' ' + resp.statusText); }) - .then(str => new DOMParser().parseFromString(str, "text/xml")) + .then(str => { + console.log(str); + return new DOMParser().parseFromString(str, "text/xml"); + }) .then(importStylesheet) .catch(cause => { throw new Error('Could not load XSL stylesheet', { cause }); diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 94279b6..0000000 --- a/jsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "es2017", - "allowSyntheticDefaultImports": true, - "noEmit": true, - "checkJs": true, - "jsx": "react", - "lib": [ "dom", "es2017" ] - } -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0912dce --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "msn-viewer", + "source": "src/index.html", + "browserslist": "> 0.5%, last 2 versions, not dead", + "scripts": { + "start": "parcel", + "build": "parcel build" + }, + "devDependencies": { + "@parcel/transformer-inline-string": "2.8.2", + "@parcel/transformer-sass": "2.8.2", + "@parcel/transformer-typescript-tsc": "^2.8.2", + "@parcel/validator-typescript": "^2.8.2", + "parcel": "^2.8.2", + "typescript": ">=3.0.0" + }, + "dependencies": { + "@popperjs/core": "^2.11.6", + "@types/bootstrap": "^5.2.3", + "bootstrap": "^5.2" + } +} diff --git a/MessageLog.xsl b/src/MessageLog.xsl similarity index 100% rename from MessageLog.xsl rename to src/MessageLog.xsl diff --git a/index.html b/src/index.html similarity index 91% rename from index.html rename to src/index.html index a728b74..cb07fb3 100644 --- a/index.html +++ b/src/index.html @@ -4,11 +4,7 @@