@html-validate/plugin-template 0.0.1 → 1.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/LICENSE +20 -0
- package/README.md +6 -40
- package/dist/cjs/index.cjs +84 -0
- package/dist/cjs/index.cjs.map +7 -0
- package/dist/cjs/index.d.cts +6 -0
- package/dist/esm/index.d.mts +9 -0
- package/dist/esm/index.mjs +82 -0
- package/dist/esm/index.mjs.map +7 -0
- package/package.json +47 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2026 David Sveningsson <ext@sidvind.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,11 @@
|
|
|
1
1
|
# @html-validate/plugin-template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Cloneman] template for [HTML-Validate][html-validate] plugins.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[cloneman]: https://github.com/Forsakringskassan/cloneman
|
|
6
|
+
[html-validate]: https://www.npmjs.com/package/html-validate
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## Usage
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@html-validate/plugin-template`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|
|
10
|
+
npx cloneman create awesome-plugin @html-validate/plugin-template
|
|
11
|
+
npx cloneman update
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
var import_html_validate3 = require("html-validate");
|
|
5
|
+
|
|
6
|
+
// package.json
|
|
7
|
+
var name = "@html-validate/plugin-template";
|
|
8
|
+
var peerDependencies = {
|
|
9
|
+
"html-validate": "^8.21.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/elements.ts
|
|
13
|
+
var import_html_validate = require("html-validate");
|
|
14
|
+
var elements_default = (0, import_html_validate.defineMetadata)({
|
|
15
|
+
"custom-component": {
|
|
16
|
+
flow: true,
|
|
17
|
+
attributes: {
|
|
18
|
+
value: {
|
|
19
|
+
required: true,
|
|
20
|
+
enum: ["yes", "no"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/configs/recommended.ts
|
|
27
|
+
function createConfig() {
|
|
28
|
+
return {
|
|
29
|
+
elements: [elements_default],
|
|
30
|
+
rules: {
|
|
31
|
+
"awesome-plugin/custom-rule": "error"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
var recommended_default = createConfig();
|
|
36
|
+
|
|
37
|
+
// src/configs/index.ts
|
|
38
|
+
var configs_default = {
|
|
39
|
+
recommended: recommended_default
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// src/rules/custom-rule.ts
|
|
43
|
+
var import_html_validate2 = require("html-validate");
|
|
44
|
+
var CustomRule = class extends import_html_validate2.Rule {
|
|
45
|
+
documentation() {
|
|
46
|
+
return {
|
|
47
|
+
description: "Lorem ipsum dolor sit amet."
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
setup() {
|
|
51
|
+
this.on("dom:ready", (event) => {
|
|
52
|
+
const { document } = event;
|
|
53
|
+
for (const node of document.querySelectorAll("custom-component")) {
|
|
54
|
+
const attr = node.getAttribute("value");
|
|
55
|
+
if (attr?.value === "no") {
|
|
56
|
+
this.report({
|
|
57
|
+
node,
|
|
58
|
+
message: "lorem ipsum"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// src/rules/index.ts
|
|
67
|
+
var rules = {
|
|
68
|
+
"awesome-plugin/custom-rule": CustomRule
|
|
69
|
+
};
|
|
70
|
+
var rules_default = rules;
|
|
71
|
+
|
|
72
|
+
// src/index.ts
|
|
73
|
+
var range = peerDependencies["html-validate"];
|
|
74
|
+
(0, import_html_validate3.compatibilityCheck)(name, range);
|
|
75
|
+
var plugin = {
|
|
76
|
+
name,
|
|
77
|
+
configs: configs_default,
|
|
78
|
+
rules: rules_default
|
|
79
|
+
};
|
|
80
|
+
var src_default = plugin;
|
|
81
|
+
|
|
82
|
+
// src/entry-cjs.ts
|
|
83
|
+
module.exports = src_default;
|
|
84
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../package.json", "../../src/elements.ts", "../../src/configs/recommended.ts", "../../src/configs/index.ts", "../../src/rules/custom-rule.ts", "../../src/rules/index.ts", "../../src/entry-cjs.ts"],
|
|
4
|
+
"sourcesContent": ["import { type Plugin, compatibilityCheck } from \"html-validate\";\nimport { name, peerDependencies } from \"../package.json\";\nimport configs from \"./configs\";\nimport rules from \"./rules\";\n\nconst range = peerDependencies[\"html-validate\"];\n\n/* eslint-disable-next-line unicorn/no-top-level-side-effects -- intentional side-effect */\ncompatibilityCheck(name, range);\n\nconst plugin: Plugin = {\n\tname,\n\tconfigs,\n\trules,\n};\n\nexport default plugin;\n", "{\n \"name\": \"@html-validate/plugin-template\",\n \"version\": \"0.0.0\",\n \"description\": \"cloneman template for html-validate plugins\",\n \"keywords\": [\n \"cloneman\",\n \"html-validate\"\n ],\n \"homepage\": \"https://gitlab.com/html-validate/plugin-template\",\n \"bugs\": {\n \"url\": \"https://gitlab.com/html-validate/plugin-template/-/work_items/new?type=Issue\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://gitlab.com/html-validate/plugin-template.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"David Sveningsson <ext@sidvind.com>\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/esm/index.d.mts\",\n \"default\": \"./dist/esm/index.mjs\"\n },\n \"require\": {\n \"types\": \"./dist/cjs/index.d.cts\",\n \"default\": \"./dist/cjs/index.cjs\"\n }\n }\n },\n \"main\": \"dist/cjs/index.cjs\",\n \"module\": \"dist/esm/index.mjs\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"prebuild\": \"tsc\",\n \"build\": \"run-s build:*\",\n \"postbuild\": \"cloneman build -o temp/cloneman\",\n \"build:lib\": \"node build.mjs\",\n \"build:cjs\": \"dts-bundle-generator --no-banner --project tsconfig.cjs.json -o dist/cjs/index.d.cts src/entry-cjs.ts\",\n \"build:esm\": \"dts-bundle-generator --no-banner --project tsconfig.esm.json -o dist/esm/index.d.mts src/entry-esm.ts\",\n \"eslint\": \"eslint --cache .\",\n \"eslint:fix\": \"eslint --cache --fix .\",\n \"prepack\": \"release-prepack package.json --bundle\",\n \"postpack\": \"release-postpack package.json\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"release-prepack package.json --bundle\",\n \"prettier:check\": \"prettier --check .\",\n \"prettier:write\": \"prettier --write .\",\n \"postpublish\": \"release-postpack package.json\",\n \"attw\": \"attw --no-emoji --pack .\",\n \"test\": \"jest\"\n },\n \"commitlint\": {\n \"extends\": \"@html-validate\"\n },\n \"prettier\": \"@html-validate/prettier-config\",\n \"release\": {\n \"extends\": \"@html-validate/semantic-release-config\"\n },\n \"jest\": {\n \"preset\": \"@html-validate/jest-config\"\n },\n \"dependencies\": {\n \"@html-validate/plugin-utils\": \"^4.0.0\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/cli\": \"0.18.3\",\n \"@html-validate/commitlint-config\": \"4.0.2\",\n \"@html-validate/eslint-config\": \"9.5.0\",\n \"@html-validate/eslint-config-jest\": \"9.5.0\",\n \"@html-validate/eslint-config-typescript\": \"9.5.0\",\n \"@html-validate/eslint-config-typescript-typeinfo\": \"9.5.0\",\n \"@html-validate/jest-config\": \"3.18.2\",\n \"@html-validate/prettier-config\": \"4.1.1\",\n \"@html-validate/release-scripts\": \"7.2.4\",\n \"@jest/globals\": \"30.4.1\",\n \"@tsconfig/node22\": \"22.0.5\",\n \"@tsconfig/strictest\": \"2.0.8\",\n \"@types/estree\": \"1.0.9\",\n \"@types/node\": \"22.19.21\",\n \"@types/semver\": \"7.7.1\",\n \"cloneman\": \"1.18.0\",\n \"dts-bundle-generator\": \"9.5.1\",\n \"esbuild\": \"0.28.1\",\n \"html-validate\": \"11.5.3\",\n \"husky\": \"9.1.7\",\n \"jest\": \"30.4.2\",\n \"jest-environment-jsdom\": \"30.4.1\",\n \"npm-pkg-lint\": \"5.1.7\",\n \"npm-run-all2\": \"9.0.2\",\n \"semver\": \"7.8.4\",\n \"ts-jest\": \"29.4.11\",\n \"typescript\": \"6.0.3\"\n },\n \"peerDependencies\": {\n \"html-validate\": \"^8.21.0 || ^9.0.0 || ^10.0.0 || ^11.0.0\"\n },\n \"engines\": {\n \"node\": \"^22.16 || >= 24\"\n },\n \"allowScripts\": {\n \"@html-validate/commitlint-config\": true,\n \"esbuild\": true,\n \"fsevents\": false,\n \"unrs-resolver\": true\n },\n \"externalDependencies\": [\n \"@html-validate/plugin-utils\"\n ]\n}\n", "import { defineMetadata } from \"html-validate\";\n\nexport default defineMetadata({\n\t\"custom-component\": {\n\t\tflow: true,\n\t\tattributes: {\n\t\t\tvalue: {\n\t\t\t\trequired: true,\n\t\t\t\tenum: [\"yes\", \"no\"],\n\t\t\t},\n\t\t},\n\t},\n});\n", "import { type ConfigData } from \"html-validate\";\nimport elements from \"../elements\";\n\nexport function createConfig(): ConfigData {\n\treturn {\n\t\telements: [elements],\n\t\trules: {\n\t\t\t\"awesome-plugin/custom-rule\": \"error\",\n\t\t},\n\t};\n}\n\nexport default createConfig();\n", "import recommended from \"./recommended\";\n\nexport default {\n\trecommended,\n};\n", "import { type RuleDocumentation, Rule } from \"html-validate\";\n\nexport class CustomRule extends Rule {\n\tpublic override documentation(): RuleDocumentation {\n\t\treturn {\n\t\t\tdescription: \"Lorem ipsum dolor sit amet.\",\n\t\t};\n\t}\n\n\tpublic setup(): void {\n\t\tthis.on(\"dom:ready\", (event) => {\n\t\t\tconst { document } = event;\n\t\t\tfor (const node of document.querySelectorAll(\"custom-component\")) {\n\t\t\t\tconst attr = node.getAttribute(\"value\");\n\t\t\t\tif (attr?.value === \"no\") {\n\t\t\t\t\tthis.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessage: \"lorem ipsum\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n", "import { CustomRule } from \"./custom-rule\";\n\nconst rules = {\n\t\"awesome-plugin/custom-rule\": CustomRule,\n};\n\nexport default rules;\n", "/* istanbul ignore file */\n\nimport plugin from \"./index\";\n\nexport = plugin;\n"],
|
|
5
|
+
"mappings": ";;;AAAA,IAAAA,wBAAgD;;;ACC9C,WAAQ;AA+FR,uBAAoB;AAAA,EAClB,iBAAiB;AACnB;;;AClGF,2BAA+B;AAE/B,IAAO,uBAAQ,qCAAe;AAAA,EAC7B,oBAAoB;AAAA,IACnB,MAAM;AAAA,IACN,YAAY;AAAA,MACX,OAAO;AAAA,QACN,UAAU;AAAA,QACV,MAAM,CAAC,OAAO,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AACD,CAAC;;;ACTM,SAAS,eAA2B;AAC1C,SAAO;AAAA,IACN,UAAU,CAAC,gBAAQ;AAAA,IACnB,OAAO;AAAA,MACN,8BAA8B;AAAA,IAC/B;AAAA,EACD;AACD;AAEA,IAAO,sBAAQ,aAAa;;;ACV5B,IAAO,kBAAQ;AAAA,EACd;AACD;;;ACJA,IAAAC,wBAA6C;AAEtC,IAAM,aAAN,cAAyB,2BAAK;AAAA,EACpB,gBAAmC;AAClD,WAAO;AAAA,MACN,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EAEO,QAAc;AACpB,SAAK,GAAG,aAAa,CAAC,UAAU;AAC/B,YAAM,EAAE,SAAS,IAAI;AACrB,iBAAW,QAAQ,SAAS,iBAAiB,kBAAkB,GAAG;AACjE,cAAM,OAAO,KAAK,aAAa,OAAO;AACtC,YAAI,MAAM,UAAU,MAAM;AACzB,eAAK,OAAO;AAAA,YACX;AAAA,YACA,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;;;ACrBA,IAAM,QAAQ;AAAA,EACb,8BAA8B;AAC/B;AAEA,IAAO,gBAAQ;;;ANDf,IAAM,QAAQ,iBAAiB,eAAe;AAAA,IAG9C,0CAAmB,MAAM,KAAK;AAE9B,IAAM,SAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAO,cAAQ;;;AOZf,iBAAS;",
|
|
6
|
+
"names": ["import_html_validate", "import_html_validate"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { compatibilityCheck } from "html-validate";
|
|
3
|
+
|
|
4
|
+
// package.json
|
|
5
|
+
var name = "@html-validate/plugin-template";
|
|
6
|
+
var peerDependencies = {
|
|
7
|
+
"html-validate": "^8.21.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// src/elements.ts
|
|
11
|
+
import { defineMetadata } from "html-validate";
|
|
12
|
+
var elements_default = defineMetadata({
|
|
13
|
+
"custom-component": {
|
|
14
|
+
flow: true,
|
|
15
|
+
attributes: {
|
|
16
|
+
value: {
|
|
17
|
+
required: true,
|
|
18
|
+
enum: ["yes", "no"]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// src/configs/recommended.ts
|
|
25
|
+
function createConfig() {
|
|
26
|
+
return {
|
|
27
|
+
elements: [elements_default],
|
|
28
|
+
rules: {
|
|
29
|
+
"awesome-plugin/custom-rule": "error"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
var recommended_default = createConfig();
|
|
34
|
+
|
|
35
|
+
// src/configs/index.ts
|
|
36
|
+
var configs_default = {
|
|
37
|
+
recommended: recommended_default
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/rules/custom-rule.ts
|
|
41
|
+
import { Rule } from "html-validate";
|
|
42
|
+
var CustomRule = class extends Rule {
|
|
43
|
+
documentation() {
|
|
44
|
+
return {
|
|
45
|
+
description: "Lorem ipsum dolor sit amet."
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
setup() {
|
|
49
|
+
this.on("dom:ready", (event) => {
|
|
50
|
+
const { document } = event;
|
|
51
|
+
for (const node of document.querySelectorAll("custom-component")) {
|
|
52
|
+
const attr = node.getAttribute("value");
|
|
53
|
+
if (attr?.value === "no") {
|
|
54
|
+
this.report({
|
|
55
|
+
node,
|
|
56
|
+
message: "lorem ipsum"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// src/rules/index.ts
|
|
65
|
+
var rules = {
|
|
66
|
+
"awesome-plugin/custom-rule": CustomRule
|
|
67
|
+
};
|
|
68
|
+
var rules_default = rules;
|
|
69
|
+
|
|
70
|
+
// src/index.ts
|
|
71
|
+
var range = peerDependencies["html-validate"];
|
|
72
|
+
compatibilityCheck(name, range);
|
|
73
|
+
var plugin = {
|
|
74
|
+
name,
|
|
75
|
+
configs: configs_default,
|
|
76
|
+
rules: rules_default
|
|
77
|
+
};
|
|
78
|
+
var src_default = plugin;
|
|
79
|
+
export {
|
|
80
|
+
src_default as default
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../package.json", "../../src/elements.ts", "../../src/configs/recommended.ts", "../../src/configs/index.ts", "../../src/rules/custom-rule.ts", "../../src/rules/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { type Plugin, compatibilityCheck } from \"html-validate\";\nimport { name, peerDependencies } from \"../package.json\";\nimport configs from \"./configs\";\nimport rules from \"./rules\";\n\nconst range = peerDependencies[\"html-validate\"];\n\n/* eslint-disable-next-line unicorn/no-top-level-side-effects -- intentional side-effect */\ncompatibilityCheck(name, range);\n\nconst plugin: Plugin = {\n\tname,\n\tconfigs,\n\trules,\n};\n\nexport default plugin;\n", "{\n \"name\": \"@html-validate/plugin-template\",\n \"version\": \"0.0.0\",\n \"description\": \"cloneman template for html-validate plugins\",\n \"keywords\": [\n \"cloneman\",\n \"html-validate\"\n ],\n \"homepage\": \"https://gitlab.com/html-validate/plugin-template\",\n \"bugs\": {\n \"url\": \"https://gitlab.com/html-validate/plugin-template/-/work_items/new?type=Issue\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://gitlab.com/html-validate/plugin-template.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"David Sveningsson <ext@sidvind.com>\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/esm/index.d.mts\",\n \"default\": \"./dist/esm/index.mjs\"\n },\n \"require\": {\n \"types\": \"./dist/cjs/index.d.cts\",\n \"default\": \"./dist/cjs/index.cjs\"\n }\n }\n },\n \"main\": \"dist/cjs/index.cjs\",\n \"module\": \"dist/esm/index.mjs\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"prebuild\": \"tsc\",\n \"build\": \"run-s build:*\",\n \"postbuild\": \"cloneman build -o temp/cloneman\",\n \"build:lib\": \"node build.mjs\",\n \"build:cjs\": \"dts-bundle-generator --no-banner --project tsconfig.cjs.json -o dist/cjs/index.d.cts src/entry-cjs.ts\",\n \"build:esm\": \"dts-bundle-generator --no-banner --project tsconfig.esm.json -o dist/esm/index.d.mts src/entry-esm.ts\",\n \"eslint\": \"eslint --cache .\",\n \"eslint:fix\": \"eslint --cache --fix .\",\n \"prepack\": \"release-prepack package.json --bundle\",\n \"postpack\": \"release-postpack package.json\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"release-prepack package.json --bundle\",\n \"prettier:check\": \"prettier --check .\",\n \"prettier:write\": \"prettier --write .\",\n \"postpublish\": \"release-postpack package.json\",\n \"attw\": \"attw --no-emoji --pack .\",\n \"test\": \"jest\"\n },\n \"commitlint\": {\n \"extends\": \"@html-validate\"\n },\n \"prettier\": \"@html-validate/prettier-config\",\n \"release\": {\n \"extends\": \"@html-validate/semantic-release-config\"\n },\n \"jest\": {\n \"preset\": \"@html-validate/jest-config\"\n },\n \"dependencies\": {\n \"@html-validate/plugin-utils\": \"^4.0.0\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/cli\": \"0.18.3\",\n \"@html-validate/commitlint-config\": \"4.0.2\",\n \"@html-validate/eslint-config\": \"9.5.0\",\n \"@html-validate/eslint-config-jest\": \"9.5.0\",\n \"@html-validate/eslint-config-typescript\": \"9.5.0\",\n \"@html-validate/eslint-config-typescript-typeinfo\": \"9.5.0\",\n \"@html-validate/jest-config\": \"3.18.2\",\n \"@html-validate/prettier-config\": \"4.1.1\",\n \"@html-validate/release-scripts\": \"7.2.4\",\n \"@jest/globals\": \"30.4.1\",\n \"@tsconfig/node22\": \"22.0.5\",\n \"@tsconfig/strictest\": \"2.0.8\",\n \"@types/estree\": \"1.0.9\",\n \"@types/node\": \"22.19.21\",\n \"@types/semver\": \"7.7.1\",\n \"cloneman\": \"1.18.0\",\n \"dts-bundle-generator\": \"9.5.1\",\n \"esbuild\": \"0.28.1\",\n \"html-validate\": \"11.5.3\",\n \"husky\": \"9.1.7\",\n \"jest\": \"30.4.2\",\n \"jest-environment-jsdom\": \"30.4.1\",\n \"npm-pkg-lint\": \"5.1.7\",\n \"npm-run-all2\": \"9.0.2\",\n \"semver\": \"7.8.4\",\n \"ts-jest\": \"29.4.11\",\n \"typescript\": \"6.0.3\"\n },\n \"peerDependencies\": {\n \"html-validate\": \"^8.21.0 || ^9.0.0 || ^10.0.0 || ^11.0.0\"\n },\n \"engines\": {\n \"node\": \"^22.16 || >= 24\"\n },\n \"allowScripts\": {\n \"@html-validate/commitlint-config\": true,\n \"esbuild\": true,\n \"fsevents\": false,\n \"unrs-resolver\": true\n },\n \"externalDependencies\": [\n \"@html-validate/plugin-utils\"\n ]\n}\n", "import { defineMetadata } from \"html-validate\";\n\nexport default defineMetadata({\n\t\"custom-component\": {\n\t\tflow: true,\n\t\tattributes: {\n\t\t\tvalue: {\n\t\t\t\trequired: true,\n\t\t\t\tenum: [\"yes\", \"no\"],\n\t\t\t},\n\t\t},\n\t},\n});\n", "import { type ConfigData } from \"html-validate\";\nimport elements from \"../elements\";\n\nexport function createConfig(): ConfigData {\n\treturn {\n\t\telements: [elements],\n\t\trules: {\n\t\t\t\"awesome-plugin/custom-rule\": \"error\",\n\t\t},\n\t};\n}\n\nexport default createConfig();\n", "import recommended from \"./recommended\";\n\nexport default {\n\trecommended,\n};\n", "import { type RuleDocumentation, Rule } from \"html-validate\";\n\nexport class CustomRule extends Rule {\n\tpublic override documentation(): RuleDocumentation {\n\t\treturn {\n\t\t\tdescription: \"Lorem ipsum dolor sit amet.\",\n\t\t};\n\t}\n\n\tpublic setup(): void {\n\t\tthis.on(\"dom:ready\", (event) => {\n\t\t\tconst { document } = event;\n\t\t\tfor (const node of document.querySelectorAll(\"custom-component\")) {\n\t\t\t\tconst attr = node.getAttribute(\"value\");\n\t\t\t\tif (attr?.value === \"no\") {\n\t\t\t\t\tthis.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessage: \"lorem ipsum\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n", "import { CustomRule } from \"./custom-rule\";\n\nconst rules = {\n\t\"awesome-plugin/custom-rule\": CustomRule,\n};\n\nexport default rules;\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAsB,0BAA0B;;;ACC9C,WAAQ;AA+FR,uBAAoB;AAAA,EAClB,iBAAiB;AACnB;;;AClGF,SAAS,sBAAsB;AAE/B,IAAO,mBAAQ,eAAe;AAAA,EAC7B,oBAAoB;AAAA,IACnB,MAAM;AAAA,IACN,YAAY;AAAA,MACX,OAAO;AAAA,QACN,UAAU;AAAA,QACV,MAAM,CAAC,OAAO,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AACD,CAAC;;;ACTM,SAAS,eAA2B;AAC1C,SAAO;AAAA,IACN,UAAU,CAAC,gBAAQ;AAAA,IACnB,OAAO;AAAA,MACN,8BAA8B;AAAA,IAC/B;AAAA,EACD;AACD;AAEA,IAAO,sBAAQ,aAAa;;;ACV5B,IAAO,kBAAQ;AAAA,EACd;AACD;;;ACJA,SAAiC,YAAY;AAEtC,IAAM,aAAN,cAAyB,KAAK;AAAA,EACpB,gBAAmC;AAClD,WAAO;AAAA,MACN,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EAEO,QAAc;AACpB,SAAK,GAAG,aAAa,CAAC,UAAU;AAC/B,YAAM,EAAE,SAAS,IAAI;AACrB,iBAAW,QAAQ,SAAS,iBAAiB,kBAAkB,GAAG;AACjE,cAAM,OAAO,KAAK,aAAa,OAAO;AACtC,YAAI,MAAM,UAAU,MAAM;AACzB,eAAK,OAAO;AAAA,YACX;AAAA,YACA,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;;;ACrBA,IAAM,QAAQ;AAAA,EACb,8BAA8B;AAC/B;AAEA,IAAO,gBAAQ;;;ANDf,IAAM,QAAQ,iBAAiB,eAAe;AAG9C,mBAAmB,MAAM,KAAK;AAE9B,IAAM,SAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAO,cAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/plugin-template",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "cloneman template for html-validate plugins",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
"cloneman",
|
|
7
|
+
"html-validate"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://gitlab.com/html-validate/plugin-template",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://gitlab.com/html-validate/plugin-template/-/work_items/new?type=Issue"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://gitlab.com/html-validate/plugin-template.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "David Sveningsson <ext@sidvind.com>",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/esm/index.d.mts",
|
|
23
|
+
"default": "./dist/esm/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/cjs/index.d.cts",
|
|
27
|
+
"default": "./dist/cjs/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "dist/cjs/index.cjs",
|
|
32
|
+
"module": "dist/esm/index.mjs",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@html-validate/plugin-utils": "^4.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"html-validate": "^8.21.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": "^22.16 || >= 24"
|
|
44
|
+
},
|
|
45
|
+
"allowScripts": {
|
|
46
|
+
"@html-validate/commitlint-config": true,
|
|
47
|
+
"esbuild": true,
|
|
48
|
+
"fsevents": false,
|
|
49
|
+
"unrs-resolver": true
|
|
50
|
+
}
|
|
10
51
|
}
|