diff --git a/assets/speaker.json b/assets/speaker.json new file mode 100644 index 0000000..e623334 --- /dev/null +++ b/assets/speaker.json @@ -0,0 +1,5 @@ +{ + "title": "Briques du Web", + "episode" : "S01E04" + +} diff --git a/package-lock.json b/package-lock.json index dab9b8a..cf149bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "rimraf": "^3.0.2", "rollup": "^2.46.0", "rollup-plugin-copy": "^3.4.0", + "rollup-plugin-json": "^4.0.0", "tslib": "^2.2.0", "typescript": "^4.2.4" } @@ -9567,6 +9568,16 @@ "node": ">= 4" } }, + "node_modules/rollup-plugin-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz", + "integrity": "sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==", + "deprecated": "This module has been deprecated and is no longer maintained. Please use @rollup/plugin-json.", + "dev": true, + "dependencies": { + "rollup-pluginutils": "^2.5.0" + } + }, "node_modules/rollup-plugin-terser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", @@ -19041,6 +19052,15 @@ } } }, + "rollup-plugin-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz", + "integrity": "sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==", + "dev": true, + "requires": { + "rollup-pluginutils": "^2.5.0" + } + }, "rollup-plugin-terser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", diff --git a/package.json b/package.json index d2c6b1f..0554516 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "rimraf": "^3.0.2", "rollup": "^2.46.0", "rollup-plugin-copy": "^3.4.0", + "rollup-plugin-json": "^4.0.0", "tslib": "^2.2.0", "typescript": "^4.2.4" }, diff --git a/rollup.config.js b/rollup.config.js index 8dc5b8c..cb50dea 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,6 @@ import merge from 'deepmerge'; import copy from 'rollup-plugin-copy' +import json from 'rollup-plugin-json'; // use createSpaConfig for bundling a Single Page App import { createSpaConfig } from '@open-wc/building-rollup'; @@ -32,6 +33,7 @@ export default merge(baseConfig, { // set flatten to false to preserve folder structure flatten: false, }), + json() ], // alternatively, you can use your JS as entrypoint for rollup and diff --git a/src/BriquesPoster.ts b/src/BriquesPoster.ts index f6d269b..519e45e 100644 --- a/src/BriquesPoster.ts +++ b/src/BriquesPoster.ts @@ -1,11 +1,55 @@ import {LitElement, html, css} from 'lit'; import {customElement, property} from 'lit/decorators.js'; +import speaker from '../assets/speaker.json'; @customElement("briques-poster") export class BriquesPoster extends LitElement { @property() title = 'Briques du Web'; + @property() episode = speaker.episode; + + render() { + return html` + + + + + + + + ${this.episode} + + + Mardi 27/04 + 12h15 + + + + + + + Design Systems, autonomie et créativité + Retour d'expérience de Decathlon + + + + + + + Laurent Thiebault + @lauthieb + + + + https://www.twitch.tv/rdvspeakers + + + + + `; + } + static styles = css` h2, h3, h4, h5, h6, h7{ @@ -125,45 +169,4 @@ export class BriquesPoster extends LitElement { justify-content: center; } `; - - render() { - return html` - - - - - - - - S01E04 - - - Mardi 27/04 - 12h15 - - - - - - - Design Systems, autonomie et créativité - Retour d'expérience de Decathlon - - - - - - - Laurent Thiebault - @lauthieb - - - - https://www.twitch.tv/rdvspeakers - - - - - `; - } } diff --git a/tsconfig.json b/tsconfig.json index a97d82e..7a6f7c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,7 @@ "outDir": "out-tsc", "sourceMap": true, "inlineSources": true, + "resolveJsonModule": true, "rootDir": "./", "incremental": true }, diff --git a/typings.d.ts b/typings.d.ts new file mode 100644 index 0000000..f3f5966 --- /dev/null +++ b/typings.d.ts @@ -0,0 +1,4 @@ +declare module "*.json" { + const value: any; + export default value; +}