This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
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 96b8dbf
Showing
16 changed files
with
5,105 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 @@ | ||
.envrc |
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,13 @@ | ||
# Deno + Apollo Client + Snowpack | ||
|
||
This project uses snowpack.dev to make the `@apollo/client` node module useful in a Deno app. Snowpack turns most npm modules into ES modules you can import directly. | ||
|
||
The npm cruft exists only in the `/deps/` directory. Snowpack installs everything to `/deps/web_modules`, which is symlinked back to the root dir. This allows the Deno app to just `import` directly from `./web_modules/@apollo/client.js` and do useful things. | ||
|
||
You can make Snowpack install other npms by adding them to `knownEntrypoints` in `/deps/snowpack.config.json`. | ||
|
||
## Run it | ||
|
||
1. `flyctl auth token`, put it in an env var named `FLY_AUTH_TOKEN` | ||
2. `cd deps; yarn install; snowpack install; cd ..` | ||
3. `deno --allow-env --allow-net server.tst` |
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 | ||
build | ||
web_modules | ||
node_modules |
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,18 @@ | ||
{ | ||
"scripts": { | ||
"prepare": "snowpack", | ||
"start": "snowpack dev", | ||
"build": "snowpack build", | ||
"test": "echo \"This template does not include a test runner by default.\" && exit 1" | ||
}, | ||
"webDependencies": { | ||
"canvas-confetti": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"snowpack": "^2.0.0-0" | ||
}, | ||
"dependencies": { | ||
"@apollo/client": "^3.0.0-beta.44", | ||
"graphql": "^15.0.0" | ||
} | ||
} |
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,14 @@ | ||
#img { | ||
display: block; | ||
margin: auto; | ||
height: 128px; | ||
width: 128px; | ||
padding: 2rem; | ||
} | ||
|
||
#canvas { | ||
display: block; | ||
margin: 2rem auto; | ||
width: 540px; | ||
height: 540px; | ||
} |
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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="description" content="Web site created using create-snowpack-app" /> | ||
<link rel="stylesheet" type="text/css" href="/index.css" /> | ||
<title>Snowpack App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<img id="img" src="/logo.svg" /> | ||
<canvas id="canvas"></canvas> | ||
<script type="module" src="/_dist_/index.js"></script> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
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,12 @@ | ||
{ | ||
"scripts": { | ||
"mount:public": "mount public --to .", | ||
"mount:web_modules": "mount web_modules", | ||
"mount:src": "mount src --to _dist_" | ||
}, | ||
"installOptions": {}, | ||
"devOptions": {}, | ||
"knownEntrypoints": [ | ||
"@apollo/client" | ||
] | ||
} |
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 @@ | ||
{ | ||
"imports": { | ||
"canvas-confetti": "https://cdn.pika.dev/pin/canvas-confetti@v1.2.0-kzcveexqNXJywloAjiQb/canvas-confetti.js" | ||
} | ||
} |
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,11 @@ | ||
/** | ||
* This file is just a silly example to show everything working in the browser. | ||
* When you're ready to start on your site, clear the file. Happy hacking! | ||
**/ | ||
|
||
import confetti from "canvas-confetti"; | ||
|
||
confetti.create(document.getElementById("canvas"), { | ||
resize: true, | ||
useWorker: true, | ||
})({ particleCount: 200, spread: 200 }); |
Oops, something went wrong.