Obtain AST by reading vue and react source code, and then dynamically add tags

Overview

说明

通过读取react、vue源码,获取AST,然后通过一定的规则动态的添加data标签,项目的初衷是为了标识埋点而创建

功能

  1. 自动对代码进行埋点
  2. check是否有重复埋点

快速使用

通过命令行的方式

## 在项目的根目录下输入aat,默认类型是react代码
aat
## 如果是vue项目
aat -t vue 

通过代码的方式方式调用

const addTags = require("auto-add-tags")
// 默认react代码
addTags.main()
// 如果是vue项目
addTags.main({type: "vue"})

如果需要更高级别的定制,可以参考下面的选项

Reference

-d, --dir

The directory or file to be converted, the default is the current src directory

[string] [default: "src"]

-t, --type

The supported type is react by default, and you can also enter vue|react

[string] [default: "react"]

--tagName

Automatically insert tags, the default value is data-xt

[string] [default: "data-xt"]

--min

The starting value of automatically adding tags, the default value is 0

[number] [default: 0]

--max

The maximum value of automatically added tags, the default value is Number.MAX_SAFE_INTEGER

[number] [default: 9007199254740991]

-f, --force

force updates

[boolean] [default: false]

-e, --elementNames

Which components need to be tracked? not case sensitive,the default value is [link,a,route] -e link a route

[array] [default: ["a","link","route"]]

--eventNames

What events need to be tracked? not case sensitive。 the default value is [onclick,onsubmit] --eventNames onclick onsubmit [array] [default: ["click", "submit", "change"]]

-c, --check

Check if there are duplicate tags

[boolean] [default: false]

-r, --resultFile

Insert point record
[string] [default: "tracePoint.json"]

You might also like...
Simple zero-dependency input mask for Vue.js and vanilla JS.

Simple zero-dependency input mask for Vue.js and vanilla JS.

Nice-Numeric-Input is a modern, rich featured and highly customisable numeric input built on Vue.

Nice-Numeric-Input is a modern, rich featured and highly customisable numeric input built on Vue. Capable of formatting as the user types, including currency formatting. With no extra dependencies other than Vue itself.

A Vue.js (= 3.2) web component that wraps around an html input of type 'range' with label and styling options.

range-comp range-comp is Vue.js (= 3.2) web component that wraps around an html input of type 'range' with label and styling options. range-comp can

Easy formatted numbers, currency and percentage with input/directive mask for Vue.js

vue-number-format Vue Number Format is used to format a number using fixed-point notation. It can be used to format a number with a specific number of

Vue Fake input is a Vue.js based component to create custom inputs for individual characters.
Vue Fake input is a Vue.js based component to create custom inputs for individual characters.

Vue Fake Input Vue Fake input is a Vue.js based component to create custom inputs for individual characters. Table of Contents Installation Usage Lice

Vue Cleave component is based on cleave.js for Vue

Vue Cleave component is based on cleave.js for Vue

A jQuery Plugin to make masks on form fields and HTML elements.

jQuery Mask Plugin A jQuery Plugin to make masks on form fields and HTML elements. Documentation, Demos & Usage Examples https://igorescobar.github.io

Masked input component for Vue.js

Vue Masked Input Dead simple masked input component for Vue.js 2.X. Based on inputmask-core. Live Demo Install npm npm install vue-masked-input --save

Input field component to display a formatted currency value based on Vue.js

vue-numeric Input field component to display a formatted currency value based on Vue. Live Demo Works with Vue 2.* Installation Install via CDN scrip

Owner
沧海
@OSSDAO-ORG•AIRDROP-0x7ce161C7E508922699A8f0232f7Ca668ed3eB9b5
沧海
A tags input component for VueJS

A tags input component for VueJS

Vojtěch Laňka 0 Apr 20, 2021
Set of vue directives to add text restriction to your vue input

Vue-Input-Restriction-Directives Set of useful vue directives to add text restriction to your input No keyboard key validation, just regular expressio

Benjamin Arambide 5 Nov 19, 2021
Vue.js directive to add inputmask library to your inputs (vanilla javascript).

vue-inputmask Vue.js directive to add a mask to your inputs (vanilla javascript). It's a binding for the inputmask library by Robin Herbots https://gi

Simon Cleriot 117 Jul 17, 2022
Input mask for React, Angular, Ember, Vue, & plain JavaScript

⚠️ This library is not maintained. Pull-requests and issues are not monitored. Alternatives to text-mask include: https://github.com/uNmAnNeR/imaskjs

Text Mask 8.2k Sep 30, 2022
base on vue2.0+ verification code input component. (基于Vue2.0+的移动端验证码输入组件)

vue-input-code 基于Vue2.0+的移动端验证码输入组件. 功能预览 输入时回调 结果回调 自定义错误处理 自定义验证码个数 样式可控 这里是可爱的Demo 支持 支持 Vue.js 2.0+. 安装和使用 npm install vue-input-code --save 作为全局组

Obeta 66 Jan 10, 2022
Click to show input text box Vue Component ... inspired by Trello. This is my first time publishing Vue Component via npm package and let me know if you encounter any issues, bugs, or improvement. Thanks!

label-edit Click to show input text box Vue Component ... inspired by Trello. This is my first time publishing Vue Component via npm package and let m

Myo Kyaw Htun 22 Apr 24, 2022
A fully customizable, OTP (one-time-password) input component built with Vue 3.x and Vue Composition API.

vue-otp-input A fully customizable, OTP (one-time-password) input component built with Vue 3.x and Vue Composition API. Installation To install the la

Ejiro Asiuwhu 39 Sep 23, 2022
The awesome-mask runs with Vue.js and uses the vanilla-masker to make your form awesome with masks.

The awesome-mask runs with Vue.js and uses the vanilla-masker to make your form awesome with masks. You can use patterns like: <input type="text" v-ma

Wirecard Brasil 164 Aug 3, 2022
Tiny (2k gzipped) and dependency free mask input for Vue.js

The Mask A lightweight (2KB gzipped) and dependency free mask input created specific for Vue.js Docs and Demo JsFiddle Install yarn add vue-the-mask o

Vue.js Tips 1.6k Sep 20, 2022
A lightweight and dependency free input masking library created specific for Vue

Vue Input Facade A lightweight and dependency free input masking library created specific for Vue Docs and Demo Installing npm i vue-input-facade yarn

Ronald Jerez 139 Sep 14, 2022