Skip to content

Commit d10e4ca

Browse files
committed
initial commit
0 parents  commit d10e4ca

18 files changed

+5069
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.snowpack
2+
build
3+
node_modules

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# New Project
2+
3+
> ✨ Bootstrapped with Create Snowpack App (CSA).
4+
5+
## Available Scripts
6+
7+
### npm start
8+
9+
Runs the app in the development mode.
10+
Open http://localhost:8080 to view it in the browser.
11+
12+
The page will reload if you make edits.
13+
You will also see any lint errors in the console.
14+
15+
### npm run build
16+
17+
Builds a static copy of your site to the `build/` folder.
18+
Your app is ready to be deployed!
19+
20+
**For the best production performance:** Add a build bundler plugin like "@snowpack/plugin-webpack" to your `snowpack.config.mjs` config file.
21+
22+
### npm test
23+
24+
Launches the application test runner.
25+
Run with the `--watch` flag (`npm test -- --watch`) to run in interactive watch mode.

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"scripts": {
3+
"start": "snowpack dev",
4+
"build": "snowpack build",
5+
"test": "web-test-runner \"src/**/*.test.tsx\"",
6+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
7+
"lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\""
8+
},
9+
"dependencies": {
10+
"react": "^17.0.2",
11+
"react-dom": "^17.0.2"
12+
},
13+
"devDependencies": {
14+
"@snowpack/plugin-dotenv": "^2.1.0",
15+
"@snowpack/plugin-react-refresh": "^2.5.0",
16+
"@snowpack/plugin-typescript": "^1.2.1",
17+
"@snowpack/web-test-runner-plugin": "^0.2.2",
18+
"@testing-library/react": "^11.2.6",
19+
"@types/chai": "^4.2.17",
20+
"@types/mocha": "^8.2.2",
21+
"@types/react": "^17.0.4",
22+
"@types/react-dom": "^17.0.3",
23+
"@types/snowpack-env": "^2.3.3",
24+
"@web/test-runner": "^0.13.3",
25+
"chai": "^4.3.4",
26+
"prettier": "^2.2.1",
27+
"snowpack": "^3.3.7",
28+
"typescript": "^4.2.4"
29+
}
30+
}

public/favicon.ico

3.08 KB
Binary file not shown.

public/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="description" content="Web site created using create-snowpack-app" />
8+
<title>Snowpack App</title>
9+
</head>
10+
<body>
11+
<div id="root"></div>
12+
<noscript>You need to enable JavaScript to run this app.</noscript>
13+
<script type="module" src="/dist/index.js"></script>
14+
<!--
15+
This HTML file is a template.
16+
If you open it directly in the browser, you will see an empty page.
17+
18+
You can add webfonts, meta tags, or analytics to this file.
19+
The build step will place the bundled scripts into the <body> tag.
20+
21+
To begin the development, run `npm start` or `yarn start`.
22+
To create a production bundle, use `npm run build` or `yarn build`.
23+
-->
24+
</body>
25+
</html>

public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

snowpack.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/** @type {import("snowpack").SnowpackUserConfig } */
2+
export default {
3+
mount: {
4+
public: { url: '/', static: true },
5+
src: { url: '/dist' },
6+
},
7+
plugins: [
8+
'@snowpack/plugin-react-refresh',
9+
'@snowpack/plugin-dotenv',
10+
[
11+
'@snowpack/plugin-typescript',
12+
{
13+
/* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */
14+
...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),
15+
},
16+
],
17+
],
18+
routes: [
19+
/* Enable an SPA Fallback in development: */
20+
// {"match": "routes", "src": ".*", "dest": "/index.html"},
21+
],
22+
optimize: {
23+
/* Example: Bundle your final build: */
24+
// "bundle": true,
25+
},
26+
packageOptions: {
27+
/* ... */
28+
},
29+
devOptions: {
30+
/* ... */
31+
},
32+
buildOptions: {
33+
/* ... */
34+
},
35+
};

src/App.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.App {
2+
text-align: center;
3+
}
4+
.App code {
5+
background: #FFF3;
6+
padding: 4px 8px;
7+
border-radius: 4px;
8+
}
9+
.App p {
10+
margin: 0.4rem;
11+
}
12+
13+
.App-logo {
14+
height: 40vmin;
15+
pointer-events: none;
16+
}
17+
18+
@media (prefers-reduced-motion: no-preference) {
19+
.App-logo {
20+
animation: App-logo-spin infinite 20s linear;
21+
}
22+
}
23+
24+
.App-header {
25+
background-color: #282c34;
26+
min-height: 100vh;
27+
display: flex;
28+
flex-direction: column;
29+
align-items: center;
30+
justify-content: center;
31+
font-size: calc(10px + 2vmin);
32+
color: white;
33+
}
34+
35+
.App-link {
36+
color: #61dafb;
37+
}
38+
39+
@keyframes App-logo-spin {
40+
from {
41+
transform: rotate(0deg);
42+
}
43+
to {
44+
transform: rotate(360deg);
45+
}
46+
}

src/App.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as React from 'react';
2+
import { render } from '@testing-library/react';
3+
import { expect } from 'chai';
4+
import App from './App';
5+
6+
describe('<App>', () => {
7+
it('renders learn react link', () => {
8+
const { getByText } = render(<App />);
9+
const linkElement = getByText(/learn react/i);
10+
expect(document.body.contains(linkElement));
11+
});
12+
});

0 commit comments

Comments
 (0)