# HG changeset patch # User drewp@bigasterisk.com # Date 1637892908 28800 # Node ID 6ec759f9009faea36d6ffe18b5b3d9ea3e56cafd # Parent 792452c0eb98165a3c715c4ce3663c331908157d build fixes, dead code, format diff -r 792452c0eb98 -r 6ec759f9009f rollup.config.js --- a/rollup.config.js Wed Nov 17 16:48:45 2021 -0800 +++ b/rollup.config.js Thu Nov 25 18:15:08 2021 -0800 @@ -1,26 +1,9 @@ -// import copy from 'rollup-plugin-copy'; -// import postcss from "rollup-plugin-postcss"; import builtins from 'rollup-plugin-node-builtins'; import commonjs from '@rollup/plugin-commonjs'; import resolve from "@rollup/plugin-node-resolve"; import typescript from "@rollup/plugin-typescript"; import globals from 'rollup-plugin-node-globals'; -const workaround_jsonld_module_system_picker = "process = {version: '1.0.0'}"; -const workaround_some_browser_detector = "global = window"; -const workaround_jsonld_expand_issue = { - namedExports: { - jsonld: ["expand"] // fixes "expand is not exported by node_modules/jsonld/lib/index.js" - } -}; - -const moduleIsntLocal = (id, parentId, isResolved) => { - console.log("check", id, !id.startsWith("./")); - if (isResolved || id == "src/index.ts") { - return false; - } - return !id.startsWith("./"); -}; export default [ { @@ -29,9 +12,7 @@ file: "build/lib.bundle.js", format: "es", sourcemap: true, - // intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};` }, - // external: moduleIsntLocal, plugins: [ builtins(), resolve({ @@ -41,13 +22,8 @@ commonjs(), globals(), typescript({ - outDir: "build", - declaration: true + tsconfig: './tsconfig.json' }), - // postcss({ - // inject: false - // }), - // commonjs(workaround_jsonld_expand_issue) ] }, ]; diff -r 792452c0eb98 -r 6ec759f9009f src/index.ts --- a/src/index.ts Wed Nov 17 16:48:45 2021 -0800 +++ b/src/index.ts Thu Nov 25 18:15:08 2021 -0800 @@ -1,11 +1,11 @@ -import { LitElement, html, css, render, TemplateResult } from "lit"; +import { LitElement, html, render, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators.js"; import { Store } from "n3"; import { GraphView } from "./graph_view"; import { StreamedGraphClient } from "./streamed_graph_client"; -import { style, addFontToRootPage } from './style'; +import { style, addFontToRootPage } from "./style"; // export * from "./graph_queries"; @@ -31,7 +31,8 @@ sg!: StreamedGraphClient; graphViewDirty = true; - static styles=style; + static styles = style; + render() { const expandAction = this.expanded ? "-" : "+"; return html` @@ -132,6 +133,12 @@ } } +declare global { + interface HTMLElementTagNameMap { + "streamed-graph": StreamedGraph; + } +} + // // allow child nodes to combine a few graphs and statics // // // // diff -r 792452c0eb98 -r 6ec759f9009f tsconfig.json --- a/tsconfig.json Wed Nov 17 16:48:45 2021 -0800 +++ b/tsconfig.json Thu Nov 25 18:15:08 2021 -0800 @@ -17,17 +17,18 @@ "moduleResolution": "node", "sourceMap": true, "declaration": true, + "declarationDir": ".", // relative to outDir "experimentalDecorators": true, "allowJs": true, "esModuleInterop": true, // "traceResolution": true, // "allowSyntheticDefaultImports": true, // "rootDir": ".", - // "outDir": "./build", + "outDir": "./build", "baseUrl": "." // "emitDecoratorMetadata": true, // "lib": [ "es6", "dom" ], }, - "include": ["src/**/*.ts", "demo/demo.ts"], - // "exclude": ["src/**/*.test.ts"] + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.test.ts"] }