Skip to content

Commit

Permalink
Merge pull request #76 from teomrd/deno
Browse files Browse the repository at this point in the history
Deno
  • Loading branch information
teomrd authored Nov 2, 2024
2 parents dedea5f + b37359c commit f0ea0e0
Show file tree
Hide file tree
Showing 124 changed files with 5,232 additions and 11,026 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/audit.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy to GitHub Pages
on:
push:
branches:
- main
jobs:
dry-versioning:
runs-on: ubuntu-22.04
outputs:
new_tag: ${{ steps.dry-versioning.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version
uses: anothrNick/github-tag-action@1.67.0
id: dry-versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
DRY_RUN: true
build-and-deploy:
runs-on: ubuntu-latest
needs:
- dry-versioning
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: write
env:
NEW_VERSION: ${{needs.dry-versioning.outputs.new_tag}}
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: ✌️ Set version environment variable
shell: bash
run: echo "NEW_VERSION=${{ env.NEW_VERSION }}" >> $GITHUB_ENV
- run: make build
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
versioning:
runs-on: ubuntu-22.04
needs:
- build-and-deploy
permissions:
contents: write
outputs:
new_tag: ${{ steps.app-versioning.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.67.0
id: app-versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
15 changes: 15 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: On Pull Requests
on:
pull_request:
branches:
- main
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: make checks
- run: make build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
node_modules
dev
.lighthouseci
dist
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

39 changes: 22 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,42 @@ MAKE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

.DEFAULT_GOAL := dev

.PHONY : install dev audits deploy serve version build deploy clean
.PHONY : install dev audits deploy serve build deploy clean

install:
pnpm install
deno install

dev: install build
open http://localhost:8000 && pnpm run dev
dev: install
open http://localhost:8000 && sh scripts/dev.sh

checks: install
pnpm run lint && pnpm run test
verify-formatting:
deno fmt --check

lint:
deno lint

test:
deno test

compile:
deno task compile

checks: install verify-formatting lint test
make compile

audits: install build
pnpm run lighthouse
deno task lighthouse

clean:
deno clean
rm -rf ./node_modules
rm -rf ./out
rm -rf ./dist
rm -rf ./dev
rm -rf ./*lock*

serve: build
serve $(MAKE_DIR)/out

update:
pnpm up

force-update:
pnpm up --latest

version:
$(MAKE_DIR)/scripts/version.sh
serve $(MAKE_DIR)/dist

build: install
$(MAKE_DIR)/scripts/build.sh
Expand Down
45 changes: 45 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@teomrd/miropad",
"exports": "./index.js",
"version": "2.15.20",
"license": "GPL-3.0-only",
"author": "teomrd <mironidis.gr@gmail.com>",
"repository": "https://github.com/teomrd/MiroPad.git",
"tasks": {
"compile": "deno check src",
"lint": "deno lint src/"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"@types/textarea-caret": "npm:@types/textarea-caret@^3.0.3",
"@lhci/cli": "npm:@lhci/cli@0.14.0",
"esbuild": "npm:esbuild@^0.24.0",
"workbox": "npm:workbox@^0.0.0",
"workbox-cli": "npm:workbox-cli@^7.3.0"
},
"lint": {
"include": ["src/"],
"exclude": ["src/assets/", "src/css/"],
"rules": {
"tags": ["recommended"]
}
},
"fmt": {
"useTabs": false,
"lineWidth": 80,
"indentWidth": 2,
"semiColons": true,
"singleQuote": false,
"proseWrap": "preserve",
"include": ["src/"],
"exclude": ["src/assets/"]
},
"exclude": [
"out/",
"dist/"
],
"compilerOptions": {
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"]
}
}

Loading

0 comments on commit f0ea0e0

Please sign in to comment.