Skip to content

Commit

Permalink
chore: bump deps (#89)
Browse files Browse the repository at this point in the history
* chore: upgrade renovate config

* refactor: configs

* refactor: useVueLogger now accepts logLevel

* fix: remove old e2e config

* docs: update README
  • Loading branch information
Uninen authored Nov 14, 2024
1 parent ebd17c4 commit d0d0980
Show file tree
Hide file tree
Showing 22 changed files with 1,615 additions and 1,422 deletions.
32 changes: 7 additions & 25 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
{
"extends": [
"config:base",
"group:all",
"schedule:weekly",
":widenPeerDependencies"
],
"enabledManagers": [
"npm"
],
"extends": ["config:recommended", "group:all", "schedule:weekly", ":widenPeerDependencies"],
"enabledManagers": ["npm"],
"packageRules": [
{
"matchManagers": [
"npm"
],
"matchManagers": ["npm"],
"automerge": true,
"stabilityDays": 2
},
{
"matchPackagePatterns": [
"npm"
],
"rangeStrategy": "auto"
"minimumReleaseAge": "2 days"
},
{
"matchPackageNames": [
"vite-plugin-dts"
],
"matchCurrentVersion": "3.2.0",
"enabled": false
"rangeStrategy": "auto",
"matchPackageNames": ["/npm/"]
}
],
"timezone": "Europe/Helsinki",
"dependencyDashboard": true
}
}
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
on:
push:
workflow_run:
workflows: ['Tests']
types:
- completed
branches:
- main
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/test.yml

This file was deleted.

42 changes: 28 additions & 14 deletions .github/workflows/e2e.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,74 @@
name: E2E Test
name: Tests

on:
push:
branches:
- main
paths:
- '.github/workflows/e2e.yml'
- '.github/workflows/tests.yml'
- 'pnpm-lock.yaml'
- 'src/**/*.ts'
- 'src/**/*.vue'
- 'tests/e2e/*.spec.ts'
- 'tests/**/*.ts'
pull_request:
paths:
- '.github/workflows/e2e.yml'
- '.github/workflows/tests.yml'
- 'pnpm-lock.yaml'
- 'src/**/*.ts'
- 'src/**/*.vue'
- 'tests/e2e/*.spec.ts'
- 'tests/**/*.ts'
workflow_dispatch:

concurrency:
group: e2e-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
e2e-tests:
runs-on: ubuntu-latest

env:
CI: 1
DEBUG: 0
PLAYWRIGHT_BROWSERS_PATH: 0

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4.2.2
- uses: actions/cache@v4.1.2
with:
path: /home/runner/.local/share/pnpm/store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v2.4.1
with:
version: 8
version: 9
run_install: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4.1.0
with:
node-version: 18
node-version: 22
cache: 'pnpm'

- name: Build
run: pnpm build

- name: Test
run: pnpm coverage

- name: Component Coverage
uses: davelosert/[email protected]
if: ${{ always() }}
with:
working-directory: ./
vite-config-path: ./vite.config.ts

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run e2e tests
run: pnpm test-e2e-ci
run: pnpm test:ci-e2e

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4.4.3
if: always()
with:
name: playwright-report
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
node_modules
dist
*.tsbuildinfo

/tests/e2e/videos/
/tests/e2e/screenshots/
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### 0.3.0 - 2024-11-14

- refactor: changed `useVueLogger` to accept logLevel argument
- ci: only release after tests pass
- chore: upgrade Renovate config
- chore: bump deps

### 0.2.0 - 2024-04-13

- fix: upgrade Vite configs
Expand Down
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,10 @@ Easy and lightweight console logging for your JavaScript and TypeScript projects

## Installation

Pnpm

```sh
pnpm add @slipmatio/logger
```

Yarn

```sh
yarn add @slipmatio/logger
```

Npm

```sh
npm install @slipmatio/logger
```

## Basic Usage

The easiest way to use this logger is to use the `useLogger` or `useVueLogger` helpers. The helpers are configured to print only errors in production and print all but debug messages in development mode unless called with `debug=true`. You can also set the logger `name` attribute. Both arguments are optional:
Expand Down Expand Up @@ -59,7 +45,7 @@ Vue logger uses a special logger function that pretty prints ref, reactive, and
import { ref, computed } from 'vue'
import { useVueLogger } from '@slipmatio/logger'

const logger = useVueLogger('vuelogger', true)
const logger = useVueLogger('vuelogger')

const num = ref(1)
const timesTwo = computed(() => num.value * 2)
Expand Down
12 changes: 12 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
/**
* Automatically read from package.json version field
*/
readonly VITE_APP_VERSION: string
readonly VITE_APP_BUILD_EPOCH?: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
30 changes: 17 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slipmatio/logger",
"version": "0.2.0",
"version": "0.3.0",
"type": "module",
"description": "Better console logging with TypScript support",
"main": "dist/index.cjs",
Expand All @@ -18,11 +18,13 @@
"email": "[email protected]"
},
"scripts": {
"build": "vite build",
"dev": "vite",
"test": "vitest --coverage",
"test-e2e": "playwright test --ui",
"test-e2e-ci": "playwright test"
"dev": "DEBUG=0 vite",
"build": "DEBUG=0 vue-tsc --build --force && vite build",
"test": "DEBUG=0 vitest",
"test:e2e": "DEBUG=0 playwright test --ui",
"test:ci-e2e": "DEBUG=0 playwright test",
"coverage": "DEBUG=0 vitest run --coverage",
"type-check": "DEBUG=0 vue-tsc --build --force"
},
"files": [
"dist",
Expand All @@ -41,15 +43,17 @@
"license": "MIT",
"devDependencies": {
"@playwright/test": "1.48.2",
"@tsconfig/node20": "^20.1.4",
"@types/node": "22.9.0",
"@vitejs/plugin-vue": "5.1.4",
"@vitest/coverage-v8": "2.1.4",
"@vitejs/plugin-vue": "5.2.0",
"@vitest/coverage-v8": "2.1.5",
"@vue/test-utils": "2.4.6",
"happy-dom": "15.11.0",
"@vue/tsconfig": "^0.6.0",
"happy-dom": "15.11.6",
"typescript": "5.6.3",
"vite": "5.4.10",
"vite": "5.4.11",
"vite-plugin-dts": "4.3.0",
"vitest": "2.1.4",
"vitest": "2.1.5",
"vue": "3.5.12",
"vue-tsc": "2.1.10"
},
Expand All @@ -62,7 +66,7 @@
}
},
"engines": {
"node": ">=18"
"node": ">=22"
},
"repository": {
"type": "git",
Expand All @@ -72,4 +76,4 @@
"url": "https://github.com/slipmatio/logger/issues"
},
"homepage": "https://github.com/slipmatio/logger"
}
}
17 changes: 5 additions & 12 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const config: PlaywrightTestConfig = {
*/
timeout: 3000,
},
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
Expand All @@ -30,25 +31,17 @@ const config: PlaywrightTestConfig = {
},
projects: [
{
name: 'iPhone 6',
name: 'iPhone SE',
use: {
browserName: 'webkit',
...devices['iPhone 6'],
},
},
{
name: 'Macbook 11',
use: {
browserName: 'firefox',
...devices['Macbook 11'],
video: 'on-first-retry',
...devices['iPhone SE'],
},
},
{
name: 'Desktop',
use: {
browserName: 'chromium',
...devices['Macbook Pro'],
browserName: 'firefox',
...devices['Desktop Firefox'],
},
},
],
Expand Down
Loading

0 comments on commit d0d0980

Please sign in to comment.