@castlenine/vite-remove-attribute 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/LICENSE +1 -1
- package/README.md +203 -42
- package/dist/index.cjs +540 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +22 -4
- package/dist/index.js +532 -104
- package/dist/index.js.map +1 -0
- package/dist/sourcemap.d.cts +41 -0
- package/dist/sourcemap.d.ts +41 -0
- package/dist/types.d.cts +30 -0
- package/dist/types.d.ts +24 -2
- package/dist/utilities.d.cts +156 -0
- package/dist/utilities.d.ts +156 -12
- package/package.json +98 -51
- package/dist/index.d.ts.map +0 -1
- package/dist/index.umd.cjs +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utilities.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,93 +1,140 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castlenine/vite-remove-attribute",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A Vite plugin that enables the removal of specified attributes, which is useful for excluding attributes like 'data-testid' that are used in testing. The options include the ability to specify file extensions, attributes, and folders and files to ignore.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"attribute",
|
|
8
8
|
"attributes",
|
|
9
|
-
"build-tool",
|
|
10
9
|
"build",
|
|
10
|
+
"build-tool",
|
|
11
|
+
"data-testid",
|
|
11
12
|
"optimization",
|
|
12
13
|
"plugin",
|
|
13
14
|
"react",
|
|
14
15
|
"reactjs",
|
|
16
|
+
"remove",
|
|
15
17
|
"remove-attribute",
|
|
16
18
|
"remove-attributes",
|
|
17
|
-
"remove",
|
|
18
19
|
"svelte",
|
|
19
20
|
"sveltekit",
|
|
21
|
+
"test-id",
|
|
22
|
+
"testid",
|
|
20
23
|
"tool",
|
|
21
24
|
"typescript",
|
|
22
|
-
"vite-plugin",
|
|
23
25
|
"vite",
|
|
24
|
-
"
|
|
26
|
+
"vite-plugin",
|
|
25
27
|
"vue",
|
|
28
|
+
"vue.js",
|
|
26
29
|
"web-development"
|
|
27
30
|
],
|
|
28
31
|
"author": {
|
|
29
|
-
"name": "
|
|
32
|
+
"name": "Alex Castlenine",
|
|
30
33
|
"url": "https://github.com/Castlenine"
|
|
31
34
|
},
|
|
32
|
-
"homepage": "https://github.com/castlenine/vite-remove-attribute",
|
|
35
|
+
"homepage": "https://github.com/castlenine/vite-plugin-remove-attribute",
|
|
33
36
|
"repository": {
|
|
34
37
|
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/castlenine/vite-remove-attribute.git"
|
|
38
|
+
"url": "git+https://github.com/castlenine/vite-plugin-remove-attribute.git"
|
|
36
39
|
},
|
|
37
40
|
"bugs": {
|
|
38
|
-
"url": "https://github.com/castlenine/vite-remove-attribute/issues"
|
|
41
|
+
"url": "https://github.com/castlenine/vite-plugin-remove-attribute/issues"
|
|
39
42
|
},
|
|
40
43
|
"type": "module",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"types": "./dist/index.d.cts",
|
|
46
|
+
"main": "./dist/index.cjs",
|
|
47
|
+
"module": "./dist/index.js",
|
|
44
48
|
"exports": {
|
|
45
49
|
".": {
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"default": "./dist/index.js"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/index.d.cts",
|
|
56
|
+
"default": "./dist/index.cjs"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./package.json": "./package.json"
|
|
50
60
|
},
|
|
51
61
|
"files": [
|
|
52
|
-
"dist"
|
|
62
|
+
"dist",
|
|
63
|
+
"CHANGELOG.md"
|
|
53
64
|
],
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"build": "vite build",
|
|
57
|
-
"preview": "vite preview",
|
|
58
|
-
"package": "npm run remove-dist-folder && npm run build && publint",
|
|
59
|
-
"prepublishOnly": "npm run package",
|
|
60
|
-
"eslint": "eslint --ignore-path ./.eslintignore .",
|
|
61
|
-
"eslint:fix": "eslint --fix --ignore-path ./.eslintignore .",
|
|
62
|
-
"prettier": "prettier --ignore-path ./.prettierignore --check .",
|
|
63
|
-
"prettier:fix": "prettier --ignore-path ./.prettierignore --write .",
|
|
64
|
-
"clean-code": "npm run prettier:fix && npm run eslint:fix",
|
|
65
|
-
"remove-dist-folder": "rimraf dist",
|
|
66
|
-
"publish-package": "npm publish -access public"
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"vite": ">=2.0.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"eslint
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"eslint
|
|
82
|
-
"eslint-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
72
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
73
|
+
"@commitlint/cli": "^21.2.2",
|
|
74
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
75
|
+
"@commitlint/cz-commitlint": "^21.2.2",
|
|
76
|
+
"@commitlint/types": "^21.2.0",
|
|
77
|
+
"@eslint/js": "^10.0.1",
|
|
78
|
+
"@types/node": "^26.6.0",
|
|
79
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
80
|
+
"commitizen": "^4.3.2",
|
|
81
|
+
"eslint": "^10.10.0",
|
|
82
|
+
"eslint-config-prettier": "^10.1.8",
|
|
83
|
+
"eslint-plugin-perfectionist": "^5.11.1",
|
|
84
|
+
"eslint-plugin-security": "^4.0.1",
|
|
85
|
+
"eslint-plugin-sonarjs": "^4.2.1",
|
|
86
|
+
"globals": "^17.12.0",
|
|
87
|
+
"jiti": "^2.7.0",
|
|
88
|
+
"lefthook": "^2.1.14",
|
|
89
|
+
"lint-staged": "^17.5.1",
|
|
90
|
+
"npm-check-updates": "^23.1.0",
|
|
91
|
+
"prettier": "^3.9.6",
|
|
92
|
+
"publint": "^0.3.24",
|
|
93
|
+
"rimraf": "^6.1.3",
|
|
94
|
+
"tslib": "^2.8.1",
|
|
95
|
+
"typescript": "^6.0.3",
|
|
96
|
+
"typescript-eslint": "^8.70.0",
|
|
97
|
+
"vite": "^8.3.0",
|
|
98
|
+
"vite-plugin-dts": "^5.1.0",
|
|
99
|
+
"vitest": "^5.0.1"
|
|
100
|
+
},
|
|
101
|
+
"engines": {
|
|
102
|
+
"node": ">=18.0.0"
|
|
103
|
+
},
|
|
104
|
+
"devEngines": {
|
|
105
|
+
"runtime": {
|
|
106
|
+
"name": "node",
|
|
107
|
+
"version": ">=24.18.0",
|
|
108
|
+
"onFail": "error"
|
|
109
|
+
},
|
|
110
|
+
"packageManager": {
|
|
111
|
+
"name": "pnpm",
|
|
112
|
+
"version": ">=11.0.0",
|
|
113
|
+
"onFail": "error"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"scripts": {
|
|
117
|
+
"remove-dist-folder": "rimraf dist",
|
|
118
|
+
"build": "pnpm remove-dist-folder && vite build",
|
|
119
|
+
"package": "pnpm build && publint && pnpm attw",
|
|
120
|
+
"attw": "rimraf node_modules/.cache/attw && pnpm pack --ignore-scripts --pack-destination node_modules/.cache/attw && attw node_modules/.cache/attw/*.tgz",
|
|
121
|
+
"publish-package": "pnpm publish",
|
|
122
|
+
"type-check": "tsc --noEmit",
|
|
123
|
+
"test": "vitest run",
|
|
124
|
+
"test:watch": "vitest",
|
|
125
|
+
"test:coverage": "vitest run --coverage",
|
|
126
|
+
"lint": "eslint --cache --cache-strategy content --cache-location ./node_modules/.cache/eslint/ .",
|
|
127
|
+
"lint:fix": "eslint --cache --cache-strategy content --cache-location ./node_modules/.cache/eslint/ --fix .",
|
|
128
|
+
"lint:staged": "eslint",
|
|
129
|
+
"lint:staged:fix": "eslint --fix",
|
|
130
|
+
"lint:ci": "eslint .",
|
|
131
|
+
"format": "prettier --cache --write .",
|
|
132
|
+
"format:check": "prettier --cache --check .",
|
|
133
|
+
"format:staged": "prettier --write",
|
|
134
|
+
"clean-code": "pnpm format && pnpm lint:fix",
|
|
135
|
+
"commit": "git status && git-cz",
|
|
136
|
+
"update-packages": "ncu --interactive",
|
|
137
|
+
"update-packages:minor": "ncu --target minor --interactive",
|
|
138
|
+
"update-packages:patch": "ncu --target patch --interactive"
|
|
92
139
|
}
|
|
93
|
-
}
|
|
140
|
+
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAiBvE"}
|
package/dist/index.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(s,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(s=typeof globalThis<"u"?globalThis:s||self,s.RemoveAttributesPlugin=o())})(this,function(){"use strict";const s=["node_modules",".git",".idea",".vscode",".DS_Store","Thumbs.db",".env",".env.*","logs","*.log","public","build",".svelte-kit","dist",".nuxt",".next",".remix","e2e","angular.json","browserslist",".cache"];function o(e){return{extensions:Array.isArray(e.extensions)?e.extensions:[],ignoreFolders:Array.isArray(e.ignoreFolders)?e.ignoreFolders:[],ignoreFiles:Array.isArray(e.ignoreFiles)?e.ignoreFiles:[],attributes:Array.isArray(e.attributes)?e.attributes:[]}}function d(e){const n=[".","./","/","/."],t=f(e.ignoreFolders||[],n).filter(u=>a(u)),r=f(e.ignoreFiles||[],n).filter(u=>g(u));return t.concat(r)}function E(e){return!!e&&typeof e=="string"}function l(e){return e.trim().startsWith("./")?e.substring(2):e.trim()}function c(e,n){return(n??s).some(t=>e.includes(t))}function f(e,n){return[...new Set(e.filter(t=>!n.includes(t)&&E(t)&&l(t).length).map(l))]}function g(e){var n;const[t,...r]=((n=e.split("/").pop())!==null&&n!==void 0?n:"").split(".");return e.length>=3&&r.length>=2&&t.length>=3&&!t.includes("/")}function a(e){return!g(e)&&/^[a-zA-Z0-9_.-/]*$/.test(e)}function A(e,n){return new RegExp(`\\.(${n.extensions.join("|")})$`,"i").test(e)}function I(e,n){return n.reduce((t,r)=>{const i=new RegExp(`(\\s(:|v-bind:)?${r}\\s*=\\s*(['"\`])((?:(?!\\3).)*)(\\3))|(\\s(:|v-bind:)?${r}(?=[\\s>]))`,"gi");return t.replace(i,"")},e)}function _(e){const n=o(e),t=d(n);return{name:"remove-attributes",enforce:"pre",transform(r,i){return c(i)||c(i,t)||!A(i,n)?r:I(r,n.attributes)}}}return _});
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,YAAY,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/utilities.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAoDvC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAOpD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAO1D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAEnE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEnF;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG5C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG9C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAIlE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAM5E"}
|