Skip to content

Commit

Permalink
Svelte 5 (#87)
Browse files Browse the repository at this point in the history
* remove scripts

* init svelte 5 with tailwind

* migrations

* fix: dont try to send event if dev

* update readme

* svelte 5

* cleanup

* header component

* refactor

* svelte 5 api

* start of rewrite

* update

* updates

* updates

* fixes

* comment

* fixes

* updates

* updates

* fix

* updates

* updates

* updates

* updates

* reorganize

* updates

* updates

* updates

* updates

* fixes

* updates

* fix

* updates

* format

* updates

* fixes

* updates

* updates

* shiki

* updates

* fixes

* comments

* fix

* updates

* updates

* remove fn

* updates

* fixes

* fixes

* updates

* reorganize

* use alias

* format

* fix

* upgrade deps

* fixes

* fixes

* updates

* fix: transition duration

* fixes

* updates

* updates

* fix

* fixes

* fixes

* fixes

* fixes

* updates

* updates

* fixes

* updates

* updates

* updates

* updates

* fix

* ui fix

* updates

* fixes

* ui fixes

* updates

* updates

* updates

* ui updates

* format app.css

* updates

* fix

* updates

* reorder

* format

* updates

* updates

* updates

* bump version

* fix

* updates

* add prettier

* eslint

* fixes

* update redirect_uri

* format

* fixes

* add test script
  • Loading branch information
rohanharikr authored Dec 4, 2024
1 parent cd5dfbc commit f884cfd
Show file tree
Hide file tree
Showing 54 changed files with 4,999 additions and 7,732 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

15 changes: 0 additions & 15 deletions .eslintrc.cjs

This file was deleted.

105 changes: 6 additions & 99 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,107 +4,16 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-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/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# 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 variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
node_modules
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

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

dist-ssr
*.local
.vscode

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
Expand All @@ -113,5 +22,3 @@ dist
*.njsproj
*.sln
*.sw?

S3
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

17 changes: 16 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,20 @@
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"printWidth": 100,
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte",
"plugins": ["prettier-plugin-svelte"]
}
},
{
"files": "content/**/*.{css,html,js,svelte}",
"options": {
"requirePragma": true
}
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ This repo contains the source code powering [https://playground.hello.dev/](http
### Running docs locally

1. `npm run dev` to start the hot-reloading development server (powered by [Vite](https://vitejs.dev/))
1. `open http://localhost:3000` to open the site in your favorite browser
1. `open http://localhost:5173` to open the site in your favorite browser

## License

[MIT](LICENSE)
[MIT](LICENSE)
4 changes: 0 additions & 4 deletions docs/.gitignore

This file was deleted.

63 changes: 63 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

/** @type {import('eslint').Linter.Config[]} */
export default [
js.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
__NAME__: 'readonly',
__VERSION__: 'readonly',
__GITHUBURL__: 'readonly',
__SVELTEVERSION__: 'readonly',
__VITEVERSION__: 'readonly',
__TAILWINDCSSVERSION__: 'readonly'
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
svelteFeatures: {
experimentalGenerics: true
}
}
}
},
{
ignores: [
'.vercel/',
'src/routes/utils/highlight/',
'build/',
'.svelte-kit/',
'dist/',
'test-results/',
'*.md',
'src/**/*/Setup.svelte'
]
},
{
rules: {
// Note: you must disable the base rule as it can report incorrect errors
// "no-unused-vars": "off",
'svelte/no-at-html-tags': 'off',
'no-unused-vars': [
'error',
{
varsIgnorePattern: '^_$', // Ignore variables named '_'
argsIgnorePattern: '^_$', // Ignore function arguments named '_'
caughtErrors: 'none' // Ignore unused variables in catch clauses
}
]
}
}
];
43 changes: 17 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -12,16 +12,14 @@
rel="stylesheet"
href="https://unpkg.com/[email protected]/themes/prism-duotone-dark.css"
/>
<script src="https://cdn.hello.coop/js/hello-dev-wc-footer.js" defer=""></script>

<script src="https://cdn.hello.coop/js/hello-dev-wc-footer.js" defer></script>
<style type="text/css">
html,
body {
min-width: 320px;
overflow-x: auto;
overflow-y: auto;
}

.spinner {
position: absolute;
left: 50%;
Expand All @@ -35,13 +33,11 @@
border-style: solid;
border-radius: 100%;
}

#spinner {
height: 3.2rem;
width: 3.2rem;
animation: rotation 1s linear infinite;
}

@keyframes rotation {
from {
transform: rotate(0deg);
Expand All @@ -51,30 +47,25 @@
transform: rotate(360deg);
}
}

@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
}

body {
color: #d4d4d4;
background: #151515;
}

.spinner {
border-color: rgba(116, 116, 116, 0.3);
border-top-color: rgb(116, 116, 116);
}
}

@media (prefers-color-scheme: light) {
body {
color: #303030;
background: white;
color-scheme: light;
}

.spinner {
border-color: rgba(75, 75, 75, 0.3);
border-top-color: rgb(75, 75, 75);
Expand All @@ -85,21 +76,21 @@

<body>
<div id="load-spinner" class="spinner"></div>
<div id="app" class="h-full flex-col" style="display: none"></div>
<div id="app" class="h-full flex flex-col"></div>
<script type="module" src="/src/main.js"></script>
<script>
/**
* If browser back button was used, flush cache
* This ensures that user will always see an accurate, up-to-date view based on their state
* https://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked
*/
(function () {
window.onpageshow = function (event) {
if (event.persisted) {
window.location.reload();
}
};
})();
</script>
</body>
<script>
/**
* If browser back button was used, flush cache
* This ensures that user will always see an accurate, up-to-date view based on their state
* https://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked
*/
(function () {
window.onpageshow = function (event) {
if (event.persisted) {
window.location.reload();
}
};
})();
</script>
</html>
Loading

0 comments on commit f884cfd

Please sign in to comment.