Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
spicyzboss committed Jul 22, 2022
0 parents commit 9254e1e
Show file tree
Hide file tree
Showing 14 changed files with 305 additions and 0 deletions.
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# 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.*
Binary file added bun.lockb
Binary file not shown.
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Mono:wght@400;500;700" rel="stylesheet">
</head>
<body>
<noscript style="width: 100%; display: flex; justify-content: center; align-items: center; border: none; padding: 0;">
<p style="font-family: Google Sans Mono, sans-serif; font-weight: bold;">JavaScipt?</p>
</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "bad-humors",
"version": "0.1",
"module": "src/index.js",
"scripts": {
"dev": "vite dev --port 3000",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"solid-app-router": "^0.4.1",
"solid-js": "^1.4.7"
},
"devDependencies": {
"autoprefixer": "^10.4.7",
"bun-types": "^0.1.4",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.6",
"vite": "^3.0.2",
"vite-plugin-solid": "^2.3.0"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bad Humors

Just wanna see everyday humor.
18 changes: 18 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Component } from 'solid-js';
import { lazy } from 'solid-js';
import { Routes, Route } from "solid-app-router";
const HomePage = lazy(() => import('@pages/index'));
const NotFoundPage = lazy(() => import('@pages/404'));

const App: Component = () => {
return (
<>
<Routes>
<Route path='/' element={<HomePage />} />
<Route path='*' element={<NotFoundPage />} />
</Routes>
</>
);
};

export default App;
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

* {
font-family: Google Sans, sans-serif;
}
12 changes: 12 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* @refresh reload */
import './index.css';
import { render } from 'solid-js/web';
import { Router } from 'solid-app-router';

import App from './app';

render(() => (
<Router>
<App />
</Router>
), document.getElementById('root'));
14 changes: 14 additions & 0 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Component } from 'solid-js'
import { onMount } from 'solid-js'

const NotFoundPage: Component = () => {
onMount(() => {
document.title = 'Not Found | Bad Humors'
})

return (
<div>Not Found</div>
);
};

export default NotFoundPage;
16 changes: 16 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { onMount } from "solid-js"
import type { Component } from "solid-js"

const HomePage: Component = () => {
onMount(() => {
document.title = 'Bad Humors'
})

return (
<div class="h-screen w-screen flex justify-center items-center">
<p class="text-4xl font-bold">Hello World!</p>
</div>
)
};

export default HomePage;
12 changes: 12 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,tsx}"],
theme: {
extend: {
fontFamily: {
'google-mono': ['Google Sans Mono', 'monospace']
},
},
},
plugins: [],
}
28 changes: 28 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"noEmit": true,
"isolatedModules": true,
"lib": [
"ESNext",
"DOM"
],
"types": [
"vite/client",
// "bun-types"
],
"baseUrl": ".",
"paths": {
"@components/*": ["./src/components/*"],
"@layouts/*": ["./src/layouts/*"],
"@config/*": ["./src/config/*"],
"@pages/*": ["./src/pages/*"],
}
}
}
19 changes: 19 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';

export default defineConfig({
plugins: [solidPlugin()],
build: {
target: 'ESNext',
outDir: 'build',
assetsDir: 'public'
},
resolve: {
alias: {
'@components': 'src/components',
'@layouts': 'src/layouts',
'@config': 'src/config',
'@pages': 'src/pages',
}
}
});

0 comments on commit 9254e1e

Please sign in to comment.