Skip to content

Commit

Permalink
Add basic web UI
Browse files Browse the repository at this point in the history
Note: this is based on CMSaasStarter project, which is available as MIT here https://github.com/CriticalMoments/CMSaasStarter. However, this copy is NOT being released open source/MIT.

The CM logo is owned by Chesterfield Labs, and it's inclusion here isn't giving away any rights.
  • Loading branch information
scosman committed Aug 6, 2024
1 parent 745517e commit 0387f8d
Show file tree
Hide file tree
Showing 28 changed files with 6,057 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/web_format_lint_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Format Check

on: [push, pull_request]

jobs:
webui_checks:
name: Code Format, Lint, Typecheck, Test, and Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5

- name: Move to web_ui folder
run: cd studio/web_ui

- name: NPM install
run: npm install

- name: Check Code Format
run: npm run format_check

- name: Linting
run: npm run lint

- name: Typechecking
run: npm run check

- name: Tests
run: npm run test_run

- name: SvelteKit Build
run: npm run build
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"editor.formatOnSave": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff"
},
"eslint.validate": ["javascript", "javascriptreact", "svelte"],
// Svelte, JS, TS files
"[javascript, typescript, svelte, json]": {
"editor.defaultFormatter": "svelte.svelte-vscode",
}
}
13 changes: 13 additions & 0 deletions studio/web_ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
41 changes: 41 additions & 0 deletions studio/web_ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: {
// Specify a parser for each lang.
ts: "@typescript-eslint/parser",
js: "espree",
typescript: "@typescript-eslint/parser",
},
},
},
],
env: {
browser: true,
es2017: true,
node: true,
},
rules: {
"no-undef": "off",
// no-undef has been turned off because of this:
// basically, it causes issues and TS does those checks so it's redundant
// https://typescript-eslint.io/linting/troubleshooting#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
},
}
10 changes: 10 additions & 0 deletions studio/web_ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
2 changes: 2 additions & 0 deletions studio/web_ui/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
resolution-mode=highest
6 changes: 6 additions & 0 deletions studio/web_ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/.svelte-kit/
**/node_modules/
**/package-lock.json

# Don't format plaintext email templates, the new lines are important
src/lib/emails/*_text.svelte
7 changes: 7 additions & 0 deletions studio/web_ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": ["prettier-plugin-svelte"],
"useTabs": false,
"tabWidth": 2,
"semi": false,
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
Loading

0 comments on commit 0387f8d

Please sign in to comment.