@nexub/tokens 3.7.0 → 3.9.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/bin/nexub-migrate.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import path from 'node:path';
|
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { parseArgs } from 'node:util';
|
|
8
8
|
|
|
9
|
-
export const RULES = ['legacy-tokens', 'logical-classes', 'tw-animate', 'opacity-modifier', 'deprecated-components'];
|
|
9
|
+
export const RULES = ['legacy-tokens', 'logical-classes', 'tw-animate', 'opacity-modifier', 'deprecated-components', 'tailwind-3-preset'];
|
|
10
10
|
const EXTS = new Set(['.ts', '.tsx', '.js', '.jsx', '.css', '.scss', '.html', '.mdx']);
|
|
11
11
|
const SKIP_DIRS = new Set(['node_modules', 'dist', 'build', '.next', 'out', 'coverage']);
|
|
12
12
|
const MAX_BYTES = 1024 * 1024;
|
|
@@ -404,6 +404,11 @@ export function migrateSource(src, { ext, rules = new Set(RULES), fix = false, a
|
|
|
404
404
|
text = r.output;
|
|
405
405
|
items.push(...r.items);
|
|
406
406
|
}
|
|
407
|
+
if (rules.has('tailwind-3-preset')) {
|
|
408
|
+
// Report only: moving a tailwind.config preset to CSS-first Tailwind 4 is a config change, not a rewrite.
|
|
409
|
+
for (const m of src.matchAll(/['"]@nexub\/tokens\/tailwind['"]/g))
|
|
410
|
+
items.push({ at: m.index, rule: 'tailwind-3-preset', message: '@nexub/tokens/tailwind (the Tailwind 3 preset) is removed in 4.0: move to Tailwind 4 and @import "@nexub/tokens/tailwind.css" in your CSS' });
|
|
411
|
+
}
|
|
407
412
|
// Rewrites never add or remove newlines, so offsets in src and text share line numbers.
|
|
408
413
|
const lineOf = (at) => src.slice(0, at).split('\n').length;
|
|
409
414
|
const manual = items.map(({ at, line, rule, message }) => ({ line: line ?? lineOf(at), rule, message })).sort((a, b) => a.line - b.line);
|
|
@@ -464,6 +469,8 @@ Rules:
|
|
|
464
469
|
@nexub/react components removed in 3.0: Banner, Callout -> Alert;
|
|
465
470
|
Tag -> <Badge variant="soft">; StatusPill label -> Badge children
|
|
466
471
|
(dot and non-JSX uses reported); *Props types renamed
|
|
472
|
+
tailwind-3-preset report the Tailwind 3 preset (@nexub/tokens/tailwind), removed in 4.0;
|
|
473
|
+
use Tailwind 4 with @import "@nexub/tokens/tailwind.css"
|
|
467
474
|
|
|
468
475
|
Ignored: node_modules, dist, build, .next, out, coverage, files over 1 MB.
|
|
469
476
|
Exit codes: 0 ok, 1 --check found something, 2 usage error.`;
|
package/dist/tailwind/preset.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
// Auto-generated by @nexub/tokens build script. Do not edit.
|
|
2
|
+
// Deprecated in 3.9, removed in 4.0: use Tailwind 4 with @import "@nexub/tokens/tailwind.css".
|
|
3
|
+
if (!globalThis.__nexubTw3Warned) {
|
|
4
|
+
globalThis.__nexubTw3Warned = true;
|
|
5
|
+
console.warn('[@nexub/tokens] The Tailwind 3 preset (@nexub/tokens/tailwind) is deprecated and will be removed in 4.0. Move to Tailwind 4 and @import "@nexub/tokens/tailwind.css". Run npx -p @nexub/tokens nexub-migrate --rules tailwind-3-preset to find every use.');
|
|
6
|
+
}
|
|
2
7
|
import animate from 'tailwindcss-animate';
|
|
3
8
|
const preset = {
|
|
4
9
|
"theme": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/tokens",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Design tokens for Nexub Design System — colours, typography, spacing, radii, shadows, and motion as CSS variables, Tailwind presets and React Native objects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|