Skip to content

Commit

Permalink
Colocate assets
Browse files Browse the repository at this point in the history
  • Loading branch information
niedzielski committed Feb 27, 2024
1 parent 27052a5 commit fbe3ae0
Show file tree
Hide file tree
Showing 37 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![:play](src/assets/favicon/favicon48.png) :play
# ![:play](src/favicon/favicon48.png) :play

A little playground for building apps on Reddit.

Expand Down
4 changes: 2 additions & 2 deletions src/elements/play-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
type TemplateResult
} from 'lit'
import {customElement, property} from 'lit/decorators.js'
import type {PlayIconSVG} from './play-icon.js'
import type {PlayIconSVG} from './play-icon/play-icon.js'

import './play-icon.js'
import './play-icon/play-icon.js'

export type PlayButtonAppearance =
| 'bordered'
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
36 changes: 18 additions & 18 deletions src/elements/play-icon.ts → src/elements/play-icon/play-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import {customElement, property} from 'lit/decorators.js'
import {styleMap} from 'lit/directives/style-map.js'
import {unsafeHTML} from 'lit/directives/unsafe-html.js'

import addOutline from '../assets/icons/add-outline.svg'
import caretDownOutline from '../assets/icons/caret-down-outline.svg'
import caretUpOutline from '../assets/icons/caret-up-outline.svg'
import checkmarkFill from '../assets/icons/checkmark-fill.svg'
import closeOutline from '../assets/icons/close-outline.svg'
import communityOutline from '../assets/icons/community-outline.svg'
import copyClipboardOutline from '../assets/icons/copy-clipboard-outline.svg'
import dayOutline from '../assets/icons/day-outline.svg'
import downloadOutline from '../assets/icons/download-outline.svg'
import externalOutline from '../assets/icons/external-outline.svg'
import infoOutline from '../assets/icons/info-outline.svg'
import nightOutline from '../assets/icons/night-outline.svg'
import overflowHorizontalOutline from '../assets/icons/overflow-horizontal-outline.svg'
import readingOutline from '../assets/icons/reading-outline.svg'
import reportOutline from '../assets/icons/report-outline.svg'
import resizeHorizontalOutline from '../assets/icons/resize-horizontal-outline.svg'
import restartOutline from '../assets/icons/restart-outline.svg'
import shareNewOutline from '../assets/icons/share-new-outline.svg'
import addOutline from './icons/add-outline.svg'
import caretDownOutline from './icons/caret-down-outline.svg'
import caretUpOutline from './icons/caret-up-outline.svg'
import checkmarkFill from './icons/checkmark-fill.svg'
import closeOutline from './icons/close-outline.svg'
import communityOutline from './icons/community-outline.svg'
import copyClipboardOutline from './icons/copy-clipboard-outline.svg'
import dayOutline from './icons/day-outline.svg'
import downloadOutline from './icons/download-outline.svg'
import externalOutline from './icons/external-outline.svg'
import infoOutline from './icons/info-outline.svg'
import nightOutline from './icons/night-outline.svg'
import overflowHorizontalOutline from './icons/overflow-horizontal-outline.svg'
import readingOutline from './icons/reading-outline.svg'
import reportOutline from './icons/report-outline.svg'
import resizeHorizontalOutline from './icons/resize-horizontal-outline.svg'
import restartOutline from './icons/restart-outline.svg'
import shareNewOutline from './icons/share-new-outline.svg'

export type PlayIconSVG = keyof typeof icons

Expand Down
4 changes: 2 additions & 2 deletions src/elements/play-list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
type TemplateResult
} from 'lit'
import {customElement, property} from 'lit/decorators.js'
import type {PlayIconSVG} from './play-icon.js'
import type {PlayIconSVG} from './play-icon/play-icon.js'

import './play-icon.js'
import './play-icon/play-icon.js'

declare global {
interface HTMLElementTagNameMap {
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {LitElement, css, type CSSResultGroup} from 'lit'
import {customElement} from 'lit/decorators.js'
import {unsafeHTML} from 'lit/directives/unsafe-html.js'
import logo from '../assets/logo.svg'
import logo from './logo.svg'

declare global {
interface HTMLElementTagNameMap {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/play-new-pen-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {Bubble} from '../utils/bubble.js'
import {openURL} from '../utils/open-url.js'

import './play-dropdown-menu.js'
import './play-icon.js'
import './play-icon/play-icon.js'
import './play-list-item.js'

export type SizeOptions = 'small' | 'medium'
Expand Down
4 changes: 2 additions & 2 deletions src/elements/play-pen-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import type {PlayExportDialog} from './play-export-dialog.js'

import './play-button.js'
import './play-export-dialog.js'
import './play-icon.js'
import './play-logo.js'
import './play-icon/play-icon.js'
import './play-logo/play-logo.js'
import './play-new-pen-button.js'
import './play-resizable-text-input.js'

Expand Down
2 changes: 1 addition & 1 deletion src/elements/play-toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type TemplateResult
} from 'lit'
import {customElement, property} from 'lit/decorators.js'
import './play-icon.js'
import './play-icon/play-icon.js'

declare global {
interface HTMLElementTagNameMap {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import esbuild from 'esbuild'
import fs from 'node:fs/promises'
import path from 'node:path'
import pkg from '../package.json' assert {type: 'json'}
import manifest from '../src/assets/manifest.json' assert {type: 'json'}
import manifest from '../src/manifest.json' assert {type: 'json'}
import {readTSDs} from './tsd.js'

const watch = process.argv.includes('--watch')
Expand All @@ -28,7 +28,7 @@ const plugin = {
async function pluginOnEnd(result) {
const manifestCopy = structuredClone(manifest)
for (const icon of manifestCopy.icons) {
const file = await fs.readFile(path.join('src', 'assets', icon.src))
const file = await fs.readFile(path.join('src', icon.src))
icon.src = `data:${icon.type};base64,${file.toString('base64')}`
}
if (watch)
Expand All @@ -46,7 +46,7 @@ async function pluginOnEnd(result) {
if (watch)
js += `new EventSource('/esbuild').addEventListener('change', () => location.reload());`

let html = await fs.readFile(path.join('src', 'assets', 'play.html'), 'utf8')
let html = await fs.readFile(path.join('src', 'play.html'), 'utf8')
html = html
.replace('{favicon}', () => manifestCopy.icons[0]?.src ?? '')
.replace('{manifest}', () => manifestURI)
Expand Down
2 changes: 1 addition & 1 deletion tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

"rootDir": ".."
},
"include": ["**/*", "../package.json", "../src/assets/manifest.json"]
"include": ["**/*", "../package.json", "../src/manifest.json"]
}

0 comments on commit fbe3ae0

Please sign in to comment.