Initial commit

This commit is contained in:
William Moore 2023-07-01 09:03:45 -05:00
parent dc8e3eaaf1
commit 776669c659
11 changed files with 2721 additions and 0 deletions

137
.gitignore vendored Normal file
View File

@ -0,0 +1,137 @@
# ---> Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
certs/
build/
public/js/
dist/
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

1732
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "dd-spell-scry",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "npm run clean && mkdir dist && cp -R public/*.html dist && npx tsc && npx rollup -c",
"clean": "rm -rf build && rm -rf dist",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"lit": "^2.7.5",
"typescript": "^5.1.6"
},
"devDependencies": {
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@types/bootstrap": "^5.2.6",
"@web/rollup-plugin-copy": "^0.4.0",
"@web/rollup-plugin-html": "^2.0.0",
"@web/rollup-plugin-polyfills-loader": "^2.0.0",
"rollup": "^3.25.3",
"rollup-plugin-summary": "^2.0.0"
}
}

23
public/index.html Normal file
View File

@ -0,0 +1,23 @@
<html>
<head>
<title>DD Spell Scryer</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" crossorigin="anonymous">
<script type="module" src="./js/SpellCard.js"></script>
<script type="module" src="./js/SpellList.js"></script>
<script type="module" src="./js/Place.js"></script>
<script type="module" src="./js/Scryer.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-expand-lg bg-body-tertiary"><span class="navbar-brand">Dragon Dice Spell Scryer</span></div>
<spell-scryer></spell-scryer>
</div>
</body>
</html>

30
rollup.config.mjs Normal file
View File

@ -0,0 +1,30 @@
// Import rollup plugins
import { rollupPluginHTML as html } from "@web/rollup-plugin-html";
import {copy} from '@web/rollup-plugin-copy';
import resolve from '@rollup/plugin-node-resolve';
// import * as terser from '@rollup/plugin-terser';
// import * as minifyHTML from 'rollup-plugin-minify-html-literals';
import summary from 'rollup-plugin-summary';
export default {
plugins: [
// Entry point for application build; can specify a glob to build multiple
// HTML files for non-SPA app
html({
input: 'dist/**.html',
}),
// Resolve bare module specifiers to relative paths
resolve(),
// Print bundle summary
summary(),
// Optional: copy any static assets to build directory
copy({
patterns: ['images/**/*', 'css/**/*.css'],
}),
],
output: {
dir: 'build',
},
experimentalCodeSplitting: true,
preserveEntrySignatures: 'strict',
};

76
src/Place.ts Normal file
View File

@ -0,0 +1,76 @@
import { LitElement, html, css, CSSResultGroup } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { Spell, spellSort } from './Spell';
@customElement('dd-place')
export class Place extends LitElement {
location: string = "place";
@property() getCurrentSpell: any = null;
constructor() {
super();
const storedSpells = JSON.parse(localStorage.getItem(this.location) ?? '[]');
this.spells = storedSpells;
}
static get properties() {
return {
location: {
type: String,
},
};
}
spells: Spell[] = [];
addSpell() {
if (this.getCurrentSpell && typeof this.getCurrentSpell === 'function') {
const spell = this.getCurrentSpell();
this.spells.push(spell);
localStorage.setItem(this.location, JSON.stringify(this.spells));
this.requestUpdate();
}
}
removeSpell(name: string) {
const index = this.spells.map(spell => spell?.name).indexOf(name);
if (index > -1) {
this.spells.splice(index, 1);
localStorage.setItem(this.location, JSON.stringify(this.spells));
this.requestUpdate();
}
}
static override styles = [
css`
.place-spells {
height: 70vh;
position: relative;
overflow: auto;
}
.place-spells > * {
padding: .6em !important;
}
`
];
override render() {
return html`
<div @click="${this.addSpell}">
<h3>${this.location}</h3>
<div class="place-spells">
${this.spells.sort(spellSort).map(spell => spell ? html`<dd-spell .spellRemover="${(name: string) => this.removeSpell(name)}" name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" cantripMagic="${spell.cantripMagic}" reserveMagic="${spell.reserveMagic}" description="${spell.description}"></dd-spell>` : '')}
</div>
</div>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'dd-place': Place;
}
}

120
src/Scryer.ts Normal file
View File

@ -0,0 +1,120 @@
import { LitElement, html, css } from 'lit';
import { customElement } from 'lit/decorators.js';
import { Spell } from './Spell';
@customElement('spell-scryer')
export class Scryer extends LitElement {
isSpellPaneOpen: boolean = false;
currentSpell: Spell | null = null;
spellCount: number = 0;
getCurrentSpell() {
if (this.currentSpell) {
const spell = { ...this.currentSpell };
this.currentSpell = null;
return spell;
}
return null;
}
setCurrentSpell(spell: Spell) {
this.currentSpell = spell;
this.spellCount = 1;
if (this.isSpellPaneOpen) {
this.toggleSpellPane();
}
}
dismissAddModal() {
this.currentSpell = null;
this.spellCount = 0;
this.requestUpdate();
}
setSpellCount() {
this.spellCount = 1;
}
toggleSpellPane() {
this.isSpellPaneOpen = !this.isSpellPaneOpen;
this.requestUpdate();
}
static get styles() {
let globalStyle = '';
for (let styleSheetI = 0; styleSheetI < document.styleSheets.length; styleSheetI++) {
const { cssRules } = document.styleSheets[styleSheetI];
globalStyle = `${globalStyle}\n${Object.values(cssRules).map(rule => rule.cssText).join('\n')}`;
}
const stringArray = [globalStyle] as any;
stringArray.raw = [globalStyle];
return [
css(stringArray as TemplateStringsArray),
css`
@media (min-width: 501px) {
.the_board >* {
width: 15em;
}
}
.spell_scryer {
width: 100%;
}
a, a:hover, a:visited {
color: black;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.spell_list {
position: fixed;
z-index: 9999;
background-color: white;
}
.the_board {
display: flex;
justify-content: center;
flex-direction: row;
text-align: center;
}
.the_board >* {
padding: .25em;
}
`
];
}
override render() {
return html`
<div class="spell_scryer">
<div class="container spell_list" style="display: ${this.isSpellPaneOpen ? 'block' : 'none'}">
<a href="#" @click="${this.toggleSpellPane}">Close <i class="bi bi-x-circle-fill"></i></a>
<spell-list .selectSpell="${(spell: Spell) => this.setCurrentSpell(spell)}"></spell-list>
</div>
<a href="#" @click="${this.toggleSpellPane}">Spells <i class="bi bi-magic"></i></a>
<div class="the_board">
<dd-place .getCurrentSpell="${() => this.getCurrentSpell()}" location="Player 1 Reserves"></dd-place>
<dd-place .getCurrentSpell="${() => this.getCurrentSpell()}" location="Player 1 Home"></dd-place>
<dd-place .getCurrentSpell="${() => this.getCurrentSpell()}" location="Frontier"></dd-place>
<dd-place .getCurrentSpell="${() => this.getCurrentSpell()}" location="Player 2 Home"></dd-place>
<dd-place .getCurrentSpell="${() => this.getCurrentSpell()}" location="Player 2 Reserves"></dd-place>
</div>
</div>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'spell-scryer': Scryer;
}
}

31
src/Spell.ts Normal file
View File

@ -0,0 +1,31 @@
export type Spell = {
name: string;
cost: number;
color: string;
category: string;
description: string;
reserveMagic?: boolean;
cantripMagic?: boolean;
}
export const spellSort = (a: Spell, b: Spell) => {
let compareValue = 0;
if (!a) {
return -1;
} else if (!b) {
return 1;
}
compareValue = a.color.localeCompare(b.color);
if (compareValue == 0) {
compareValue = a.category.localeCompare(b.category);
if (compareValue == 0) {
compareValue = a.name.localeCompare(b.name);
}
}
return compareValue;
}

136
src/SpellCard.ts Normal file
View File

@ -0,0 +1,136 @@
import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { Spell } from './Spell';
@customElement('dd-spell')
export class SpellCard extends LitElement {
name: string = '';
cost: number = 0;
color: string = '';
category: string = '';
description: string = '';
cantripMagic: boolean | null = false;
reserveMagic: boolean | null = false;
@property() spellRemover: any = null;
@property() selectSpell: any = null;
showDesc: string = 'none';
static get properties() {
return {
name: {
type: String
},
cost: {
type: Number
},
color: {
type: String
},
category: {
type: String
},
description: {
type: String
},
cantripMagic: {
type: Boolean
},
reserveMagic: {
type: Boolean
},
}
};
openSpellDescription() {
if (this.showDesc === 'none') {
this.showDesc = 'block';
} else {
this.showDesc = 'none';
}
this.requestUpdate();
}
removeSpell(event: any) {
if (this.spellRemover && typeof this.spellRemover === 'function') {
this.spellRemover(this.name);
event.preventDefault();
}
}
selectASpell(event: any) {
if (this.selectSpell && typeof this.selectSpell === 'function') {
this.selectSpell({
name: this.name,
cost: this.cost,
color: this.color,
category: this.category,
description: this.description,
cantripMagic: this.cantripMagic,
reserveMagic: this.reserveMagic,
});
event.preventDefault();
}
}
getColor() {
switch (this.color) {
case 'Black':
return 'black';
case 'Blue':
return 'blue';
case 'Green':
return 'green';
case 'Red':
return 'red';
case 'Yellow':
return '#FFDB58';
case 'Gold':
return '#FFD700';
case 'Bronze':
return '#CD7F32';
case 'Silver':
return '#BCC6CC';
default:
return 'grey';
}
}
static styles = [
css`
.spell-card {
border: .1em solid black;
border-radius: .25em;
padding: .25em;
}
`
];
override render() {
return html`
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" crossorigin="anonymous">
<div class="spell-card">
<div style="padding: .5em; background-color: ${this.getColor()}; color: white; text-align: right;" @click="${(event: any) => this.selectSpell ? this.selectASpell(event) : this.removeSpell(event)}"><i class="bi bi-plus-circle-fill" style="display: ${this.selectSpell ? 'inner-block' : 'none'}"></i><i style="display: ${this.spellRemover ? 'inner-block' : 'none'}" class="bi bi-trash-fill"></i></div>
<div @click="${this.openSpellDescription}">
<div><b><u>${this.name} - ${this.color} (${this.cost})</u></b></div>
<div style="display: ${this.showDesc}; text-align: left;">
<div><b>Category</b>: ${this.category}</div>
${this.cantripMagic ? html`<div><b>Cantrip Castable</b></div>` : ''}
${this.reserveMagic ? html`<div><b>Reserve Castable</b></div>` : ''}
<div>${this.description}</div>
</div>
</div>
</div>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'dd-spell': SpellCard;
}
}

293
src/SpellList.ts Normal file
View File

@ -0,0 +1,293 @@
import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { Spell, spellSort } from './Spell';
import { Modal } from 'bootstrap';
@customElement('spell-list')
export class SpellList extends LitElement {
allSpells: Spell[] = [
{
name: 'Palsy',
cost: 2,
color: 'Black',
category: 'Basic',
cantripMagic: true,
description: 'Target any opposing army. Subtract one result from the target\'s non-maneuver rolls until the beginning of your next turn.',
},
{
name: 'Decay',
cost: 3,
color: 'Black',
category: 'Goblins',
description: 'Targt any opposing army. Subtract two melee results from the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Evil Eye',
cost: 3,
color: 'Black',
category: 'Undead',
description: 'Target any opposing army. Subtract two save results from the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Magic Drain',
cost: 3,
color: 'Black',
category: 'Frostwings',
description: 'Target any terrain. Subtract two magic results from all army rolls at that terrain until the beginning of your next turn.',
},
{
name: 'Restless Dead',
cost: 3,
color: 'Black',
category: 'Undead',
cantripMagic: true,
reserveMagic: true,
description: 'Target any army. Add three maneuver to the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Necromantic Wave',
cost: 5,
color: 'Black',
category: 'Lava Elves',
reserveMagic: true,
description: 'Target any army. All units in the target army may count magic results as if they were melee or missile results until the beginning of your next turn.',
},
{
name: 'Open Grave',
cost: 6,
color: 'Black',
category: 'Undead',
reserveMagic: true,
description: 'Target any army. Until the beginning of your next turn, units in the targt army that are killed following a save roll by any army-targeting effects (including melee and missile damage) go to their owner\'s Reserve Area instead of the DUA. If no save roll is possible when units are killed, Open Grave does nothing.',
},
{
name: 'Soiled Ground',
cost: 6,
color: 'Black',
category: 'Basic',
description: 'Target any terrain. Until the beginning of your next turn, any unit killed at that terrain that goes into the DUA must make a save roll. Those that o not generate a save result are buried.',
},
{
name: 'Blizzard',
cost: 3,
color: 'Blue',
category: 'Coral Elves',
description: 'Target any terrain. Subtract three melee results from all army rolls at that terrain until the beginning of your next turn.',
},
{
name: 'Wilding',
cost: 3,
color: 'Blue',
category: 'Feral',
reserveMagic: true,
description: 'Target any army. The target army may double the melee and save results of any one unit until the beginning of your next turn. Select the unit to double its results after the army makes the roll.',
},
{
name: 'Wind Walk',
cost: 4,
color: 'Blue',
category: 'Basic',
reserveMagic: true,
description: 'Target any army. Add four maneuver results to the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Fields of Ice',
cost: 5,
color: 'Blue',
category: 'Frostwings',
description: 'Target any terrain. Subtract four maneuver results from all army rolls at that terrain until the beginning of your next turn. Ties in maneuver roll sat that terrain are won by the counter-maneuvering army while the terrain is under the effect of Fields of Ice.',
},
{
name: 'Watery Double',
cost: 2,
color: 'Green',
category: 'Basic',
cantripMagic: true,
reserveMagic: true,
description: 'Target any army. Add one save result to the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Accelerated Growth',
cost: 3,
color: 'Green',
category: 'Treefolk',
cantripMagic: true,
reserveMagic: true,
description: 'Target your DUA. When a two (or greaterS) health Treefolk unit is killed, you ma instead exchange it with a one health Treefolk unit from your DUA. This effect lasts until the beginning of your next turn.',
},
{
name: 'Deluge',
cost: 5,
color: 'Green',
category: 'Coral Elves',
description: 'Target any terrain. Subtract three maneuver and three missile results from all army rolls at that terrain until the beginning of your next turn.',
},
{
name: 'Mire',
cost: 5,
color: 'Green',
category: 'Swamp Stalkers',
description: 'Target any terrain. Until the beginning of your next turn, any army marching at that terrain must first make a maneuver roll. The marching player then selects health-worth of units up to the maneuver results generated by this first roll. The army uses only those units, and items they carry, for any rolls in the march for both the maneuver step and the action step.',
},
{
name: 'Wall of Fog',
cost: 6,
color: 'Green',
category: 'Basic',
description: 'Target any terrain. Subtract six missile results from any missile attack targeting an army at that terrain until the beginning of your next turn.',
},
{
name: 'Ash Storm',
cost: 2,
color: 'Red',
category: 'Basic',
cantripMagic: true,
description: 'Target any terrain. Subtract one result from army rolls at that terrain until the beginning of your next turn.',
},
{
name: 'Flash Fire',
cost: 3,
color: 'Red',
category: 'Firewalkers',
cantripMagic: true,
reserveMagic: true,
description: 'Target any army. During any non-maneuver army roll, the target\'s owner may re-roll any one unit in the target army once, ignoring the previous result. This effecdt lasts until the beginning of your next turn.',
},
{
name: 'Fiery Weapon',
cost: 4,
color: 'Red',
category: 'Basic',
reserveMagic: true,
description: 'Target any army. Add two melee or missile results to any roll the target makes until the beginning of your next turn.',
},
{
name: 'Dancing Lights',
cost: 6,
color: 'Red',
category: 'Basic',
description: 'Target any opposing army. Subtract six results from the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Stone Skin',
cost: 2,
color: 'Yellow',
category: 'Basic',
cantripMagic: true,
reserveMagic: true,
description: 'Target any army. Add one save result to the target\'s army rolls until the beginning of your next turn.',
},
{
name: 'Berzerker Rage',
cost: 5,
color: 'Yellow',
category: 'Feral',
reserveMagic: true,
description: 'Target any army containing at least one Feral unit. All Feral units in the target army may count save results as if they were melee results during all counter-attacks until the beginning of your next turn.',
},
{
name: 'Higher Ground',
cost: 5,
color: 'Yellow',
category: 'Dwarves',
description: 'Target any opposing army. Subtract five melee result to the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Wall of Thorns',
cost: 5,
color: 'Yellow',
category: 'Treefolk',
description: 'Target any terrain not at its eighth face. Any army that successfully maneuvers that terrain takes six points of damage. The army makes a melee roll instead of a save roll. Reduce the damage taken by the number of melee results generated. This effect lasts until the beginning of your next turn.',
},
{
name: 'Transmute Rock to Mud',
cost: 6,
color: 'Yellow',
category: 'Basic',
description: 'Target any opposing army. Subtract six maneuver results from the target\'s rolls until the beginning of your next turn.',
},
{
name: 'Anti-Magic Surge',
cost: 5,
color: 'Bronze',
category: 'Dracolem',
description: 'Target any terrain. Subtract four magic results from all army rolls at that terrain until the beginning of your next turn.',
},
{
name: 'Escape Portal',
cost: 5,
color: 'Gold',
category: 'Dracolem',
description: 'Target any army. Until the beginning of your next turn, units in the target arm ythat are killed by any army-targeting effecdts (including melee and missile damage) should make another save roll before being moved to the DUA. Any units that generate a save result are instead moved to your Reserve Area. Any units that do not generate a save result may instead be exchanged with a smaller health unit of the same species from your DUA. If no save roll was possible when the units are killed, Escape Portal does nothing.',
},
{
name: 'Knock Out',
cost: 5,
color: 'Any Alloy',
category: 'Dracolem',
description: 'Target up to three health-worth of units in any opposing asrmy. The targets are knocked out and cannot be rolled until the beginning of your next turn, unless they are the target of an individual-targeting effect which forces them to. Knocked out units that leave the terrain through any means are no longer knocked out.',
},
];
filteredSpells: Spell[] = [
...this.allSpells,
];
@property() selectSpell: any;
spell: Spell | null = null;
selectASpell(spell: Spell) {
this.spell = spell;
if (typeof this.selectSpell === 'function') {
this.selectSpell(spell);
}
}
static get styles() {
let globalStyle = '';
for (let styleSheetI = 0; styleSheetI < document.styleSheets.length; styleSheetI++) {
const { cssRules } = document.styleSheets[styleSheetI];
globalStyle = `${globalStyle}\n${Object.values(cssRules).map(rule => rule.cssText).join('\n')}`;
}
const stringArray = [globalStyle] as any;
stringArray.raw = [globalStyle];
return [
css(stringArray as TemplateStringsArray),
css`
.modal {
z-index: 99999;
}
.spells {
overflow: auto;
position: relative;
height: 70vh;
}
`
];
}
filterText(event: any) {
const textToFilterBy = event.target.value.toUpperCase();
this.filteredSpells = this.allSpells.filter(spell => spell.name.toUpperCase().includes(textToFilterBy) || spell.category.toUpperCase().includes(textToFilterBy) || spell.color.toUpperCase().includes(textToFilterBy) || spell.description.toUpperCase().includes(textToFilterBy));
this.requestUpdate();
}
override render() {
return html`
<h2 style="text-align: center;">Spells</h2>
<input type="text" @keyup="${(event: any) => this.filterText(event)}" />
<div class="spells">
${this.filteredSpells.sort(spellSort).map(spell => html`<dd-spell name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" cantripMagic="${spell.cantripMagic}" reserveMagic="${spell.reserveMagic}" description="${spell.description}" .selectSpell="${() => this.selectASpell(spell)}"></dd-spell>`)}
</div>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'spell-list': SpellList;
}
}

115
tsconfig.json Normal file
View File

@ -0,0 +1,115 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "ES2019", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": ["ES2019", "DOM", "DOM.Iterable"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
"experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"rootDir": "./src", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist/js", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"plugins": [
{
"name": "ts-lit-plugin",
"strict": true
}
]
}
}