-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e86897
commit 70f1bf2
Showing
1,139 changed files
with
210,800 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: all dashboard homelab perception | ||
|
||
all: cleanup dashboard homelab perception | ||
|
||
dashboard: | ||
cd services/dashboard && bun run dev & | ||
|
||
homelab: | ||
cd services/homelab-status-page && air src/*.go & | ||
|
||
homelab-styles: | ||
cd services/homelab-status-page && bun run style & | ||
|
||
perception: | ||
cd services/perception && echo "shit" & | ||
|
||
|
||
cleanup: | ||
# Kill processes running on the specified ports | ||
lsof -ti :1337 :8000 :3000 | sudo xargs -r kill -9 || true | ||
pgrep -f 'bun' | sudo xargs -r kill -9 || true | ||
# Optionally, you can also kill processes by name (like 'bun' or 'air') if necessary | ||
# pkill -f 'bun run dev' || true | ||
# pkill -f 'air src/*.go' || true | ||
# pkill -f 'echo "shit"' || true | ||
# Wait a few seconds to ensure ports are released | ||
sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: "3" | ||
services: | ||
dashboard: | ||
image: ghcr.io/observablehq/framework-runtime | ||
volumes: | ||
- ./services/dashboard:/app | ||
working_dir: /app | ||
command: yarn install && yarn run dev | ||
|
||
homelab: | ||
image: golang:1.19 | ||
volumes: | ||
- ./services/homelab-status-page:/app | ||
working_dir: /app | ||
command: go run app/src/*.go | ||
|
||
perception: | ||
image: python:3.10 | ||
volumes: | ||
- ./services/perception:/app | ||
working_dir: /app | ||
command: python log.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test/build | ||
test/input | ||
test/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"prettier" | ||
], | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts"] | ||
}, | ||
"import/resolver": { | ||
"typescript": true, | ||
"node": true | ||
} | ||
}, | ||
"plugins": ["@typescript-eslint", "import"], | ||
"parser": "@typescript-eslint/parser", | ||
"env": { | ||
"es2020": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"@typescript-eslint/consistent-type-imports": ["warn", {"prefer": "type-imports"}], | ||
"@typescript-eslint/no-empty-function": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-this-alias": 0, | ||
"@typescript-eslint/no-unused-vars": ["error", {"ignoreRestSiblings": true}], | ||
"import/consistent-type-specifier-style": "warn", | ||
"import/first": "warn", | ||
"import/newline-after-import": "warn", | ||
"import/no-duplicates": "off", | ||
"import/no-import-module-exports": "warn", | ||
"import/no-relative-packages": "warn", | ||
"import/no-unused-modules": "error", | ||
"import/order": [ | ||
"warn", | ||
{ | ||
"groups": ["builtin", "external", "parent", "sibling", "index"], | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
} | ||
} | ||
], | ||
"no-cond-assign": 0, | ||
"no-constant-condition": 0, | ||
"no-sparse-arrays": 0, | ||
"no-unexpected-multiline": 0, | ||
"object-shorthand": ["warn", "always"], | ||
"sort-imports": ["warn", {"ignoreDeclarationSort": true}], | ||
"quotes": ["warn", "double", {"avoidEscape": true}] | ||
}, | ||
"root": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ask git to not change line endings (to preserve content hashes). | ||
* -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: Bug | ||
about: Something isn’t working | ||
labels: "bug" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: Enhancement | ||
about: New feature or request | ||
labels: "enhancement" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "eslint-compact", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"severity": 4, | ||
"message": 5, | ||
"code": 6 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: [main] | ||
schedule: | ||
- cron: "15 10 * * *" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
deployments: write | ||
id-token: write | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
- run: yarn --frozen-lockfile | ||
- id: date | ||
run: echo "date=$(TZ=America/Los_Angeles date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- id: cache-data | ||
uses: actions/cache@v4 | ||
with: | ||
path: docs/.observablehq/cache | ||
key: data-${{ hashFiles('docs/data/*') }}-${{ steps.date.outputs.date }} | ||
- run: yarn build | ||
- run: yarn docs:build | ||
- run: yarn docs:deploy | ||
env: | ||
OBSERVABLE_TOKEN: ${{ secrets.OBSERVABLE_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_dispatch: {} | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
- run: yarn --frozen-lockfile | ||
- run: yarn test | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
version: [20, 21] | ||
os: [ubuntu-latest, windows-latest] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.version }} | ||
cache: yarn | ||
- run: yarn --frozen-lockfile | ||
- run: yarn test:coverage | ||
- run: yarn test:tsc | ||
- run: | | ||
echo ::add-matcher::.github/eslint.json | ||
yarn run eslint src test --format=compact --max-warnings=0 | ||
- run: yarn test:prettier | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: test-output-changes-${{ matrix.os }}-${{ matrix.version }} | ||
path: | | ||
test/output/*-changed.* | ||
test/output/build/*-changed/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
**/.observablehq/cache/ | ||
.DS_Store | ||
.env | ||
/coverage/ | ||
/dist/ | ||
/docs/.observablehq/dist/ | ||
/test/build/ | ||
/test/output/**/*-changed.* | ||
/test/output/build/**/*-changed/ | ||
node_modules/ | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test/input | ||
test/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"bracketSpacing": false, | ||
"printWidth": 120, | ||
"trailingComma": "none", | ||
"embeddedLanguageFormatting": "off" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2023-2024 Observable, Inc. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose | ||
with or without fee is hereby granted, provided that the above copyright notice | ||
and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | ||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Observable Framework | ||
|
||
[**Observable Framework**](https://observablehq.com/framework/) is a free, [open-source](./LICENSE), static site generator for data apps, dashboards, reports, and more. Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis. Framework features [data loaders](https://observablehq.com/framework/loaders) that precompute static snapshots of data at build time for dashboards that load instantly. | ||
|
||
## Documentation 📚 | ||
|
||
https://observablehq.com/framework/ | ||
|
||
## Examples 🖼️ | ||
|
||
https://github.com/observablehq/framework/tree/main/examples | ||
|
||
## Releases (changelog) 🚀 | ||
|
||
https://github.com/observablehq/framework/releases | ||
|
||
## Getting help 🏠 | ||
|
||
Please [open a discussion](https://github.com/observablehq/framework/discussions) if you’d like help. We also recommend [searching issues](https://github.com/observablehq/framework/issues). You can also ask on the [Observable forum](https://talk.observablehq.com/) or [Observable community Slack](https://observablehq.com/slack/join). | ||
|
||
## Contributing 🙏 | ||
|
||
See [Contributing](https://observablehq.com/framework/contributing). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {parseArgs} from "node:util"; | ||
import {build} from "esbuild"; | ||
import {glob} from "glob"; | ||
|
||
const {values, positionals} = parseArgs({ | ||
allowPositionals: true, | ||
options: { | ||
outdir: {type: "string", default: "build"}, | ||
outbase: {type: "string"}, | ||
ignore: {type: "string", multiple: true}, | ||
sourcemap: {type: "boolean"} | ||
} | ||
}); | ||
|
||
await build({ | ||
entryPoints: await glob(positionals, {ignore: values.ignore}), | ||
define: {"process.env.npm_package_version": `"${process.env.npm_package_version}"`}, | ||
outdir: values.outdir, | ||
outbase: values.outbase, | ||
platform: "node", | ||
sourcemap: values.sourcemap ? "linked" : false, | ||
format: "esm", | ||
logLevel: "info" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"resolve": { | ||
"extensions": [".js", ".jsx"] | ||
}, | ||
"env": { | ||
"browser": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projectId": "b385d10b723e37b6", | ||
"projectSlug": "framework", | ||
"workspaceLogin": "observablehq" | ||
} |
Oops, something went wrong.