Skip to content

Commit 69eea02

Browse files
committed
Fix build
* move to gh actions * fix matomo:lint errors
1 parent 3d0e57c commit 69eea02

File tree

4 files changed

+43
-23
lines changed

4 files changed

+43
-23
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
env:
16+
CI: true
17+
strategy:
18+
matrix:
19+
node-version: [10.x, 12.x, 14.x, 16.x]
20+
name: Use Node.js ${{ matrix.node-version }}
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Setup node
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'yarn'
28+
- name: yarn install
29+
run: yarn
30+
- name: Linting Lib
31+
run: yarn lint:lib
32+
- name: Test fixture
33+
run: yarn test:fixtures
34+
- name: Lint Matomo
35+
run: yarn lint:matomo
36+
- name: e2e Tests
37+
run: yarn test:e2e

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Matomo analytics for Nuxt.js
2-
<a href="https://travis-ci.org/pimlie/nuxt-matomo"><img src="https://api.travis-ci.org/pimlie/nuxt-matomo.svg" alt="Build Status"></a>
2+
[![CI - Build](https://github.com/pimlie/nuxt-matomo/actions/workflows/ci.yml/badge.svg)](https://github.com/pimlie/nuxt-matomo/actions/workflows/ci.yml)
33
[![npm](https://img.shields.io/npm/dt/nuxt-matomo.svg?style=flat-square)](https://www.npmjs.com/package/nuxt-matomo)
44
[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-matomo/latest.svg?style=flat-square)](https://www.npmjs.com/package/nuxt-matomo)
55

lib/plugin.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default <%= options.blockLoading ? 'async ' : ''%>(context, inject) => {
5050
// Log a warning when piwik doesnt become available within 10s (in debug mode)
5151
const hasPiwikCheck = setTimeout(() => {
5252
if (!window.Piwik) {
53-
debug(`window.Piwik was not set within timeout`)
53+
debug('window.Piwik was not set within timeout')
5454
}
5555
}, 10000)
5656
<% } %>
@@ -67,7 +67,7 @@ export default <%= options.blockLoading ? 'async ' : ''%>(context, inject) => {
6767
<% if(debug || options.debug) { %>
6868
clearTimeout(hasPiwikCheck)
6969
if (_windowPiwik) {
70-
debug(`window.Piwik is already defined`)
70+
debug('window.Piwik is already defined')
7171
}
7272
<% } %>
7373

@@ -129,7 +129,7 @@ export default <%= options.blockLoading ? 'async ' : ''%>(context, inject) => {
129129
}
130130

131131
<% if(debug || options.debug) { %>
132-
debug(`Tell matomo to track pageview ${to.fullPath}`, document.title)
132+
debug(`Tell matomo to track pageview ${to.fullPath} - ${document.title}`)
133133

134134
<% } %>
135135
// tell Matomo to add a page view (doesnt do anything if tracker is disabled)
@@ -142,7 +142,6 @@ export default <%= options.blockLoading ? 'async ' : ''%>(context, inject) => {
142142
context.app.head.changed = (...args) => {
143143
<% if(debug || options.debug) { %>
144144
clearTimeout(metaChangeTimeout)
145-
console.log
146145
if (!args[0].title) {
147146
warn(`title was updated but empty for ${trackOnMetaChange && trackOnMetaChange.to.fullPath || 'unknown route'}`)
148147
}
@@ -193,7 +192,7 @@ console.log
193192
function createTracker (delayedCalls = []) {
194193
if (!window.Piwik) {
195194
<% if(debug || options.debug) { %>
196-
debug(`window.Piwik not initialized, unable to create a tracker`)
195+
debug('window.Piwik not initialized, unable to create a tracker')
197196
<% } %>
198197
return
199198
}
@@ -214,7 +213,7 @@ function createTracker (delayedCalls = []) {
214213
}
215214

216215
<% if(debug || options.debug) { %>
217-
debug(`Created tracker for siteId <%= options.siteId %> to <%= options.trackerUrl %>`)
216+
debug('Created tracker for siteId <%= options.siteId %> to <%= options.trackerUrl %>')
218217
<% if(options.verbose) { %>
219218
// wrap all Piwik functions for verbose logging
220219
Object.keys(tracker).forEach((key) => {

0 commit comments

Comments
 (0)