@flint.fyi/css 0.0.1 → 0.1.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.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
- # @flint.fyi/css
1
+ <h1 align="center"><code>@flint.fyi/css</code></h1>
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
4
-
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
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
@@ -0,0 +1,2 @@
1
+ import { css } from "./plugin.js";
2
+ export { css };
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { css } from "./plugin.js";
2
+ export { css };
@@ -0,0 +1,11 @@
1
+ //#region src/plugin.d.ts
2
+ declare const css: import("@flint.fyi/core").Plugin<import("@flint.fyi/core").RuleAbout<string>, "all", [import("@flint.fyi/core").Rule<{
3
+ readonly description: "Reports hex colors with invalid values.";
4
+ readonly id: "hexColorValidity";
5
+ readonly presets: readonly ["logical"];
6
+ } & {
7
+ readonly pluginId: string;
8
+ readonly url: string;
9
+ }, "invalid", undefined>]>;
10
+ //#endregion
11
+ export { css };
package/lib/plugin.js ADDED
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,2 @@
1
+ import { RuleCreator } from "@flint.fyi/core";
2
+ export declare const ruleCreator: RuleCreator<"logical", import("@flint.fyi/core").RuleAbout<"logical">>;
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,27 @@
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 };
package/package.json CHANGED
@@ -1,10 +1,43 @@
1
1
  {
2
2
  "name": "@flint.fyi/css",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @flint.fyi/css",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
3
+ "version": "0.1.0",
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
+ ],
24
+ "dependencies": {
25
+ "typescript": "^6.0.0",
26
+ "@flint.fyi/css-language": "^0.0.2",
27
+ "@flint.fyi/core": "^0.23.3"
28
+ },
29
+ "devDependencies": {
30
+ "tsdown": "0.22.3",
31
+ "vitest": "4.1.0",
32
+ "@flint.fyi/rule-tester": "^0.16.4"
33
+ },
34
+ "engines": {
35
+ "node": ">=24.0.0"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "test": "vitest --project css"
42
+ }
43
+ }