You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
<h1align="center">🌐 Sapper with PostCSS project base</h1>
2
2
3
3
## ❓ What is this?
4
4
The site that builds from this repository can be found [here](https://fir-sapper-tailwindcss.web.app/).
5
5
6
6
This is an extremely opinionated Sapper project base intended for my own use. That being said, there is quite a bit of work put into it to make it generalized and adaptable to your own setup, given that you want to use *most* of these things. The lower something is on this list, the easier it is to reconfigure or remove:
7
-
*[Sapper for Svelte](https://sapper.svelte.dev/)
8
-
*[Official VS Code Plugin (beta)](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode)
9
-
*[Type Checker VS Code Plugin](https://marketplace.visualstudio.com/items?itemName=halfnelson.svelte-type-checker-vscode)
10
-
*[Firebase](https://firebase.google.com/)
11
-
*[Functions](https://firebase.google.com/docs/functions/) for Server Side Rendering (SSR)
Click the `Use this template` button on [this project's GitHub page](https://github.com/babichjacob/sapper-firebase-typescript-graphql-tailwindcss-actions-template).
38
42
43
+
Click the `Use this template` button on [this project's GitHub page](https://github.com/babichjacob/sapper-firebase-typescript-graphql-tailwindcss-actions-template).
39
44
40
45
### ⬇️ Install Dependencies
41
46
Both the project root's dependencies,
42
47
```sh
43
48
cd sapper-firebase-typescript-graphql-tailwindcss-actions-template
44
-
npm install
49
+
npm install# pnpm also works
45
50
```
46
51
and the Firebase functions' dependencies (for deploying outside of GitHub Actions) need to be installed.
47
52
```sh
48
53
cd functions
49
54
npm install
50
55
```
51
56
57
+
52
58
## 🛠 Usage
53
-
### 🔄 Development
59
+
60
+
### 🧪 Development
61
+
54
62
```sh
55
63
npm run dev
56
64
```
@@ -61,7 +69,17 @@ This will create a production build for you before deploying.
61
69
npm run deploy
62
70
```
63
71
72
+
If you do not need to include heavy Babel transforms and polyfills to support old browsers on your site, then remove the `--legacy` flag in the `build` package script to lighten it up.
73
+
74
+
### 🔨 Testing Production Builds Locally
75
+
This probably pairs well with [Firebase Emulators](https://firebase.google.com/docs/rules/emulator-setup).
76
+
```sh
77
+
npm run prod
78
+
npm run start
79
+
```
80
+
64
81
## ⚙ Configuration
82
+
65
83
### 🔥 Firebase and 🐙 GitHub Actions
66
84
The least you should need to do to get started is to edit `.firebaserc`, changing the project ID to *your* project (initialized in the [Firebase console](https://console.firebase.google.com/)) ID.
67
85
@@ -73,19 +91,38 @@ Then, go to your repository's Settings > Secrets. Copy the result of the command
73
91
74
92
You can test if it's working by making a commit to `master` and checking the Actions tab of your repository to see if your project successfully builds and deploys to Firebase.
75
93
94
+
### ⚡ Web app
95
+
Many of the fields in `static/manifest.json` (`short_name`, `name`, `description`, `categories`, `theme_color`, and `background_color`) are filled with demonstrative values that won't match your site. Similarly, you've got to take new screenshots to replace the included `static/screenshot-1.png` and `static/screenshot-2.png` files. Once you change `theme_color`, update the `meta name="theme-color"` tag in `src/template.html` to match.
96
+
97
+
The [Apple touch icon](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html), favicon, and `logo-` files (also all in the `static` directory) are created by placing the logo within a "safe area" centered circle that takes up 80% of the canvas's dimension. For instance, the constraining circle in `logo-512.png` is 512 × 0.80 = 409.6 ≈ 410 pixels wide and tall.
98
+
76
99
### 🕸️ TypeGraphQL
77
100
Edit the `namedExports` in `rollup.config.js` for `"type-graphql"`[when you need to import something from the library](https://github.com/MichalLytek/type-graphql/issues/378).
78
101
102
+
### 🗺 Source maps
103
+
This project base comes with [source maps](https://blog.teamtreehouse.com/introduction-source-maps) enabled during development and disabled during production for the best compromise between performance and developer experience. You can change this behavior through the `sourcemap` variable in `rollup.config.js`.
104
+
105
+
### 💨 Optionally removing Tailwind CSS
106
+
107
+
1. Remove all Tailwind imports in the `src/global.pcss` file
108
+
2. Remove the `require("tailwindcss")("./tailwind.config.js"),` line in `postcss.config.js`
109
+
3. Delete the `tailwind.config.js` file
110
+
4. Uninstall the `tailwindcss` package
111
+
79
112
## 😵 Help! I have a question
80
-
[Create an issue](https://github.com/babichjacob/sapper-firebase-typescript-graphql-tailwindcss-actions-template/issues/new) and I'll try to help.
113
+
114
+
[Create an issue](https://github.com/babichjacob/sapper-typescript-graphql-template/issues/new) and I'll try to help.
81
115
82
116
## 😡 Fix! There is something that needs improvement
83
-
[Create an issue](https://github.com/babichjacob/sapper-firebase-typescript-graphql-tailwindcss-actions-template/issues/new) or [pull request](https://github.com/babichjacob/sapper-firebase-typescript-graphql-tailwindcss-actions-template/pulls) and I'll try to fix.
117
+
118
+
[Create an issue](https://github.com/babichjacob/sapper-typescript-graphql-template/issues/new) or [pull request](https://github.com/babichjacob/sapper-typescript-graphql-template/pulls) and I'll try to fix.
84
119
85
120
I'm sorry, because of my skill level and the fragility of (the combination of) some of these tools, there are likely to be problems in this project. Thank you for bringing them to my attention or fixing them for me.
86
121
87
122
## 📄 License
123
+
88
124
MIT
89
125
90
-
***
126
+
---
127
+
91
128
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
0 commit comments