Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120

# Formatted by biome, yamlfmt or taplo, which cannot wrap strings
[*.{json,jsonc,yaml,yml,toml}]
max_line_length = off
3 changes: 3 additions & 0 deletions .editorconfig-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Exclude": []
}
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ updates:
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: jdx/mise-action@7e2b3c3d1450331892809a84e22e30e3f52c1e92 # v5.5.0
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7
with:
cache: npm
node-version: latest
check-latest: true
- run: npm ci
- run: hk check --all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
validate:
name: Validate Graph
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Graph Validation
uses: logseq/graph-validator@69ebd330bd744a9f0d0b97a87b01382f1c115b84 # v0.5.0
publish:
name: Publish
needs: [lint, validate]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: $/.github/workflows/publish.yml
secrets:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
permissions:
contents: write
50 changes: 31 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
name: Publish
on:
workflow_run:
workflows: ["Test"]
types: [completed]
branches:
- "main"
workflow_call:
secrets:
CLOUDFLARE_ACCOUNT_ID:
required: true
CLOUDFLARE_API_TOKEN:
required: true
concurrency:
group: Publish-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
name: Publish Logseq SPA
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Build
uses: logseq/publish-spa@v0.3.1
uses: logseq/publish-spa@3fa40f2288e96b5927037610e2445f892a438d79 # v0.3.1
with:
theme-mode: dark
accent-color: purple
Expand All @@ -26,10 +33,10 @@ jobs:
git status -s
ls dist/
- name: Setup Node.js
uses: actions/setup-node@v7
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7
with:
cache: "npm"
node-version: "latest"
cache: 'npm'
node-version: 'latest'
check-latest: true
- name: Install dependencies
run: npm ci
Expand All @@ -41,26 +48,31 @@ jobs:
publish-data:
runs-on: ubuntu-latest
name: Publish Linked Data
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v7
persist-credentials: false
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7
with:
cache: "npm"
node-version: "latest"
cache: 'npm'
node-version: 'latest'
check-latest: true
- name: Export graph as RDF
uses: logseq/rdf-export@v0.2.1
uses: logseq/rdf-export@3a11bf071e320cb4e014e697edf6911aa5f05208 # v0.2.1
with:
rdfFile: notes.nq
- name: Convert N-Quads to JSON-LD
run: |
npm ci
npm run convert
- uses: stefanzweifel/git-auto-commit-action@v7
# git-auto-commit pushes with the token from GH_TOKEN, not credentials stored by checkout
- run: git config --global credential.https://github.com.helper '!gh auth git-credential'
- uses: stefanzweifel/git-auto-commit-action@d0b01107b5db882071f96de5dd4b54961ea93f4c # v7
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file_pattern: "notes.nq notes.jsonld"
commit_message: "Update linked data"
file_pattern: 'notes.nq notes.jsonld'
commit_message: 'Update linked data'
21 changes: 0 additions & 21 deletions .github/workflows/test.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .rumdl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[global]
flavor = "gfm"
editorconfig = true

[MD013]
reflow = true
reflow-mode = "semantic-line-breaks"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Notes

[![Test](https://github.com/chadsr/notes/actions/workflows/test.yml/badge.svg)](https://github.com/chadsr/notes/actions/workflows/test.yml)
[![Publish](https://github.com/chadsr/notes/actions/workflows/publish.yml/badge.svg)](https://github.com/chadsr/notes/actions/workflows/publish.yml)
[![CI](https://github.com/chadsr/notes/actions/workflows/ci.yml/badge.svg)](https://github.com/chadsr/notes/actions/workflows/ci.yml)
13 changes: 13 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://biomejs.dev/schemas/2.6.10/schema.json",
"assist": {
"actions": {
"source": {
"useSortedKeys": "on"
}
}
},
"formatter": {
"indentStyle": "space"
}
}
36 changes: 36 additions & 0 deletions hk.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
amends "hk:/Config.pkl"

import "hk:/Builtins.pkl"
// Using a coding agent? See https://hk.jdx.dev/agents

local linters = new Mapping {
["mise"] = Builtins.mise
["mixed-line-ending"] = Builtins.mixed_line_ending
["pkl-format"] = Builtins.pkl_format
["jactionlint"] = Builtins.jactionlint
// hk doesn't add node_modules/.bin to PATH, so run the project's own tsc through npx
["tsc"] = (Builtins.tsc) {
check = "npx --no-install tsc --noEmit -p {{workspace_indicator}}"
}
["detect-private-key"] = Builtins.detect_private_key
["zizmor"] = Builtins.zizmor
["trailing-whitespace"] = Builtins.trailing_whitespace
["check-added-large-files"] = (Builtins.check_added_large_files) {
check = "hk util check-added-large-files --maxkb 27000 {{files}}"
}
["typos"] = (Builtins.typos) {
apply_check_diff = false
fix = "typos --force-exclude {{files}}"
}
["biome"] = (Builtins.biome) {
// Also format json(c)
glob = List("**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.json", "**/*.jsonc")
}
["cljstyle"] = new Step {
glob = List("**/*.clj", "**/*.cljc", "**/*.edn")
check = "cljstyle check {{files}}"
fix = "cljstyle fix {{files}}"
}
}

steps = linters
Loading
Loading