Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of project with Svelte and without Svelte #72

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"url": "./src/schema/openapi.schema.json"
}
],
"[svelte]": { "editor.defaultFormatter": "svelte.svelte-vscode" },
"svelte.enable-ts-plugin": true,
"files.eol": "\n"
}
260 changes: 260 additions & 0 deletions dist/hello.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Simple Comment: Hello World</title>
<meta name="viewport" content="width=device-width" />
<meta
name="description"
content="Simple Comment is a commenting platform for any website. Free, flexible, open-source, private, and scalable."
/>
<meta name="twitter:card" content="summary" />
<meta name="twitter:url" content="http://simple-comment.netlify.app" />
<meta name="twitter:title" content="Simple Comment" />
<meta
name="twitter:description"
content="Simple Comment is a free, self-hosted, open-source commenting system"
/>
<meta
name="twitter:image"
content="https://simple-comment.netlify.app/img/twitter-card-logo.png"
/>
<meta
name="twitter:image:alt"
content="Simple Comment logo: thought bubble with a slight smile"
/>
<meta name="twitter:site" content="@rendall" />
<style>
@font-face {
font-family: "Comfortaa";
font-style: normal;
font-weight: 500;
font-display: block;
src: url(./font/simple-comment.woff2) format("woff2");
}

body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
background-color: #f8fcff;
color: #33475c;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
Arial, sans-serif;
font-size: 1.125rem;
line-height: 1.61111em;
margin-bottom: 1em;
margin-top: 1em;
margin: 0 auto;
padding: 0 1rem;
}

main {
max-width: 38rem;
margin: 0 auto;
}

section {
margin-bottom: 3em;
}

section.comment-display {
padding-right: 1rem;
}

section.comment-display textarea,
section.comment-display input {
width: calc(100% - 2rem);
}

h1,
h2 {
color: #3287e6;
}

h1 {
font-family: "Comfortaa", sans-serif;
font-size: 3.4rem;
font-weight: 500;
line-height: 4rem;
margin-left: 1rem;
}

input {
height: 2rem;
width: 100%;
font-size: 1.35rem;
padding: 0.5rem;
border-radius: 0.5rem;
border: 1px solid;
font-family: monospace;
}

textarea {
display: block;
height: 7rem;
width: 100%;
border-radius: 0.5rem;
border: 1px solid;
font-size: 1.35rem;
padding: 0.5rem;
font-family: monospace;
}

button:hover {
font-weight: bold;
}

button {
appearance: none;
border: none;
background: transparent;
background-color: transparent;
cursor: pointer;
font-size: inherit;
padding: 0.5rem 1rem;
width: 7rem;
text-align: center;
border: 1px solid;
border-radius: 0.65rem;
margin: 0.5rem 1rem 0.5rem 0;
}

p {
margin-top: 0;
}

p > span {
color: #3287e6;
font-size: 1.2rem;
font-weight: bold;
}

a:hover {
color: #007b8c;
text-decoration: underline;
}

a {
color: #3287e6;
font-weight: 600;
text-decoration: none;
}

a[title] {
color: unset;
}

textarea#reply-field {
min-height: 7rem;
}

header {
display: flex;
margin: 0 auto;
max-width: 59rem;
min-height: 10rem;
align-items: center;
}

#discussion-title {
display: none;
}

#login-pulser {
display: none;
}

.is-logging-in #login-pulser {
display: inline;
}

#log-out-button {
display: none;
}

.is-logged-in:not(.is-guest) #log-out-button {
display: unset;
}

.is-logged-in #log-in-form {
display: none;
}

.is-logged-in .user-info {
display: none;
}

.is-logged-in:not(.is-guest) .sign-up-form {
display: none;
}

.is-error,
.error {
font-weight: bold;
color: red;
}

.is-reply > .comment-display .comment-button {
display: none;
}

.is-deleted {
font-style: italic;
opacity: 0.5;
}

.is-deleted > .comment-button {
display: none;
}

.simple-comment-logo {
max-width: 9.1rem;
min-width: 9.1rem;
fill: #3287e6;
}

#user-display {
display: none;
}

@media (max-width: 1024px) {
main {
margin: 0 1rem;
max-width: unset;
}
}
</style>
</head>

<body>
<header>
<svg
class="simple-comment-logo"
version="1.1"
viewBox="0 0 100 100"
alt="thought bubble with a slight smile"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="m46 85c21.5 0 39-17.5 39-39s-17.5-39-39-39-39 17.5-39 39 17.5 39 39 39zm0-72c18.2 0 33 14.8 33 33s-14.8 33-33 33-33-14.8-33-33 14.8-33 33-33z"
/>
<path
d="m85 70c-6.1 0-11 4.9-11 11s4.9 11 11 11 11-4.9 11-11-4.9-11-11-11zm0 16c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z"
/>
<path
d="m56.556 64.256c0.35703 0.5068 0.52028 1.2218 0.45101 1.9172-0.06927 0.6954-0.37105 1.3712-0.7996 1.7998-0.54481 0.54481-0.64263 0.58032-1.7353 1.024-0.68257 0.27717-1.403 0.49272-1.9625 0.65426-3.5641 1.0291-7.8801 1.2642-12.291 0.17319-3.2701-0.80885-6.2699-2.0519-9.071-4.2971-0.31699-0.25408-1.013-0.78589-1.6664-1.4256-0.86735-0.84913-1.2642-1.3872-1.4109-2.0727-0.24261-1.1338 0.06065-2.3418 1.0548-3.139 0.78048-0.62586 1.8562-0.89826 2.8498-0.55506 1.4285 0.49345 1.6014 1.456 3.6314 2.8214 2.7645 1.8595 5.852 2.8247 8.2841 3.0799 3.3325 0.34962 5.9132-0.05166 8.3445-0.99169 0.94158-0.36405 1.3842-0.59561 2.4605-0.3451 0.88913 0.20696 1.4417 0.76162 1.8607 1.3564z"
/>
</g>
</svg>

<h1>Simple Comment</h1>
</header>
<main>
<section><p>Hello world</p></section>
<section class="comment-display">
<div id="simple-comment-display"></div>
</section>
</main>
<script type="module" src="./js/hello.js" defer></script>
</body>
</html>
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.12.7",
"@netlify/functions": "^1.0.0",
"@tsconfig/svelte": "^3.0.0",
"@types/aws-lambda": "^8.10.95",
"@types/node": "^17.0.25",
"@typescript-eslint/eslint-plugin": "^5.22.0",
Expand All @@ -55,6 +56,9 @@
"mongodb": "^4.5.0",
"picomatch": "^2.3.1",
"rimraf": "^3.0.2",
"svelte": "^3.53.1",
"svelte-check": "^2.9.2",
"svelte-loader": "^3.1.4",
"ts-loader": "^9.3.0",
"ts-node": "^10.1.0",
"typescript": "^4.6.4",
Expand Down
19 changes: 19 additions & 0 deletions src/dist/hello.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
@component
Here's some documentation for this component. It will show up on hover for
JavaScript/TypeScript projects using a LSP-compatible editor such as VSCode or
Vim/Neovim with coc.nvim.

- You can use markdown here.
- You can use code blocks here.
- JSDoc/TSDoc will be respected by LSP-compatible editors.
- Indentation will be respected as much as possible.
-->

<!-- @component You can use a single line, too -->

<!-- @component But only the last documentation comment will be used -->

<main>
<h1>Hello world</h1>
</main>
32 changes: 30 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
mode: "production",
entry: {
"simple-comment": path.resolve(__dirname, "src/dist/js/simple-comment.ts"),
"hello": path.resolve(__dirname, "src/dist/hello.svelte"),
"all-comments": path.resolve(__dirname, "src/dist/js/all-comments.ts")
},
devtool: "inline-source-map",
Expand All @@ -17,10 +18,37 @@ module.exports = {
path: path.resolve(__dirname, "dist/js")
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
alias: {
svelte: path.resolve("node_modules", "svelte")
},
extensions: [".ts", ".mjs", ".js", ".svelte"],
mainFields: ["svelte", "browser", "module", "main"]
},
module: {
rules: [{ test: /\.tsx?$/, loader: "ts-loader" }]
rules: [
{ test: /\.ts$/, use: ["ts-loader"] },
{
test: /\.css$/,
use: [
{
loader: "css-loader",
options: {
url: false // necessary if you use url('/path/to/some/asset.png|jpg|gif')
}
}
]
},
{
test: /\.(html|svelte)$/,
use: "svelte-loader"
},
{
// required to prevent errors from Svelte on Webpack 5+
// q.v. https://github.com/sveltejs/template-webpack/blob/master/webpack.config.js
test: /node_modules\/svelte\/.*\.mjs$/,
resolve: { fullySpecified: false }
}
]
},
plugins: [new webpack.EnvironmentPlugin(["SIMPLE_COMMENT_API_URL"])]
}
Loading