Skip to content

Commit

Permalink
fix: polish workspace settings
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Nov 14, 2023
1 parent bfb03eb commit 1f12bba
Show file tree
Hide file tree
Showing 30 changed files with 2,111 additions and 550 deletions.
7 changes: 0 additions & 7 deletions .env

This file was deleted.

19 changes: 19 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Make a local copy `.env.example` as `.env` in your project root
# This will have environment variables for production environment
# Use .env.local to override environment variables in `.env` (like API keys)

## dynamic public
PUBLIC_BASE_URL=https://spectacular-console.vercel.app
PUBLIC_DEFAULT_ORGANIZATION=chinthagunta
PUBLIC_GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql

PUBLIC_NHOST_SUBDOMAIN=local
PUBLIC_NHOST_REGION=

## dynamic private
HASURA_GRAPHQL_ADMIN_SECRET=nhost-admin-secret

## static public

## static private

5 changes: 2 additions & 3 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Hasura
# HASURA_GRAPHQL_ENDPOINT=https://twirbianfvhmxhqfjtvi.hasura.us-east-1.nhost.run
# HASURA_GRAPHQL_ADMIN_SECRET=8bb4e5a897d29a9821348e19546152ec
PUBLIC_GRAPHQL_ENDPOINT=https://bggkthwysdvphygfecpa.hasura.us-east-1.nhost.run
HASURA_GRAPHQL_ADMIN_SECRET=
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ pids
!.env.local.example
!.env.production.example
!.env.test.example
# TODO: Remove me after https://github.com/sveltejs/kit/pull/5663
!.env
!.env.test

# turborepo #
##########################
Expand Down
7 changes: 4 additions & 3 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* jshint esversion: 9 */

module.exports = {
'*.{js,ts,json,svelte}': ['pnpm run format', 'git add'],
'./src/**/*.{svelte,ts}': ['pnpm run format', 'git add', 'pnpm run lint:fix'],
'./.{ts,cjs,js}': ['pnpm run lint:fix']
'*': ['cspell --no-must-find-files', 'prettier --ignore-unknown --write'],
'*.{js,cjs,mjs,jsx,ts,tsx}': ['eslint --fix'],
'*.svelte': ['markuplint', 'eslint --fix'],
'*.html': ['markuplint']
};
41 changes: 41 additions & 0 deletions .markuplintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
parser: {
'\\.svelte$': '@markuplint/svelte-parser'
},
extends: ['markuplint:recommended'],
excludeFiles: [
// TODO: Once the overrides option is fixed, remove these lines
// ref: https://github.com/markuplint/markuplint/issues/1119
'./apps/web/src/app.html',
'./apps/web/src/routes/CommentForm.svelte'
],
rules: {
'character-reference': false,
'ineffective-attr': false,
'label-has-control': false,
'require-accessible-name': false
},
nodeRules: [
// For Svelte
{
selector: 'textarea',
rules: {
'invalid-attr': {
options: {
allowAttrs: ['value']
}
}
}
},
{
selector: 'input[type="file"]',
rules: {
'invalid-attr': {
options: {
allowAttrs: ['files']
}
}
}
}
]
};
19 changes: 15 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ src/lib/models/types/**
.idea
dev-dist

## custom
/infra/helm/templates/deployment.yaml
infra/helm/templates/ingress.yaml
schema.graphql
$houdini
infra/hasura
*.min.css
**/*.min.css

**/.turbo
/.nhost/
/nhost/*
!/nhost/emails/
/apps/story/storybook-static/
/apps/*/.svelte-kit
/apps/*/$houdini/
/apps/*/schema.graphql

# generated files by typesafe-i18n
src/lib/i18n
/apps/**/lib/i18n


18 changes: 18 additions & 0 deletions .prettierignore.root
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
pnpm-workspace.yaml
package-lock.json
yarn.lock

# custom
/apps/
/packages/
4 changes: 2 additions & 2 deletions .secrets.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ AUTH_PROVIDER_GITHUB_CLIENT_SECRET = 'FIXME'

# SMTP
AUTH_SMTP_HOST = 'FIXME'
AUTH_SMTP_PORT = 587
AUTH_SMTP_PORT = '587'
AUTH_SMTP_AUTH_METHOD = 'LOGIN'
AUTH_SMTP_SECURE = false
AUTH_SMTP_SECURE = 'false'
AUTH_SMTP_USER = 'FIXME'
AUTH_SMTP_PASS = 'FIXME'
AUTH_SMTP_SENDER = 'sumodemo123@gmail.com'
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"hediet.vscode-drawio",
"mikestead.dotenv",
"vivaxy.vscode-conventional-commits",
"bierner.markdown-mermaid",
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
// GolLang
"golang.go",
"paulvarache.vscode-taskfile",
Expand Down
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"editor.lineHeight": 2,
"editor.codeActionsOnSave": {
// "source.organizeImports": true,
"source.fixAll": true
"source.fixAll.eslint": true
// "source.fixAll": true
},
"editor.cursorBlinking": "solid",
"editor.cursorSmoothCaretAnimation": "on",
Expand Down Expand Up @@ -164,7 +165,14 @@
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock",
"package/**"
"/apps/web/schema.graphql",
"package/**",
"*.svg",
"/.vscode/",
"/nhost/",
"/apps/story/storybook-static/",
"/apps/web/$houdini/",
"/apps/web/schema.graphql"
],
"cSpell.dictionaries": ["html", "typescript", "softwareTerms", "companies"],
////////// svelte //////////
Expand Down Expand Up @@ -207,6 +215,7 @@
"yaml",
"mdx"
],
"eslint.workingDirectories": [{ "mode": "auto" }],
"eslint.validate": ["javascript", "javascriptreact", "svelte"],

////////// Proto //////////
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"@tailwindcss/typography": "0.5.10",
"@types/lodash-es": "4.17.11",
"@types/node": "20.9.0",
"@typescript-eslint/eslint-plugin": "6.10.0",
"@typescript-eslint/parser": "6.10.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@vercel/analytics": "1.1.1",
"@vite-pwa/sveltekit": "0.2.7",
"@vite-pwa/sveltekit": "0.2.8",
"@vitest/coverage-v8": "0.34.6",
"autoprefixer": "10.4.16",
"eslint": "8.53.0",
Expand All @@ -63,7 +63,7 @@
"postcss-import": "15.1.0",
"postcss-load-config": "4.0.1",
"postcss-nested": "6.0.1",
"prettier": "3.0.3",
"prettier": "3.1.0",
"prettier-plugin-svelte": "3.1.0",
"prettier-plugin-tailwindcss": "0.5.7",
"rehype-autolink-headings": "7.1.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/nhapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"eslint-config-prettier": "9.0.0",
"eslint-plugin-svelte": "2.35.0",
"postcss": "8.4.31",
"prettier": "3.0.3",
"prettier": "3.1.0",
"prettier-plugin-svelte": "3.1.0",
"svelte": "5.0.0-next.1",
"svelte": "4.2.3",
"svelte-check": "3.6.0",
"tailwindcss": "3.3.5",
"typescript": "5.2.2",
Expand Down
6 changes: 3 additions & 3 deletions apps/offline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"@types/node": "20.9.0",
"@typescript-eslint/eslint-plugin": "6.10.0",
"@typescript-eslint/parser": "6.10.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@vercel/analytics": "1.1.1",
"@vitest/coverage-v8": "0.34.6",
"autoprefixer": "10.4.16",
Expand All @@ -42,7 +42,7 @@
"helpers": "workspace:*",
"highlight.js": "11.9.0",
"postcss": "8.4.31",
"prettier": "3.0.3",
"prettier": "3.1.0",
"prettier-plugin-svelte": "3.1.0",
"prettier-plugin-tailwindcss": "0.5.7",
"svelte": "4.2.3",
Expand Down
6 changes: 3 additions & 3 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"@types/node": "20.9.0",
"@typescript-eslint/eslint-plugin": "6.10.0",
"@typescript-eslint/parser": "6.10.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@vercel/analytics": "1.1.1",
"@vitest/coverage-v8": "0.34.6",
"autoprefixer": "10.4.16",
Expand All @@ -46,7 +46,7 @@
"helpers": "workspace:*",
"highlight.js": "11.9.0",
"postcss": "8.4.31",
"prettier": "3.0.3",
"prettier": "3.1.0",
"prettier-plugin-svelte": "3.1.0",
"prettier-plugin-tailwindcss": "0.5.7",
"svelte": "4.2.3",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/houdini.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const config = {
interval: 0, // only pull the schema when you first run `turbo dev`
// HINT: we need to generate scheam for highest role level that app support.
headers: {
'x-hasura-admin-secret': 'env:HASURA_GRAPHQL_ADMIN_SECRET',
'X-Hasura-Admin-Secret': (env) => env.HASURA_GRAPHQL_ADMIN_SECRET,
'x-hasura-allowed-roles': 'user manager',
'x-hasura-role': 'manager'
}
Expand All @@ -28,6 +28,7 @@ const config = {
}
},
scalars: {
// ref: https://www.houdinigraphql.com/api/config#custom-scalars
DateTime: {
// the corresponding typescript type
type: 'Date',
Expand Down
25 changes: 17 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@
"test:integration": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --ignore-path=../../.prettierignore . && eslint .",
"format": "prettier --write --ignore-path=../../.prettierignore ."
"lint:markup": "markuplint --config ../../.markuplintrc.cjs \"**\"",
"lint:js": "eslint .",
"lint:cspell": "cspell \"**\"",
"lint:prettier": "prettier --check --ignore-path=../../.prettierignore .",
"lint": "concurrently pnpm:lint:*",
"format:js": "eslint --fix .",
"format:prettier": "prettier --write --ignore-path=../../.prettierignore .",
"format": "concurrently pnpm:format:*",
"generate:svelte": "svelte-kit sync",
"generate:pull-schema": "houdini pull-schema",
"generate": "concurrently pnpm:generate:*"
},
"devDependencies": {
"@auth/core": "0.18.1",
Expand All @@ -39,10 +48,10 @@
"@testing-library/svelte": "4.0.5",
"@types/gtag.js": "0.0.18",
"@types/js-cookie": "3.0.6",
"@typescript-eslint/eslint-plugin": "6.10.0",
"@typescript-eslint/parser": "6.10.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@vercel/analytics": "1.1.1",
"@vite-pwa/sveltekit": "0.2.7",
"@vite-pwa/sveltekit": "0.2.8",
"@vitest/coverage-v8": "0.34.6",
"autoprefixer": "10.4.16",
"c8": "8.0.1",
Expand All @@ -68,10 +77,10 @@
"js-cookie": "3.0.5",
"jsdom": "22.1.0",
"layercake": "8.0.2",
"msw": "2.0.5",
"msw": "2.0.6",
"postcss": "8.4.31",
"postcss-preset-env": "9.3.0",
"prettier": "3.0.3",
"prettier": "3.1.0",
"prettier-plugin-svelte": "3.1.0",
"prettier-plugin-tailwindcss": "0.5.7",
"svelte": "4.2.3",
Expand All @@ -81,7 +90,7 @@
"svelte-meta-tags": "3.1.0",
"svelte-select": "5.7.0",
"svelte-time-distance": "0.0.3",
"sveltekit-flash-message": "2.2.1",
"sveltekit-flash-message": "2.2.2",
"sveltekit-rate-limiter": "0.4.1",
"sveltekit-superforms": "1.10.1",
"sveltekit-view-transition": "0.5.2",
Expand Down
9 changes: 9 additions & 0 deletions apps/web/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
"extends": ["//"],
"pipeline": {
"build": {
"dependsOn": ["generate"],
"outputs": [".svelte-kit/**", ".vercel/**", "$houdini/**", "schema.graphql"],
"env": ["VERCEL", "VERCEL_URL", "VERCEL_ENV", "npm_package_version"]
},
"generate": {
"outputs": [".svelte-kit/**", "schema.graphql"]
},
"lint": {
"dependsOn": ["generate"],
"outputs": []
},
"preview": {},
"special-task": {}
}
Expand Down
3 changes: 3 additions & 0 deletions cog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ script = """#!/bin/sh
set -e
pnpm run format
# npx lint-staged --concurrent false
# npm test
cog verify -i --file $1
"""

Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 3
endpoint: HASURA_GRAPHQL_ENDPOINT
endpoint: PUBLIC_GRAPHQL_ENDPOINT
admin_secret: HASURA_GRAPHQL_ADMIN_SECRET
metadata_directory: infra/hasura/metadata
migrations_directory: infra/hasura/migrations
Expand Down
1 change: 1 addition & 0 deletions docs/awesome-sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Awesome **SvelteKit** Links

## Project Templates

- [usagizmo's webapp-template](https://github.com/usagizmo/webapp-template) - SvelteKit (w/ Houdini) x Tailwind CSS x Storybook x Nhost x Turborepo (pnpm)
- [Backoffice template with ShadCN-Svelte, Auth, localization](https://github.com/upperdo/backoffice-template)
- [Svelte Sirens](https://github.com/Svelte-Sirens/svelte-sirens)
- [Usagizmo turbo Monorepo](https://github.com/usagizmo/webapp-template)
Expand Down
Loading

0 comments on commit 1f12bba

Please sign in to comment.