Skip to content

Commit

Permalink
Switch to npm for preact+htm
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Jul 20, 2023
1 parent fbbbbd3 commit fa8727e
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 3,255 deletions.
3,438 changes: 200 additions & 3,238 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"gsap": "^3.12.2",
"htm": "^3.1.1",
"immer": "^9.0.21",
"preact": "^10.16.0",
"tone": "^14.8.49"
},
"release-it": {
Expand Down
8 changes: 7 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
console.log('i will be transpiled')
import {Component, render} from 'preact'
import {useState} from 'preact/hooks'
import {html} from 'htm/preact'

// This file bundles the things we need in the UI to make the imports easier.

export {Component, render, useState, html}
2 changes: 1 addition & 1 deletion src/ui/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Third party dependencies
import {html, Component, useState} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component, useState} from '../main.js'
import gsap from './animations.js'
// @ts-ignore
import Flip from 'https://slaytheweb-assets.netlify.app/gsap/Flip.js'
Expand Down
2 changes: 1 addition & 1 deletion src/ui/campfire.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'
import CardChooser from './card-chooser.js'

export default class CampfireRoom extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/card-chooser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'
import {Card} from './cards.js'

export default class CardChooser extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/cards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'
import {canPlay} from '../../public/game/conditions.js'

export default class Cards extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/collection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, render} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, render} from '../main.js'
import cards from '../../public/content/cards.js'
import {Card} from './cards.js'

Expand Down
2 changes: 1 addition & 1 deletion src/ui/dungeon-stats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'

const getEnemiesStats = (dungeon) => {
const stats = {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/history.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'

export default class Queue extends Component {
constructor(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, render, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, render, Component} from '../main.js'
import App from './app.js'
import SplashScreen from './splash-screen.js'
import WinScreen from './win-screen.js'
Expand Down
2 changes: 1 addition & 1 deletion src/ui/map.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, html} from '../../public/web_modules/htm/preact/standalone.module.js'
import {Component, html} from '../main.js'
import {random as randomBetween} from '../../public/game/utils.js'
import {isRoomCompleted} from '../../public/game/utils-state.js'

Expand Down
2 changes: 1 addition & 1 deletion src/ui/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html} from '../main.js'
import History from './history.js'

const save = (state) => (window.location.hash = encodeURIComponent(JSON.stringify(state)))
Expand Down
2 changes: 1 addition & 1 deletion src/ui/overlays.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html} from '../main.js'

// A tiny overlay UI component.
export function Overlay(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/player.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'
import {
weak as weakPower,
vulnerable as vulnerablePower,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/splash-screen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'
import gsap from '../../public/web_modules/gsap.js'

export default class SplashScreen extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/start-room.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, Component} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, Component} from '../main.js'

export default class StartRoom extends Component {
render() {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/stats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html, render} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html, render} from '../main.js'
import {getRuns} from '../../public/game/backend.js'

const List = (props) => html`
Expand Down
2 changes: 1 addition & 1 deletion src/ui/win-screen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {html} from '../../public/web_modules/htm/preact/standalone.module.js'
import {html} from '../main.js'

const WinScreen = (props) => html`
<article class="Splash">
Expand Down

0 comments on commit fa8727e

Please sign in to comment.