Include contents of the zed-server repo

We're going full monorepo.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-07-12 14:14:39 -06:00
parent 34abda3a04
commit 1537500fcb
99 changed files with 7206 additions and 75 deletions

10
script/build-css Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
set -e
cd ./script
[ -d node_modules ] || npm install
if [[ $1 == --release ]]; then
export NODE_ENV=production # Purge unused styles in --release mode
fi
npx tailwindcss build ../server/styles.css --output ../server/static/styles.css

17
script/deploy Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
# Prerequisites:
#
# - Log in to the DigitalOcean docker registry
# doctl registry login
#
# - Set the default K8s context to production
# doctl kubernetes cluster kubeconfig save zed-1
set -e
IMAGE_ID=registry.digitalocean.com/zed/zed-server
docker build . --tag $IMAGE_ID
docker push $IMAGE_ID
kubectl rollout restart deployment zed

11
script/deploy-migration Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
set -e
IMAGE_ID=registry.digitalocean.com/zed/zed-migrator
docker build . \
--file ./Dockerfile.migrator \
--tag $IMAGE_ID
docker push $IMAGE_ID
kubectl apply -f ./server/migrate.yml

2452
script/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

6
script/package.json Normal file
View file

@ -0,0 +1,6 @@
{
"devDependencies": {
"@tailwindcss/typography": "^0.4.0",
"tailwindcss-cli": "^0.1.2"
}
}

6
script/server Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
set -e
cd server
cargo run

12
script/sqlx Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
set -e
# Install sqlx-cli if needed
[[ "$(sqlx --version)" == "sqlx-cli 0.5.5" ]] || cargo install sqlx-cli --version 0.5.5
# Export contents of .env.toml
eval "$(cargo run --bin dotenv)"
# Run sqlx command
sqlx $@

44
script/tailwind.config.js Normal file
View file

@ -0,0 +1,44 @@
module.exports = {
theme: {
fontFamily: {
display: [
"Visby CF", "ui-sans-serif", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto",
"Helvetica Neue", "Arial", "Noto Sans", "sans-serif", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"
],
body: [
"Open Sans", "ui-sans-serif", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto",
"Helvetica Neue", "Arial", "Noto Sans", "sans-serif", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"
],
},
extend: {
typography: (theme) => ({
DEFAULT: {
css: {
h1: {
fontFamily: theme("fontFamily.display").join(", ")
},
h2: {
fontFamily: theme("fontFamily.display").join(", ")
},
h3: {
fontFamily: theme("fontFamily.display").join(", ")
},
h4: {
fontFamily: theme("fontFamily.display").join(", ")
}
}
}
})
}
},
variants: {
},
plugins: [
require('@tailwindcss/typography'),
],
purge: [
"../templates/**/*.hbs"
]
}