@lukeashford/aurelius 2.1.0 → 2.3.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/README.md +1 -3
- package/dist/index.d.mts +577 -2
- package/dist/index.d.ts +577 -2
- package/dist/index.js +2683 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2624 -162
- package/dist/index.mjs.map +1 -1
- package/dist/styles/base.css +4 -0
- package/dist/styles/prose.css +61 -0
- package/dist/styles/theme.css +230 -42
- package/llms.md +39 -3
- package/package.json +19 -5
- package/scripts/eslint.mjs +127 -117
package/scripts/eslint.mjs
CHANGED
|
@@ -1,117 +1,127 @@
|
|
|
1
|
-
// scripts/eslint.mjs
|
|
2
|
-
import eslintPluginBetterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
3
|
-
import poupeTailwindcss from '@poupe/eslint-plugin-tailwindcss';
|
|
4
|
-
import css from '@eslint/css';
|
|
5
|
-
import {
|
|
6
|
-
import tsParser from '@typescript-eslint/parser';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {Object} AureliusESLintOptions
|
|
10
|
-
* @property {string} [entryPoint] - Path to your CSS entry file that imports Aurelius. Defaults to
|
|
11
|
-
* './src/index.css'
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Creates an ESLint configuration that enforces Aurelius design system constraints.
|
|
16
|
-
*
|
|
17
|
-
* This configuration:
|
|
18
|
-
* - Prevents arbitrary Tailwind values (e.g., bg-[#123])
|
|
19
|
-
* - Enforces only Aurelius-approved Tailwind classes
|
|
20
|
-
* - Validates Tailwind v4 CSS usage
|
|
21
|
-
*
|
|
22
|
-
* @param {AureliusESLintOptions} [options={}] - Configuration options
|
|
23
|
-
* @returns {any[]} ESLint configuration array
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* // With default entry point (./src/index.css)
|
|
27
|
-
* import { createAureliusESLintConfig } from '@lukeashford/aurelius/eslint';
|
|
28
|
-
* export default createAureliusESLintConfig();
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // With custom entry point
|
|
32
|
-
* import { createAureliusESLintConfig } from '@lukeashford/aurelius/eslint';
|
|
33
|
-
* export default createAureliusESLintConfig({ entryPoint: './app/styles.css' });
|
|
34
|
-
*/
|
|
35
|
-
export function createAureliusESLintConfig(options = {}) {
|
|
36
|
-
const {entryPoint = './src/index.css'} = options;
|
|
37
|
-
|
|
38
|
-
return [
|
|
39
|
-
// Ignore generated files
|
|
40
|
-
{
|
|
41
|
-
ignores: ['**/generated/**'],
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
// JS/TS/React files: enforce allowed Tailwind classes only
|
|
45
|
-
{
|
|
46
|
-
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
47
|
-
languageOptions: {
|
|
48
|
-
parser: tsParser,
|
|
49
|
-
parserOptions: {
|
|
50
|
-
ecmaVersion: 'latest',
|
|
51
|
-
sourceType: 'module',
|
|
52
|
-
ecmaFeatures: {
|
|
53
|
-
jsx: true,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
plugins: {
|
|
58
|
-
'better-tailwindcss': eslintPluginBetterTailwindcss,
|
|
59
|
-
},
|
|
60
|
-
settings: {
|
|
61
|
-
'better-tailwindcss': {
|
|
62
|
-
entryPoint,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
rules: {
|
|
66
|
-
// Only Tailwind-known classes (no custom classnames)
|
|
67
|
-
'better-tailwindcss/no-unknown-classes': [
|
|
68
|
-
'error',
|
|
69
|
-
{
|
|
70
|
-
// Allow custom classes when they are defined using Aurelius/Tailwind utilities
|
|
71
|
-
// (e.g., `@utility x { @apply bg-obsidian text-white; }`).
|
|
72
|
-
// This still blocks any class that isn't generated from the Aurelius-based
|
|
73
|
-
// Tailwind pipeline, so "a&b"-style composites are fine but "c" isn't if
|
|
74
|
-
// it doesn't come from Aurelius tokens.
|
|
75
|
-
detectComponentClasses: true,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
// scripts/eslint.mjs
|
|
2
|
+
import eslintPluginBetterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
3
|
+
import poupeTailwindcss from '@poupe/eslint-plugin-tailwindcss';
|
|
4
|
+
import css from '@eslint/css';
|
|
5
|
+
import {tailwind4} from 'tailwind-csstree';
|
|
6
|
+
import tsParser from '@typescript-eslint/parser';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} AureliusESLintOptions
|
|
10
|
+
* @property {string} [entryPoint] - Path to your CSS entry file that imports Aurelius. Defaults to
|
|
11
|
+
* './src/index.css'
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Creates an ESLint configuration that enforces Aurelius design system constraints.
|
|
16
|
+
*
|
|
17
|
+
* This configuration:
|
|
18
|
+
* - Prevents arbitrary Tailwind values (e.g., bg-[#123])
|
|
19
|
+
* - Enforces only Aurelius-approved Tailwind classes
|
|
20
|
+
* - Validates Tailwind v4 CSS usage
|
|
21
|
+
*
|
|
22
|
+
* @param {AureliusESLintOptions} [options={}] - Configuration options
|
|
23
|
+
* @returns {any[]} ESLint configuration array
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // With default entry point (./src/index.css)
|
|
27
|
+
* import { createAureliusESLintConfig } from '@lukeashford/aurelius/eslint';
|
|
28
|
+
* export default createAureliusESLintConfig();
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // With custom entry point
|
|
32
|
+
* import { createAureliusESLintConfig } from '@lukeashford/aurelius/eslint';
|
|
33
|
+
* export default createAureliusESLintConfig({ entryPoint: './app/styles.css' });
|
|
34
|
+
*/
|
|
35
|
+
export function createAureliusESLintConfig(options = {}) {
|
|
36
|
+
const {entryPoint = './src/index.css'} = options;
|
|
37
|
+
|
|
38
|
+
return [
|
|
39
|
+
// Ignore generated files
|
|
40
|
+
{
|
|
41
|
+
ignores: ['**/generated/**', '**/dist/**'],
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// JS/TS/React files: enforce allowed Tailwind classes only
|
|
45
|
+
{
|
|
46
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
47
|
+
languageOptions: {
|
|
48
|
+
parser: tsParser,
|
|
49
|
+
parserOptions: {
|
|
50
|
+
ecmaVersion: 'latest',
|
|
51
|
+
sourceType: 'module',
|
|
52
|
+
ecmaFeatures: {
|
|
53
|
+
jsx: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
plugins: {
|
|
58
|
+
'better-tailwindcss': eslintPluginBetterTailwindcss,
|
|
59
|
+
},
|
|
60
|
+
settings: {
|
|
61
|
+
'better-tailwindcss': {
|
|
62
|
+
entryPoint,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
rules: {
|
|
66
|
+
// Only Tailwind-known classes (no custom classnames)
|
|
67
|
+
'better-tailwindcss/no-unknown-classes': [
|
|
68
|
+
'error',
|
|
69
|
+
{
|
|
70
|
+
// Allow custom classes when they are defined using Aurelius/Tailwind utilities
|
|
71
|
+
// (e.g., `@utility x { @apply bg-obsidian text-white; }`).
|
|
72
|
+
// This still blocks any class that isn't generated from the Aurelius-based
|
|
73
|
+
// Tailwind pipeline, so "a&b"-style composites are fine but "c" isn't if
|
|
74
|
+
// it doesn't come from Aurelius tokens.
|
|
75
|
+
detectComponentClasses: true,
|
|
76
|
+
// Also check variables that store class mappings (e.g., variantClasses objects)
|
|
77
|
+
variables: [
|
|
78
|
+
['^.*[Cc]lass(?:es|Name)?$', [{match: 'strings'}]],
|
|
79
|
+
['^.*[Cc]lass(?:es|Name)?$', [{match: 'objectValues'}]],
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
// Block arbitrary value utilities like bg-[...], text-[...], shadow-[...]
|
|
85
|
+
'better-tailwindcss/no-restricted-classes': [
|
|
86
|
+
'error',
|
|
87
|
+
{
|
|
88
|
+
restrict: ['\\[.*\\]'],
|
|
89
|
+
// Also check variables that store class mappings (e.g., variantClasses objects)
|
|
90
|
+
variables: [
|
|
91
|
+
['^.*[Cc]lass(?:es|Name)?$', [{match: 'strings'}]],
|
|
92
|
+
['^.*[Cc]lass(?:es|Name)?$', [{match: 'objectValues'}]],
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
// CSS files: enforce Tailwind v4 CSS usage and tokens (exclude fonts.css and theme.css)
|
|
100
|
+
{
|
|
101
|
+
files: ['**/*.css'],
|
|
102
|
+
ignores: ['**/fonts.css', '**/theme.css'],
|
|
103
|
+
language: 'css/css',
|
|
104
|
+
languageOptions: {
|
|
105
|
+
customSyntax: tailwind4,
|
|
106
|
+
},
|
|
107
|
+
plugins: {
|
|
108
|
+
css,
|
|
109
|
+
tailwindcss: poupeTailwindcss,
|
|
110
|
+
},
|
|
111
|
+
rules: {
|
|
112
|
+
// Start from the plugin's recommended preset
|
|
113
|
+
...poupeTailwindcss.configs.recommended.rules,
|
|
114
|
+
|
|
115
|
+
// Make sure these are at least enabled (or stricter if you want):
|
|
116
|
+
'tailwindcss/no-conflicting-utilities': 'error',
|
|
117
|
+
'tailwindcss/valid-apply-directive': 'error',
|
|
118
|
+
'tailwindcss/valid-modifier-syntax': 'error',
|
|
119
|
+
'tailwindcss/prefer-theme-tokens': 'warn',
|
|
120
|
+
'tailwindcss/no-arbitrary-value-overuse': 'error',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Default export with default entry point for convenience
|
|
127
|
+
export default createAureliusESLintConfig();
|