Skip to content

Commit

Permalink
Svelte (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Jun 9, 2024
1 parent 99938d6 commit 0a13988
Show file tree
Hide file tree
Showing 33 changed files with 6,497 additions and 171 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: test
on:
push:
branches-ignore: ['main']

jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4

- name: node 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: build
run: |
npm ci && npm run build
- name: check
run: |
npm run check
- name: lint
run: |
npm run lint
- name: Approve PR
if: github.actor == 'renovate[bot]'
run: gh pr review ${{ github.event.pull_request.number }} --approve
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge PR
if: github.actor == 'renovate[bot]'
run: gh pr merge ${{ github.event.pull_request.number }} --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to Pages

on:
push:
branches: ['main']
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build
run: |
npm ci
npm run build
touch ./build/.nojekyll && echo 'metrics.bmlt.app' > ./build/CNAME
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*


# Local .terraform directories
**/.terraform/*

Expand All @@ -9,8 +21,8 @@
crash.log

# Exclude all .tfvars files, which are likely to contain sentitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
#
*.tfvars
Expand All @@ -36,4 +48,4 @@ terraform.rc
*.zip
venv/

.vscode
.vscode
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.14.0
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
renovate.json
yarn.lock
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 200,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# bmlt-metrics
# Metrics

- [x] lambda to get and store daily metrics from the aggregator
- [X] api gateway for dynamo
- [X] added query string params for specifying dates `start_date` and `end_date` if not specified first entry date and current date is used for start and end.
- Aggregator Meeting Metrics

example datatable using api here metrics.bmlt.app
Bootstrapped using [SvelteKit](https://kit.svelte.dev/). Powered by [Svelte](https://svelte.dev/) and [Vite](https://vitejs.dev/)

## Developing

Once you've installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

## Deploying

New deploys are done with every push to the main branch.
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

161 changes: 0 additions & 161 deletions docs/index.html

This file was deleted.

46 changes: 46 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
google: 'readonly'
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
},
{
files: ['**/*.ts', '**/*.svelte'],
rules: {
'@typescript-eslint/no-explicit-any': 'off'
}
},
{
files: ['**/Plotly.svelte'],
rules: {
'@typescript-eslint/no-unused-vars': 'off'
}
}
];
Loading

0 comments on commit 0a13988

Please sign in to comment.