Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed May 27, 2024
2 parents 1d3484b + f1d9389 commit 62b2bff
Show file tree
Hide file tree
Showing 10 changed files with 2,525 additions and 2,047 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees: ""

| Tool | Version |
| ------ | ------------- |
| Plugin | v2.x.x |
| Plugin | v3.x.x |
| Vue | v3.x.x |
| Node | vx.x.x |
| OS | win,linux,mac |
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node_version: [18, 20]
node_version: [22]
fail-fast: false

name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v3.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v3
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
Expand All @@ -43,24 +43,25 @@ jobs:
- name: Build
run: pnpm run build

- name: Check scripts
run: pnpm run ts-check

- name: Test
run: pnpm run test --silent
run: pnpm run test

lint:
runs-on: ubuntu-latest
name: 'Lint: node-20, ubuntu-latest'
name: 'Lint: node-22, ubuntu-latest'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v3.0.0

- name: Set node version to 20
uses: actions/setup-node@v3
- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Prepare
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish

on:
workflow_dispatch:

jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
name: Release
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v3.0.0

- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22
cache: 'pnpm'

- name: Prepare
run: pnpm install --frozen-lockfile

- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish
run: |
PACKAGE_DIST_TAG=$(node -e "console.log(/^\d+\.\d+\.\d+(\-(\w+)\.\d+)$/.exec(require('./package.json').version)?.[2] || 'latest')")
pnpm publish --access public --tag $PACKAGE_DIST_TAG
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<h1 align="center">Vue Google Tag Manager</h1>

<h4 align="center">*** Contributors welcome ***</h4>

<p align="center">
<a href="https://tagmanager.google.com/">
<img alt="Google Tag Manager" src="https://www.gstatic.cn/analytics-suite/header/suite/v2/ic_tag_manager.svg" height="192">
Expand All @@ -17,7 +15,7 @@

<p align="center">
<a href="https://github.com/gtm-support/vue-gtm/blob/main/LICENSE">
<img alt="license: Apache-2.0" src="https://img.shields.io/github/license/gtm-support/vue-gtm.svg?style=flat-square">
<img alt="license: MIT" src="https://img.shields.io/github/license/gtm-support/vue-gtm.svg?style=flat-square">
</a>
<a href="https://www.npmjs.com/package/@gtm-support/vue-gtm">
<img alt="NPM package" src="https://img.shields.io/npm/v/@gtm-support/vue-gtm.svg?style=flat-square">
Expand All @@ -37,8 +35,6 @@ This plugin will help you in your common GTM tasks.

**Note: If you are looking to track all Vuex mutations, you can use [Vuex GTM plugin](https://gist.github.com/matt-e-king/ebdb39088c50b96bbbbe77c5bc8abb2b)**

> If you want Vue 2 compatibility, please use the package [@gtm-support/vue2-gtm](https://www.npmjs.com/package/@gtm-support/vue2-gtm).
# Requirements

- **Vue.** >= 3.0.0
Expand All @@ -50,7 +46,7 @@ This plugin will help you in your common GTM tasks.

# Configuration

`npm install @gtm-support/vue-gtm` or `yarn add @gtm-support/vue-gtm` if you use [Yarn package manager](https://yarnpkg.com)
`npm install @gtm-support/vue-gtm`

Here is an example configuration:

Expand Down Expand Up @@ -293,11 +289,6 @@ Disable debug mode
this.$gtm.debug(false);
```
## IE 11 support
If you really need to support browsers like IE 11, you need to configure `transpileDependencies: ['@gtm-support/core']` in your `vue.config.js`.
See [gtm-support/core#20 (comment)](https://github.com/gtm-support/core/issues/20#issuecomment-855903062)
## Credits
- [mib200 vue-gtm](https://github.com/mib200/vue-gtm)
Expand Down
32 changes: 14 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@
"files": [
"dist"
],
"main": "dist/index.cjs",
"module": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
".": "./dist/index.js",
"./package.json": "./package.json"
},
"author": {
Expand Down Expand Up @@ -67,27 +63,27 @@
"google"
],
"dependencies": {
"@gtm-support/core": "^2.0.0"
"@gtm-support/core": "^3.0.1"
},
"devDependencies": {
"@types/node": "~20.11.16",
"@typescript-eslint/eslint-plugin": "~6.21.0",
"@typescript-eslint/parser": "~6.21.0",
"eslint": "~8.56.0",
"@types/node": "~20.12.12",
"@typescript-eslint/eslint-plugin": "~7.10.0",
"@typescript-eslint/parser": "~7.10.0",
"eslint": "~8.57.0",
"eslint-config-prettier": "~9.1.0",
"eslint-define-config": "~2.1.0",
"eslint-gitignore": "~0.1.0",
"eslint-plugin-jsdoc": "~48.0.6",
"eslint-plugin-jsdoc": "~48.2.6",
"eslint-plugin-prettier": "~5.1.3",
"eslint-plugin-spellcheck": "~0.0.20",
"jsdom": "~24.0.0",
"npm-run-all2": "~6.1.2",
"jsdom": "~24.1.0",
"npm-run-all2": "~6.2.0",
"prettier": "3.2.5",
"prettier-plugin-organize-imports": "~3.2.4",
"rimraf": "~5.0.5",
"tsup": "~8.0.1",
"typescript": "~5.3.3",
"vitest": "~1.2.2",
"rimraf": "~5.0.7",
"tsup": "~8.0.2",
"typescript": "~5.4.5",
"vitest": "~1.6.0",
"vue": "^3.4.15",
"vue-router": "^4.2.5"
},
Expand All @@ -102,5 +98,5 @@
"optionalDependencies": {
"vue-router": ">= 4.1.0 < 5.0.0"
},
"packageManager": "pnpm@8.15.1"
"packageManager": "pnpm@9.1.2"
}
Loading

0 comments on commit 62b2bff

Please sign in to comment.