Skip to content

Commit

Permalink
deps: updated template and deps
Browse files Browse the repository at this point in the history
- refactored and remoed path aliases
- moved demo to use vite
- added github action step for demo
  • Loading branch information
AlansCodeLog committed Oct 7, 2023
1 parent 903e559 commit c264147
Show file tree
Hide file tree
Showing 120 changed files with 1,511 additions and 1,033 deletions.
41 changes: 41 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */
module.exports = {
root: true,
extends: [
// https://github.com/AlansCodeLog/eslint-config
"@alanscodelog/eslint-config",
],
// for vscode, so it doesn't try to lint files in here when we open them
ignorePatterns: [
"coverage",
"dist",
"docs",
],
rules: {
},
settings: {
jsdoc: {
mode: "typescript",
},
},
parserOptions: {
project: "./tsconfig.eslint.json",
},
overrides: [
{
files: ["./*.{js,cjs,ts,vue}"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
}
}
// Eslint: https://eslint.org/docs/rules/
// Typescript: https://typescript-eslint.io/rules/
// Vue: https://eslint.vuejs.org/rules/
// {
// files: ["**/*.js", "**/*.ts", "**/*.vue"],
// rules: {
// },
// },
],
}

50 changes: 0 additions & 50 deletions .eslintrc.js

This file was deleted.

29 changes: 23 additions & 6 deletions .github/workflows/build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: Build-Only
# does not use cache

env:
USE_LOCKFILE: false
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}

on:
push:
branches: [ build ]
branches: [ build, experimental ]
repository_dispatch:
types: [ build-only ]

jobs:
build-only:
build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -33,18 +33,35 @@ jobs:
id: pnpm-install
with:
version: latest

- name: Get Pnpm Cache Path
id: pnpm-cache
run: |
echo "::set-output name=dir::$(pnpm store path)"
- uses: actions/cache@v3
name: pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: "echo Cache Key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}"
- run: "echo Cache Restore-Keys: ${{ runner.os }}-pnpm-store-"
- run: "echo Pnpm Cache Hit: ${{ steps.pnpm-cache.outputs.cache-hit }}"
# regionend

# region Steps
- run: pnpm install --frozen-lockfile
if: "env.USE_LOCKFILE == 'true'"

- run: pnpm install
if: "env.USE_LOCKFILE == 'false'"
- run: pnpm install --no-lockfile
if: "env.USE_LOCKFILE != 'true'"

- run: pnpm build

- run: pnpm lint:eslint # test command will lint types
- run: pnpm lint

- run: pnpm test
# regionend
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build
# not technically necessary because release also runs tests but this way the build badge is separate

env:
USE_LOCKFILE: false
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}

on:
push:
Expand Down Expand Up @@ -35,13 +35,11 @@ jobs:
version: latest

- name: Get Pnpm Cache Path
if: "env.USE_LOCKFILE == 'true'"
id: pnpm-cache
run: |
echo "::set-output name=dir::$(pnpm store path)"
- uses: actions/cache@v3
if: "env.USE_LOCKFILE == 'true'"
name: pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.dir }}
Expand All @@ -58,14 +56,12 @@ jobs:
- run: pnpm install --frozen-lockfile
if: "env.USE_LOCKFILE == 'true'"

- run: pnpm install
if: "env.USE_LOCKFILE == 'false'"

- run: pnpm install
- run: pnpm install --no-lockfile
if: "env.USE_LOCKFILE != 'true'"

- run: pnpm build

- run: pnpm lint:eslint # test command will lint types
- run: pnpm lint

- run: pnpm test
# regionend
25 changes: 18 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Docs

env:
USE_LOCKFILE: false
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
ENABLE_DOCS: ${{ secrets.ENABLE_DOCS }}

on:
push:
Expand Down Expand Up @@ -34,13 +35,11 @@ jobs:
version: latest

- name: Get Pnpm Cache Path
if: "env.USE_LOCKFILE == 'true'"
id: pnpm-cache
run: |
echo "::set-output name=dir::$(pnpm store path)"
- uses: actions/cache@v3
if: "env.USE_LOCKFILE == 'true'"
name: pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.dir }}
Expand All @@ -53,23 +52,35 @@ jobs:
- run: "echo Pnpm Cache Hit: ${{ steps.pnpm-cache.outputs.cache-hit }}"
# regionend

# region Steps
- run: pnpm install --frozen-lockfile
if: "env.USE_LOCKFILE == 'true'"

- run: pnpm install
- run: pnpm install --no-lockfile
if: "env.USE_LOCKFILE != 'true'"

- run: pnpm build

- run: pnpm lint

- run: pnpm test

- run: pnpm install --frozen-lockfile
working-directory: demo

- run: pnpm demo:build

- run: pnpm doc

- name: Documentation
# TOCONFIGURE
if: "env.REMOVE_LINE_TO_ENABLE == 'true'"
if: "env.ENABLE_DOCS == 'true'"
uses: crazy-max/ghaction-github-pages@v2
with:
jekyll: false
target_branch: gh-pages
build_dir: docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: echo "env.ENABLE_DOCS is ${{ env.ENABLE_DOCS }}, no documentation can be published" && exit 1
if: "env.ENABLE_DOCS != 'true'"
# regionend
75 changes: 75 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Pull Request Checks

env:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}

on:
pull_request:
branches: [ master, alpha, beta ]

jobs:
pull-request:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["lts/*", "latest"]

steps:

# region Setup
- uses: actions/checkout@v2

- name: Setting Up Node.js (${{ matrix.node-version }})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: latest

- name: Get Pnpm Cache Path
id: pnpm-cache
run: |
echo "::set-output name=dir::$(pnpm store path)"
- uses: actions/cache@v3
name: pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: "echo Cache Key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}"
- run: "echo Cache Restore-Keys: ${{ runner.os }}-pnpm-store-"
- run: "echo Pnpm Cache Hit: ${{ steps.pnpm-cache.outputs.cache-hit }}"
# regionend

# region Steps
- run: pnpm install --frozen-lockfile
if: "env.USE_LOCKFILE == 'true'"

- run: pnpm install --no-lockfile
if: "env.USE_LOCKFILE != 'true'"

- name: Commits to Lint
run: git log ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}} --graph --abbrev-commit --decorate --format=format:'%h%d%n%s (%cr) - %an (%ae)%n%b'

- name: Lint Commits
run: yarn commitlint --from ${{github.event.pull_request.base.sha}} --to ${{github.event.pull_request.head.sha}}

- run: pnpm build

- run: pnpm lint

- run: pnpm coverage

- name: Coverage
uses: romeovs/lcov-reporter-action@v0.2.16
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# regionend
Loading

0 comments on commit c264147

Please sign in to comment.