@flint.fyi/css 0.0.1 → 0.0.2
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.md +20 -0
- package/README.md +5 -44
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/plugin.d.ts +14 -0
- package/lib/plugin.js +12 -0
- package/lib/ruleCreator.d.ts +3 -0
- package/lib/ruleCreator.js +11 -0
- package/lib/rules/hexColorValidity.d.ts +10 -0
- package/lib/rules/hexColorValidity.js +29 -0
- package/package.json +42 -8
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center"><code>@flint.fyi/css</code></h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@flint.fyi/css`
|
|
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**
|
|
3
|
+
<p align="center">
|
|
4
|
+
[Experimental] A Flint plugin for CSS code.
|
|
5
|
+
❤️🔥
|
|
6
|
+
</p>
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
package/lib/plugin.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _flint_fyi_core0 from "@flint.fyi/core";
|
|
2
|
+
|
|
3
|
+
//#region src/plugin.d.ts
|
|
4
|
+
declare const css: _flint_fyi_core0.Plugin<_flint_fyi_core0.RuleAbout<string>, "all", [_flint_fyi_core0.Rule<{
|
|
5
|
+
readonly description: "Reports hex colors with invalid values.";
|
|
6
|
+
readonly id: "hexColorValidity";
|
|
7
|
+
readonly presets: readonly ["logical"];
|
|
8
|
+
} & {
|
|
9
|
+
readonly pluginId: string;
|
|
10
|
+
readonly url: string;
|
|
11
|
+
}, "invalid", undefined>]>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { css };
|
|
14
|
+
//# sourceMappingURL=plugin.d.ts.map
|
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import hexColorValidity_default from "./rules/hexColorValidity.js";
|
|
2
|
+
import { createPlugin } from "@flint.fyi/core";
|
|
3
|
+
//#region src/plugin.ts
|
|
4
|
+
const css = createPlugin({
|
|
5
|
+
files: { all: ["**/*.css"] },
|
|
6
|
+
name: "CSS",
|
|
7
|
+
rules: [hexColorValidity_default]
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { css };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RuleCreator } from "@flint.fyi/core";
|
|
2
|
+
//#region src/ruleCreator.ts
|
|
3
|
+
const ruleCreator = new RuleCreator({
|
|
4
|
+
docs: (ruleId) => `https://flint.fyi/rules/css/${ruleId.toLowerCase()}`,
|
|
5
|
+
pluginId: "css",
|
|
6
|
+
presets: ["logical"]
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ruleCreator };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=ruleCreator.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: import("@flint.fyi/core").Rule<{
|
|
2
|
+
readonly description: "Reports hex colors with invalid values.";
|
|
3
|
+
readonly id: "hexColorValidity";
|
|
4
|
+
readonly presets: readonly ["logical"];
|
|
5
|
+
} & {
|
|
6
|
+
readonly pluginId: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
}, "invalid", undefined>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=hexColorValidity.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ruleCreator } from "../ruleCreator.js";
|
|
2
|
+
import { cssLanguage, getCssNodeRange } from "@flint.fyi/css-language";
|
|
3
|
+
//#region src/rules/hexColorValidity.ts
|
|
4
|
+
const validityTester = /^(?:[0-9a-f]{3,4}){1,2}$/i;
|
|
5
|
+
var hexColorValidity_default = ruleCreator.createRule(cssLanguage, {
|
|
6
|
+
about: {
|
|
7
|
+
description: "Reports hex colors with invalid values.",
|
|
8
|
+
id: "hexColorValidity",
|
|
9
|
+
presets: ["logical"]
|
|
10
|
+
},
|
|
11
|
+
messages: { invalid: {
|
|
12
|
+
primary: "The hex value `{{ value }}` is invalid.",
|
|
13
|
+
secondary: ["Valid CSS hex colors must have 3, 4, 6, or 8 digits or letters in `a-f` after the `#`.", "This value does not match that criteria."],
|
|
14
|
+
suggestions: ["Fix the value to be a valid CSS hex color."]
|
|
15
|
+
} },
|
|
16
|
+
setup(context) {
|
|
17
|
+
return { visitors: { Hash: (node) => {
|
|
18
|
+
if (!validityTester.test(node.value)) context.report({
|
|
19
|
+
data: { value: node.value },
|
|
20
|
+
message: "invalid",
|
|
21
|
+
range: getCssNodeRange(node)
|
|
22
|
+
});
|
|
23
|
+
} } };
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { hexColorValidity_default as default };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=hexColorValidity.js.map
|
package/package.json
CHANGED
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flint.fyi/css",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "[Experimental] A Flint plugin for CSS code.",
|
|
5
|
+
"homepage": "https://flint.fyi/rules/css",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/flint-fyi/flint.git",
|
|
9
|
+
"directory": "packages/css"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Flint Team",
|
|
14
|
+
"url": "https://flint.fyi/team"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"type": "module",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"lib/",
|
|
23
|
+
"!lib/**/*.map"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"typescript": "^5.9.3 || ^6.0.0",
|
|
27
|
+
"@flint.fyi/css-language": "^0.0.2",
|
|
28
|
+
"@flint.fyi/core": "^0.23.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tsdown": "0.21.0",
|
|
32
|
+
"vitest": "4.1.0",
|
|
33
|
+
"@flint.fyi/rule-tester": "^0.16.4"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=24.0.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "vitest --project css"
|
|
43
|
+
}
|
|
44
|
+
}
|