-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 572532d
Showing
26 changed files
with
11,553 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Add enviroment vars for dev mode here: | ||
# | ||
# FOO=1 | ||
# | ||
# To expose variable to frontend, prefix them with SNOWPACK_PUBLIC_* | ||
# They are accessible via `import.meta.SNOWPACK_PUBLIC_FOO`. | ||
# | ||
# Example: | ||
# | ||
# SNOWPACK_PUBLIC_FOO=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
env: | ||
browser: true | ||
es6: true | ||
node: true | ||
jest/globals: true | ||
plugins: | ||
- jest | ||
- svelte3 | ||
ignorePatterns: | ||
- node_modules | ||
- public | ||
- build | ||
extends: eslint:recommended | ||
globals: | ||
Atomics: readonly | ||
SharedArrayBuffer: readonly | ||
parserOptions: | ||
ecmaVersion: 2020 | ||
sourceType: module | ||
overrides: | ||
- files: "*.svelte" | ||
processor: svelte3/svelte3 | ||
rules: | ||
indent: | ||
- error | ||
- tab | ||
quotes: | ||
- error | ||
- single | ||
semi: | ||
- error | ||
- never | ||
linebreak-style: | ||
- error | ||
- unix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build and deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: Build | ||
run: | | ||
yarn install --frozen-lockfile | ||
yarn build | ||
cd build | ||
touch .nojekyll | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: build | ||
single-commit: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build | ||
node_modules | ||
|
||
*.sublime-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn format:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
useTabs: true | ||
semi: false | ||
singleQuote: true | ||
bracketSameLine: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Mandelbrot set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
...require('@snowpack/app-scripts-svelte/jest.config.js')(), | ||
} | ||
|
||
config.testMatch.push('<rootDir>/test/**/*.{spec,test}.{js,jsx,ts,tsx}') | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// jest-dom adds custom jest matchers for asserting on DOM nodes. | ||
// allows you to do things like: | ||
// expect(element).toHaveTextContent(/react/i) | ||
// learn more: https://github.com/testing-library/jest-dom | ||
import '@testing-library/jest-dom/extend-expect' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"src/*": ["./src/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": | ||
[ | ||
{ | ||
"path": "." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"public": false, | ||
"scripts": { | ||
"dev": "snowpack dev", | ||
"build": "snowpack build", | ||
"test": "jest", | ||
"prepare": "husky install .husky", | ||
"format": "redrun format:eslint format:prettier", | ||
"format:eslint": "eslint --fix --ext .js --ext .mjs --ext .svelte .", | ||
"format:prettier": "prettier --write --plugin-search-dir=. './**/*.{js,mjs,svelte}'", | ||
"format:check": "redrun format:check:eslint format:check:prettier", | ||
"format:check:eslint": "eslint --ext .js --ext .svelte .", | ||
"format:check:prettier": "prettier --check --plugin-search-dir=. './**/*.{js,mjs,svelte}'" | ||
}, | ||
"devDependencies": { | ||
"@snowpack/app-scripts-svelte": "^2.0.1", | ||
"@snowpack/plugin-dotenv": "^2.2.0", | ||
"@snowpack/plugin-postcss": "^1.4.3", | ||
"@snowpack/plugin-run-script": "^2.3.0", | ||
"@snowpack/plugin-svelte": "^3.7.0", | ||
"@testing-library/jest-dom": "^5.16.1", | ||
"@testing-library/svelte": "^3.0.3", | ||
"autoprefixer": "^10.4.2", | ||
"cssnano": "^5.0.16", | ||
"eslint": "^8.8.0", | ||
"eslint-plugin-jest": "^26.0.0", | ||
"eslint-plugin-svelte3": "^3.4.0", | ||
"husky": "^7.0.4", | ||
"jest": "^26.4.7", | ||
"postcss": "^8.4.5", | ||
"postcss-cli": "^9.1.0", | ||
"prettier": "^2.5.1", | ||
"prettier-plugin-svelte": "^2.6.0", | ||
"redrun": "^9.0.1", | ||
"snowpack": "^3.8.8", | ||
"snowpack-plugin-rollup-bundle": "^0.4.4", | ||
"svelte": "^3.46.3", | ||
"svelte-check": "^2.3.0", | ||
"tailwindcss": "^3.0.18" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const tailwind = require('tailwindcss') | ||
const autoprefixer = require('autoprefixer') | ||
const cssnano = require('cssnano') | ||
|
||
const plugins = | ||
process.env.NODE_ENV === 'production' | ||
? [tailwind, autoprefixer, cssnano] | ||
: [tailwind, autoprefixer] | ||
|
||
module.exports = { plugins } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* place global styles here */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<title>Mandelbrot</title> | ||
<meta name="description" content="Mandelbrot set with canvas" /> | ||
|
||
<link rel="icon" href="favicon.ico" /> | ||
<link rel="stylesheet" type="text/css" href="global.css"> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<script type="module" src="dist/index.js"></script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** @type {import("snowpack").SnowpackUserConfig } */ | ||
export default { | ||
alias: { | ||
src: './src', | ||
}, | ||
mount: { | ||
public: { | ||
url: '/', | ||
static: true, | ||
resolve: false, | ||
}, | ||
src: '/dist', | ||
}, | ||
plugins: [ | ||
'@snowpack/plugin-svelte', | ||
'@snowpack/plugin-postcss', | ||
'@snowpack/plugin-dotenv', | ||
], | ||
routes: [ | ||
/* Enable an SPA Fallback in development: */ | ||
// { match: 'routes', src: '.*', dest: '/index.html' }, | ||
], | ||
optimize: { | ||
// bundle: true, | ||
minify: true, | ||
sourcemap: false, | ||
}, | ||
devOptions: { | ||
open: 'none', | ||
}, | ||
buildOptions: { | ||
htmlFragments: true, | ||
// baseUrl: '/', | ||
metaUrlPath: 'snowpack', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
</script> | ||
|
||
<canvas></canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'src/tailwind.svelte' | ||
import App from 'src/components/App.svelte' | ||
|
||
const app = new App({ | ||
target: document.body, | ||
}) | ||
|
||
export default app | ||
|
||
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR. | ||
// Learn more: https://www.snowpack.dev/#hot-module-replacement | ||
if (import.meta.hot) { | ||
import.meta.hot.accept() | ||
import.meta.hot.dispose(() => { | ||
app.$destroy() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<style global> | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
content: ['./src/**/*.svelte', './public/*.html'], | ||
theme: { | ||
extend: {}, | ||
}, | ||
variants: {}, | ||
plugins: [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { render } from '@testing-library/svelte' | ||
import App from '../src/components/App' | ||
|
||
test('renders learn svelte link', () => { | ||
const { getByText } = render(App) | ||
const linkElement = getByText(/learn svelte/i) | ||
expect(linkElement).toBeInTheDocument() | ||
}) |
Oops, something went wrong.