@blotch/dolan 22.2.3 → 22.2.5
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/dist/commands/add.js +9 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/add.test.js +38 -3
- package/dist/commands/add.test.js.map +1 -1
- package/dist/commands/doctor.js +258 -21
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +425 -11
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +38 -18
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +105 -2
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/theme.js +1 -1
- package/dist/commands/theme.js.map +1 -1
- package/dist/commands/update.d.ts +7 -0
- package/dist/commands/update.js +194 -50
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/update.test.js +570 -3
- package/dist/commands/update.test.js.map +1 -1
- package/dist/lockfile.d.ts +17 -0
- package/dist/lockfile.js +56 -1
- package/dist/lockfile.js.map +1 -1
- package/dist/lockfile.test.d.ts +1 -0
- package/dist/lockfile.test.js +65 -0
- package/dist/lockfile.test.js.map +1 -0
- package/dist/registry.d.ts +6 -0
- package/dist/registry.js +119 -11
- package/dist/registry.js.map +1 -1
- package/dist/registry.test.js +61 -6
- package/dist/registry.test.js.map +1 -1
- package/dist/test-utils.d.ts +27 -0
- package/dist/test-utils.js +45 -1
- package/dist/test-utils.js.map +1 -1
- package/dist/testing/fire-lynx-event.d.ts +14 -0
- package/dist/testing/fire-lynx-event.js +19 -0
- package/dist/testing/fire-lynx-event.js.map +1 -0
- package/dist/testing/fire-lynx-event.test.d.ts +1 -0
- package/dist/testing/fire-lynx-event.test.js +44 -0
- package/dist/testing/fire-lynx-event.test.js.map +1 -0
- package/dist/testing/lynx-main-thread.d.ts +22 -0
- package/dist/testing/lynx-main-thread.js +11 -0
- package/dist/testing/lynx-main-thread.js.map +1 -0
- package/dist/testing/lynx-main-thread.test.d.ts +1 -0
- package/dist/testing/lynx-main-thread.test.js +24 -0
- package/dist/testing/lynx-main-thread.test.js.map +1 -0
- package/dist/testing/set-input-signal.d.ts +5 -4
- package/dist/testing/set-input-signal.js +5 -4
- package/dist/testing/set-input-signal.js.map +1 -1
- package/dist/ui/boolean-inputs.test.ts +76 -0
- package/dist/ui/components/accordion/accordion.test.ts +158 -144
- package/dist/ui/components/accordion/accordion.ts +19 -14
- package/dist/ui/components/action-sheet/action-sheet.test.ts +637 -183
- package/dist/ui/components/action-sheet/action-sheet.ts +339 -55
- package/dist/ui/components/action-sheet/index.ts +1 -0
- package/dist/ui/components/alert/alert.test.ts +67 -19
- package/dist/ui/components/alert/alert.ts +14 -16
- package/dist/ui/components/alert-dialog/alert-dialog.test.ts +740 -129
- package/dist/ui/components/alert-dialog/alert-dialog.ts +672 -58
- package/dist/ui/components/alert-dialog/index.ts +5 -0
- package/dist/ui/components/area-chart/area-chart.test.ts +81 -1
- package/dist/ui/components/area-chart/area-chart.ts +3 -2
- package/dist/ui/components/avatar/avatar.test.ts +89 -45
- package/dist/ui/components/badge/badge.test.ts +57 -23
- package/dist/ui/components/badge/badge.ts +14 -15
- package/dist/ui/components/bar-chart/bar-chart.test.ts +82 -1
- package/dist/ui/components/bottom-sheet/bottom-sheet.test.ts +1314 -273
- package/dist/ui/components/bottom-sheet/bottom-sheet.ts +1046 -119
- package/dist/ui/components/bottom-sheet/index.ts +7 -1
- package/dist/ui/components/button/button.test.ts +646 -2
- package/dist/ui/components/button/button.ts +443 -64
- package/dist/ui/components/button/index.ts +2 -0
- package/dist/ui/components/button-group/button-group.test.ts +528 -2
- package/dist/ui/components/button-group/button-group.ts +428 -70
- package/dist/ui/components/button-group/index.ts +3 -0
- package/dist/ui/components/candlestick-chart/candlestick-chart.test.ts +82 -1
- package/dist/ui/components/card/card.test.ts +97 -61
- package/dist/ui/components/card/card.ts +2 -1
- package/dist/ui/components/chart/chart-presets.test.ts +197 -1
- package/dist/ui/components/chart/chart-presets.ts +14 -7
- package/dist/ui/components/chart/chart-theme.ts +12 -0
- package/dist/ui/components/chart/chart.test.ts +1031 -0
- package/dist/ui/components/chart/chart.ts +66 -46
- package/dist/ui/components/checkbox/checkbox.test.ts +124 -42
- package/dist/ui/components/checkbox/checkbox.ts +25 -24
- package/dist/ui/components/collapsible/collapsible.test.ts +158 -81
- package/dist/ui/components/collapsible/collapsible.ts +21 -15
- package/dist/ui/components/context-menu/context-menu.test.ts +224 -0
- package/dist/ui/components/context-menu/context-menu.ts +110 -0
- package/dist/ui/components/context-menu/index.ts +1 -0
- package/dist/ui/components/dialog/dialog.test.ts +210 -152
- package/dist/ui/components/dialog/dialog.ts +35 -29
- package/dist/ui/components/dock/dock-scroll.test.ts +130 -0
- package/dist/ui/components/dock/dock-scroll.ts +142 -0
- package/dist/ui/components/dock/dock-search.test.ts +594 -0
- package/dist/ui/components/dock/dock.test.ts +752 -0
- package/dist/ui/components/dock/dock.ts +1438 -0
- package/dist/ui/components/dock/index.ts +2 -0
- package/dist/ui/components/dynamic-color/dynamic-color.test.ts +144 -0
- package/dist/ui/components/dynamic-color/dynamic-color.ts +146 -0
- package/dist/ui/components/dynamic-color/index.ts +5 -0
- package/dist/ui/components/empty-state/empty-state.test.ts +28 -39
- package/dist/ui/components/glass/concentric-radius.test.ts +13 -0
- package/dist/ui/components/glass/concentric-radius.ts +17 -0
- package/dist/ui/components/glass/glass-design.test.ts +78 -0
- package/dist/ui/components/glass/glass-design.ts +119 -0
- package/dist/ui/components/glass/glass.test.ts +376 -0
- package/dist/ui/components/glass/glass.ts +430 -0
- package/dist/ui/components/glass/index.ts +19 -0
- package/dist/ui/components/icon/icon-theme.test.ts +64 -0
- package/dist/ui/components/icon/icon-theme.ts +70 -16
- package/dist/ui/components/icon/icon.test.ts +52 -41
- package/dist/ui/components/input/input.test.ts +178 -101
- package/dist/ui/components/input/input.ts +17 -13
- package/dist/ui/components/label/label.test.ts +11 -24
- package/dist/ui/components/label/label.ts +8 -2
- package/dist/ui/components/line-chart/line-chart.test.ts +76 -1
- package/dist/ui/components/line-chart/line-chart.ts +3 -2
- package/dist/ui/components/list/list.test.ts +80 -49
- package/dist/ui/components/list/list.ts +5 -4
- package/dist/ui/components/menu/index.ts +25 -0
- package/dist/ui/components/menu/menu-placement.test.ts +153 -0
- package/dist/ui/components/menu/menu-placement.ts +159 -0
- package/dist/ui/components/menu/menu-popup.test.ts +636 -0
- package/dist/ui/components/menu/menu-popup.ts +565 -0
- package/dist/ui/components/menu/menu.test.ts +523 -0
- package/dist/ui/components/menu/menu.ts +455 -0
- package/dist/ui/components/nav-drawer/nav-drawer.test.ts +425 -260
- package/dist/ui/components/nav-drawer/nav-drawer.ts +75 -58
- package/dist/ui/components/navigation-bar/index.ts +1 -0
- package/dist/ui/components/navigation-bar/navigation-bar.test.ts +425 -0
- package/dist/ui/components/navigation-bar/navigation-bar.ts +411 -0
- package/dist/ui/components/pagination/pagination.test.ts +136 -86
- package/dist/ui/components/popover/index.ts +9 -0
- package/dist/ui/components/popover/popover-panel.test.ts +735 -0
- package/dist/ui/components/popover/popover-panel.ts +603 -0
- package/dist/ui/components/popover/popover.test.ts +286 -0
- package/dist/ui/components/popover/popover.ts +207 -0
- package/dist/ui/components/progress/progress.test.ts +102 -46
- package/dist/ui/components/progress/progress.ts +54 -55
- package/dist/ui/components/radio-group/radio-group.test.ts +128 -83
- package/dist/ui/components/radio-group/radio-group.ts +26 -25
- package/dist/ui/components/scatter-chart/scatter-chart.test.ts +74 -1
- package/dist/ui/components/scroll-area/scroll-area.test.ts +72 -36
- package/dist/ui/components/scroll-area/scroll-area.ts +4 -3
- package/dist/ui/components/search-field/index.ts +15 -0
- package/dist/ui/components/search-field/keyboard.test.ts +147 -0
- package/dist/ui/components/search-field/keyboard.ts +123 -0
- package/dist/ui/components/search-field/search-field.test.ts +549 -0
- package/dist/ui/components/search-field/search-field.ts +628 -0
- package/dist/ui/components/segmented-control/index.ts +8 -0
- package/dist/ui/components/segmented-control/segmented-control.test.ts +861 -0
- package/dist/ui/components/segmented-control/segmented-control.ts +884 -0
- package/dist/ui/components/select/select.test.ts +138 -78
- package/dist/ui/components/select/select.ts +19 -12
- package/dist/ui/components/separator/separator.test.ts +18 -17
- package/dist/ui/components/sheet/sheet.test.ts +151 -11
- package/dist/ui/components/sheet/sheet.ts +68 -5
- package/dist/ui/components/skeleton/skeleton.test.ts +24 -7
- package/dist/ui/components/skeleton/skeleton.ts +10 -16
- package/dist/ui/components/slider/index.ts +1 -0
- package/dist/ui/components/slider/slider.test.ts +695 -0
- package/dist/ui/components/slider/slider.ts +901 -0
- package/dist/ui/components/spinner/spinner.test.ts +64 -46
- package/dist/ui/components/spinner/spinner.ts +16 -19
- package/dist/ui/components/switch/index.ts +1 -1
- package/dist/ui/components/switch/switch.test.ts +534 -48
- package/dist/ui/components/switch/switch.ts +613 -48
- package/dist/ui/components/tab-bar/index.ts +1 -0
- package/dist/ui/components/tab-bar/tab-bar.test.ts +280 -0
- package/dist/ui/components/tab-bar/tab-bar.ts +230 -0
- package/dist/ui/components/tabs/index.ts +7 -1
- package/dist/ui/components/tabs/tabs.test.ts +484 -150
- package/dist/ui/components/tabs/tabs.ts +344 -149
- package/dist/ui/components/textarea/textarea.test.ts +206 -100
- package/dist/ui/components/textarea/textarea.ts +16 -13
- package/dist/ui/components/toast/toast.test.ts +434 -350
- package/dist/ui/components/toast/toast.ts +42 -51
- package/dist/ui/components/toggle/index.ts +1 -0
- package/dist/ui/components/toggle/toggle.test.ts +559 -146
- package/dist/ui/components/toggle/toggle.ts +241 -26
- package/dist/ui/components/toolbar/bar-scroll.test.ts +310 -0
- package/dist/ui/components/toolbar/bar-scroll.ts +372 -0
- package/dist/ui/components/toolbar/index.ts +12 -0
- package/dist/ui/components/toolbar/toolbar.test.ts +438 -0
- package/dist/ui/components/toolbar/toolbar.ts +535 -0
- package/dist/ui/theme/chart-colors.test.ts +8 -3
- package/dist/ui/theme/dark.css +38 -2
- package/dist/ui/theme/default.css +55 -7
- package/dist/ui/theme/icon-colors.test.ts +8 -3
- package/dist/ui/theme/rgb-channels.test.ts +84 -0
- package/dist/ui/theme/tailwind-build.test.ts +114 -0
- package/dist/ui/theme/tailwind-css.test.ts +83 -0
- package/dist/ui/theme/tailwind-plugin.test.ts +42 -2
- package/dist/ui/theme/tailwind-plugin.ts +93 -29
- package/dist/ui/theme/tailwind.css +113 -0
- package/dist/ui/utils/animate.test.ts +13 -1
- package/dist/utils/analyze.d.ts +19 -0
- package/dist/utils/analyze.js +16 -0
- package/dist/utils/analyze.js.map +1 -1
- package/dist/utils/analyze.test.js +14 -1
- package/dist/utils/analyze.test.js.map +1 -1
- package/dist/utils/installed.d.ts +25 -1
- package/dist/utils/installed.js +33 -0
- package/dist/utils/installed.js.map +1 -1
- package/dist/utils/installed.test.js +55 -1
- package/dist/utils/installed.test.js.map +1 -1
- package/dist/utils/resolve-paths.d.ts +4 -4
- package/dist/utils/resolve-paths.js +5 -7
- package/dist/utils/resolve-paths.js.map +1 -1
- package/dist/utils/resolve-paths.test.js +9 -5
- package/dist/utils/resolve-paths.test.js.map +1 -1
- package/dist/utils/tailwind.d.ts +45 -0
- package/dist/utils/tailwind.js +90 -0
- package/dist/utils/tailwind.js.map +1 -0
- package/dist/utils/tailwind.test.d.ts +1 -0
- package/dist/utils/tailwind.test.js +134 -0
- package/dist/utils/tailwind.test.js.map +1 -0
- package/package.json +9 -1
- package/dist/ui/components/area-chart/area-chart-render.test.ts +0 -63
- package/dist/ui/components/bar-chart/bar-chart-render.test.ts +0 -58
- package/dist/ui/components/button/button-render.test.ts +0 -132
- package/dist/ui/components/button-group/button-group-render.test.ts +0 -146
- package/dist/ui/components/candlestick-chart/candlestick-chart-render.test.ts +0 -59
- package/dist/ui/components/chart/chart-render.test.ts +0 -730
- package/dist/ui/components/line-chart/line-chart-render.test.ts +0 -83
- package/dist/ui/components/scatter-chart/scatter-chart-render.test.ts +0 -64
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @blotch/ui theme for Tailwind CSS 4: what tailwind-plugin.ts does for
|
|
3
|
+
* Tailwind 3, written the CSS-first way. Import it after Tailwind, with
|
|
4
|
+
* default.css (and dark.css) for the colors themselves:
|
|
5
|
+
*
|
|
6
|
+
* @import './styles/default.css';
|
|
7
|
+
* @import './styles/tailwind.css';
|
|
8
|
+
*
|
|
9
|
+
* The semantic colors (bg-primary, text-muted-foreground, border-border)
|
|
10
|
+
* read the theme's variables directly, `inline` so the utilities write
|
|
11
|
+
* `var(--primary)` rather than a Tailwind variable that points at it. That
|
|
12
|
+
* keeps them switching with dark.css. An opacity modifier (bg-primary/50) is
|
|
13
|
+
* a color-mix() of that variable, which Lynx can't read; the build writes it
|
|
14
|
+
* as rgba(var(--primary-rgb), 0.5), from the channels default.css sets beside
|
|
15
|
+
* each color, as the Tailwind 3 plugin's themeColor() does.
|
|
16
|
+
*/
|
|
17
|
+
@theme inline {
|
|
18
|
+
--color-background: var(--background);
|
|
19
|
+
--color-foreground: var(--foreground);
|
|
20
|
+
--color-card: var(--card);
|
|
21
|
+
--color-card-foreground: var(--card-foreground);
|
|
22
|
+
--color-primary: var(--primary);
|
|
23
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
24
|
+
--color-secondary: var(--secondary);
|
|
25
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
26
|
+
--color-muted: var(--muted);
|
|
27
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
28
|
+
--color-accent: var(--accent);
|
|
29
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
30
|
+
--color-destructive: var(--destructive);
|
|
31
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
32
|
+
/* Pre-composed translucent red for subtle destructive backgrounds. */
|
|
33
|
+
--color-destructive-subtle: var(--destructive-subtle);
|
|
34
|
+
--color-border: var(--border);
|
|
35
|
+
--color-input: var(--input);
|
|
36
|
+
--color-ring: var(--ring);
|
|
37
|
+
/* Chart series colors, e.g. bg-chart-1 for a legend swatch that matches
|
|
38
|
+
the first series. */
|
|
39
|
+
--color-chart-1: var(--chart-1);
|
|
40
|
+
--color-chart-2: var(--chart-2);
|
|
41
|
+
--color-chart-3: var(--chart-3);
|
|
42
|
+
--color-chart-4: var(--chart-4);
|
|
43
|
+
--color-chart-5: var(--chart-5);
|
|
44
|
+
/* What sits on Liquid Glass, and its tint (see the glass component).
|
|
45
|
+
glass-dim is translucent already, so it takes no opacity modifier. */
|
|
46
|
+
--color-glass-tint: var(--glass-tint);
|
|
47
|
+
--color-glass-tint-foreground: var(--glass-tint-foreground);
|
|
48
|
+
--color-glass-foreground: var(--glass-foreground);
|
|
49
|
+
--color-glass-muted-foreground: var(--glass-muted-foreground);
|
|
50
|
+
--color-glass-clear-foreground: var(--glass-clear-foreground);
|
|
51
|
+
--color-glass-dim: var(--glass-dim);
|
|
52
|
+
|
|
53
|
+
--radius-lg: var(--radius);
|
|
54
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
55
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@layer base {
|
|
59
|
+
* {
|
|
60
|
+
border-color: var(--border);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* Safe-area padding, driven by env(safe-area-inset-*), which Lynx parses as
|
|
66
|
+
* a length, inside calc() too. The insets are 0 until the host app sets
|
|
67
|
+
* them, so each utility falls back to plain padding (or none).
|
|
68
|
+
*
|
|
69
|
+
* Bare (pb-safe, px-safe, p-safe): padding equal to the inset.
|
|
70
|
+
* Offset (pb-safe-4, pt-safe-2): a spacing-scale value plus the inset, for an
|
|
71
|
+
* element that wants its own padding and must also clear the notch or the
|
|
72
|
+
* home indicator.
|
|
73
|
+
*/
|
|
74
|
+
@utility pt-safe {
|
|
75
|
+
padding-top: env(safe-area-inset-top);
|
|
76
|
+
}
|
|
77
|
+
@utility pr-safe {
|
|
78
|
+
padding-right: env(safe-area-inset-right);
|
|
79
|
+
}
|
|
80
|
+
@utility pb-safe {
|
|
81
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
82
|
+
}
|
|
83
|
+
@utility pl-safe {
|
|
84
|
+
padding-left: env(safe-area-inset-left);
|
|
85
|
+
}
|
|
86
|
+
@utility px-safe {
|
|
87
|
+
padding-left: env(safe-area-inset-left);
|
|
88
|
+
padding-right: env(safe-area-inset-right);
|
|
89
|
+
}
|
|
90
|
+
@utility py-safe {
|
|
91
|
+
padding-top: env(safe-area-inset-top);
|
|
92
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
93
|
+
}
|
|
94
|
+
@utility p-safe {
|
|
95
|
+
padding-top: env(safe-area-inset-top);
|
|
96
|
+
padding-right: env(safe-area-inset-right);
|
|
97
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
98
|
+
padding-left: env(safe-area-inset-left);
|
|
99
|
+
}
|
|
100
|
+
@utility pt-safe-* {
|
|
101
|
+
padding-top: calc(--spacing(--value(number)) + env(safe-area-inset-top));
|
|
102
|
+
}
|
|
103
|
+
@utility pr-safe-* {
|
|
104
|
+
padding-right: calc(--spacing(--value(number)) + env(safe-area-inset-right));
|
|
105
|
+
}
|
|
106
|
+
@utility pb-safe-* {
|
|
107
|
+
padding-bottom: calc(
|
|
108
|
+
--spacing(--value(number)) + env(safe-area-inset-bottom)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
@utility pl-safe-* {
|
|
112
|
+
padding-left: calc(--spacing(--value(number)) + env(safe-area-inset-left));
|
|
113
|
+
}
|
|
@@ -28,8 +28,20 @@ import {
|
|
|
28
28
|
springTranslateX,
|
|
29
29
|
} from './animate';
|
|
30
30
|
|
|
31
|
+
// The keyframes and options the helpers hand `animate()`, typed with the
|
|
32
|
+
// fields the assertions read: the mock's calls are typed from its parameters.
|
|
33
|
+
type Keyframe = { transform?: string; opacity?: number };
|
|
34
|
+
type AnimateOptions = {
|
|
35
|
+
duration?: number;
|
|
36
|
+
easing?: string;
|
|
37
|
+
fill?: string;
|
|
38
|
+
iterations?: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
31
41
|
const makeEl = () => ({
|
|
32
|
-
animate: vi.fn(() => ({
|
|
42
|
+
animate: vi.fn((_keyframes: Keyframe[], _options: AnimateOptions) => ({
|
|
43
|
+
cancel: vi.fn(),
|
|
44
|
+
})),
|
|
33
45
|
setStyle: vi.fn(),
|
|
34
46
|
});
|
|
35
47
|
|
package/dist/utils/analyze.d.ts
CHANGED
|
@@ -5,6 +5,15 @@ export type FileAnalysis = {
|
|
|
5
5
|
status: FileStatus;
|
|
6
6
|
currentContent: string;
|
|
7
7
|
newContent: string;
|
|
8
|
+
/**
|
|
9
|
+
* Why upstream's version of the file is no file, when it is: upstream
|
|
10
|
+
* stopped shipping it, or it's a theme file for the Tailwind version the
|
|
11
|
+
* app doesn't use. Taking upstream's version deletes it (see
|
|
12
|
+
* analyzeRemovedFile), and its `newContent` is empty. The summary and the
|
|
13
|
+
* question about it give this reason, since "upstream changed" would hide
|
|
14
|
+
* that the file goes.
|
|
15
|
+
*/
|
|
16
|
+
removed?: string;
|
|
8
17
|
};
|
|
9
18
|
export type ComponentAnalysis = {
|
|
10
19
|
name: string;
|
|
@@ -24,6 +33,16 @@ export declare const STATUS_LABELS: Record<FileStatus, string>;
|
|
|
24
33
|
* so any difference is flagged as a conflict to be safe.
|
|
25
34
|
*/
|
|
26
35
|
export declare const analyzeFile: (currentContent: string | null, newContent: string, storedHash: string | null, hashContent: (content: string) => string) => FileStatus;
|
|
36
|
+
/**
|
|
37
|
+
* The status of a file dolan tracks but upstream no longer ships, such as the
|
|
38
|
+
* `*-render.test.ts` files that 22.2.3 stopped copying, or the Tailwind 3
|
|
39
|
+
* plugin of an app that moved to Tailwind 4. Upstream's version of it is "no
|
|
40
|
+
* file", so the same three-way rules apply as for a changed file:
|
|
41
|
+
* - gone from disk too → up-to-date (only its lockfile entry is left)
|
|
42
|
+
* - current == base → auto-update (nobody edited it: delete it)
|
|
43
|
+
* - current != base → conflict (git's modify/delete: ask before deleting)
|
|
44
|
+
*/
|
|
45
|
+
export declare const analyzeRemovedFile: (currentContent: string | null, storedHash: string, hashContent: (content: string) => string) => FileStatus;
|
|
27
46
|
export declare const formatDiff: (currentContent: string, newContent: string) => string;
|
|
28
47
|
export declare const summarizeComponent: (analysis: ComponentAnalysis) => FileStatus;
|
|
29
48
|
export { type Hunk } from 'diff';
|
package/dist/utils/analyze.js
CHANGED
|
@@ -46,6 +46,22 @@ export const analyzeFile = (currentContent, newContent, storedHash, hashContent)
|
|
|
46
46
|
return 'user-modified';
|
|
47
47
|
return 'conflict';
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The status of a file dolan tracks but upstream no longer ships, such as the
|
|
51
|
+
* `*-render.test.ts` files that 22.2.3 stopped copying, or the Tailwind 3
|
|
52
|
+
* plugin of an app that moved to Tailwind 4. Upstream's version of it is "no
|
|
53
|
+
* file", so the same three-way rules apply as for a changed file:
|
|
54
|
+
* - gone from disk too → up-to-date (only its lockfile entry is left)
|
|
55
|
+
* - current == base → auto-update (nobody edited it: delete it)
|
|
56
|
+
* - current != base → conflict (git's modify/delete: ask before deleting)
|
|
57
|
+
*/
|
|
58
|
+
export const analyzeRemovedFile = (currentContent, storedHash, hashContent) => {
|
|
59
|
+
if (currentContent === null)
|
|
60
|
+
return 'up-to-date';
|
|
61
|
+
return hashContent(currentContent) === storedHash
|
|
62
|
+
? 'auto-update'
|
|
63
|
+
: 'conflict';
|
|
64
|
+
};
|
|
49
65
|
export const formatDiff = (currentContent, newContent) => {
|
|
50
66
|
const changes = diffLines(currentContent, newContent);
|
|
51
67
|
const lines = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/utils/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,GAGX,MAAM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/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,cAAsB,EACtB,UAAkB,EAClB,eAAyB,EACT,EAAE;IAClB,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAe;QAC1B,GAAG,KAAK;QACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KACjE,CAAC;IACF,OAAO,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
|
-
import { analyzeFile, formatDiff, summarizeComponent } from './analyze';
|
|
3
|
+
import { analyzeFile, analyzeRemovedFile, formatDiff, summarizeComponent, } from './analyze';
|
|
4
4
|
const hash = (content) => createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
5
5
|
describe('analyzeFile', () => {
|
|
6
6
|
it('returns new-upstream when current content is null', () => {
|
|
@@ -33,6 +33,19 @@ describe('analyzeFile', () => {
|
|
|
33
33
|
expect(analyzeFile('user-edit', 'upstream-edit', stored, hash)).toBe('conflict');
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
|
+
// A file dolan tracks that upstream no longer ships: upstream's version is
|
|
37
|
+
// "no file".
|
|
38
|
+
describe('analyzeRemovedFile', () => {
|
|
39
|
+
it('returns up-to-date when the file is gone from disk too', () => {
|
|
40
|
+
expect(analyzeRemovedFile(null, hash('copied'), hash)).toBe('up-to-date');
|
|
41
|
+
});
|
|
42
|
+
it('returns auto-update when nobody edited it, so it can just go', () => {
|
|
43
|
+
expect(analyzeRemovedFile('copied', hash('copied'), hash)).toBe('auto-update');
|
|
44
|
+
});
|
|
45
|
+
it('returns conflict when it was edited, so deleting it needs a yes', () => {
|
|
46
|
+
expect(analyzeRemovedFile('edited', hash('copied'), hash)).toBe('conflict');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
36
49
|
describe('summarizeComponent', () => {
|
|
37
50
|
it('returns up-to-date when all files are up-to-date', () => {
|
|
38
51
|
const result = summarizeComponent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../../src/utils/analyze.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../../src/utils/analyze.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C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E,eAAe;oBACvB,cAAc,EAAE,EAAE;oBAClB,UAAU,EAAE,EAAE;iBACf;aACF;SACF,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,MAAM,GAAG,UAAU,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;QAC5E,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Lockfile } from '../lockfile.js';
|
|
2
2
|
/**
|
|
3
3
|
* The registry components with a folder in the components directory. Other
|
|
4
4
|
* folders (the app's own code next to the components) aren't dolan's.
|
|
@@ -15,3 +15,27 @@ export declare const componentsOnDisk: (componentsDir: string) => string[];
|
|
|
15
15
|
export declare const trackedComponents: (componentsDir: string, lockfile: Lockfile) => string[];
|
|
16
16
|
/** The components on disk that dolan doesn't track (see trackedComponents). */
|
|
17
17
|
export declare const untrackedComponents: (componentsDir: string, lockfile: Lockfile) => string[];
|
|
18
|
+
/**
|
|
19
|
+
* The files dolan tracks for a component that upstream no longer ships, such
|
|
20
|
+
* as the `*-render.test.ts` files that 22.2.3 stopped copying. `update` and
|
|
21
|
+
* `add` used to keep their lockfile entries and leave them on disk, where a
|
|
22
|
+
* stale spec importing a helper dolan doesn't copy broke the app's `ng test`.
|
|
23
|
+
*
|
|
24
|
+
* Shipped means shipped with tests: a project without the testing library
|
|
25
|
+
* doesn't get the components' `<name>.test.ts`, but upstream still ships it,
|
|
26
|
+
* so a copy from before dolan checked for the library isn't deleted here
|
|
27
|
+
* (`doctor` warns about those instead).
|
|
28
|
+
*/
|
|
29
|
+
export declare const droppedFiles: (name: string, lockfile: Lockfile) => string[];
|
|
30
|
+
/**
|
|
31
|
+
* The theme files dolan tracks (see trackedThemeFiles) that the project no
|
|
32
|
+
* longer takes: the Tailwind 3 plugin and its test once it's on Tailwind 4,
|
|
33
|
+
* or `tailwind.css` once it's back on Tailwind 3. `update` used to look only
|
|
34
|
+
* at the files the project takes, so the plugin stayed, on disk and in the
|
|
35
|
+
* lockfile, as dead code and an uncovered file in the app's coverage report.
|
|
36
|
+
*
|
|
37
|
+
* As for droppedFiles, a test counts as taken whether or not the project has
|
|
38
|
+
* the testing library: the plugin's test goes with the plugin, not with the
|
|
39
|
+
* library, so a Tailwind 3 project that drops the library keeps its copy.
|
|
40
|
+
*/
|
|
41
|
+
export declare const droppedThemeFiles: (cwd: string, themeDir: string, lockfile: Lockfile) => string[];
|
package/dist/utils/installed.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { existsSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { getComponentNames } from '../registry.js';
|
|
3
|
+
import { trackedThemeFiles } from '../lockfile.js';
|
|
4
|
+
import { getComponentFiles } from './resolve-paths.js';
|
|
5
|
+
import { themeFilesFor } from './tailwind.js';
|
|
3
6
|
/**
|
|
4
7
|
* The registry components with a folder in the components directory. Other
|
|
5
8
|
* folders (the app's own code next to the components) aren't dolan's.
|
|
@@ -24,4 +27,34 @@ export const componentsOnDisk = (componentsDir) => {
|
|
|
24
27
|
export const trackedComponents = (componentsDir, lockfile) => componentsOnDisk(componentsDir).filter((name) => lockfile.components[name]);
|
|
25
28
|
/** The components on disk that dolan doesn't track (see trackedComponents). */
|
|
26
29
|
export const untrackedComponents = (componentsDir, lockfile) => componentsOnDisk(componentsDir).filter((name) => !lockfile.components[name]);
|
|
30
|
+
/**
|
|
31
|
+
* The files dolan tracks for a component that upstream no longer ships, such
|
|
32
|
+
* as the `*-render.test.ts` files that 22.2.3 stopped copying. `update` and
|
|
33
|
+
* `add` used to keep their lockfile entries and leave them on disk, where a
|
|
34
|
+
* stale spec importing a helper dolan doesn't copy broke the app's `ng test`.
|
|
35
|
+
*
|
|
36
|
+
* Shipped means shipped with tests: a project without the testing library
|
|
37
|
+
* doesn't get the components' `<name>.test.ts`, but upstream still ships it,
|
|
38
|
+
* so a copy from before dolan checked for the library isn't deleted here
|
|
39
|
+
* (`doctor` warns about those instead).
|
|
40
|
+
*/
|
|
41
|
+
export const droppedFiles = (name, lockfile) => {
|
|
42
|
+
const shipped = new Set(getComponentFiles(name, { tests: true }));
|
|
43
|
+
return Object.keys(lockfile.components[name] ?? {}).filter((file) => !shipped.has(file));
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The theme files dolan tracks (see trackedThemeFiles) that the project no
|
|
47
|
+
* longer takes: the Tailwind 3 plugin and its test once it's on Tailwind 4,
|
|
48
|
+
* or `tailwind.css` once it's back on Tailwind 3. `update` used to look only
|
|
49
|
+
* at the files the project takes, so the plugin stayed, on disk and in the
|
|
50
|
+
* lockfile, as dead code and an uncovered file in the app's coverage report.
|
|
51
|
+
*
|
|
52
|
+
* As for droppedFiles, a test counts as taken whether or not the project has
|
|
53
|
+
* the testing library: the plugin's test goes with the plugin, not with the
|
|
54
|
+
* library, so a Tailwind 3 project that drops the library keeps its copy.
|
|
55
|
+
*/
|
|
56
|
+
export const droppedThemeFiles = (cwd, themeDir, lockfile) => {
|
|
57
|
+
const takes = new Set(themeFilesFor(cwd, { tests: true }));
|
|
58
|
+
return trackedThemeFiles(lockfile, themeDir).filter((file) => !takes.has(file));
|
|
59
|
+
};
|
|
27
60
|
//# sourceMappingURL=installed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed.js","sourceRoot":"","sources":["../../src/utils/installed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"installed.js","sourceRoot":"","sources":["../../src/utils/installed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAqB,EAAY,EAAE;IAClE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC3C,OAAO,WAAW,CAAC,aAAa,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SACvD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC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,CAAC,CAAC,CAAC;IAC3D,OAAO,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,MAAM,CACjD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAC3B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { tmpdir } from 'node:os';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
5
|
import { createEmptyLockfile } from '../lockfile';
|
|
6
|
-
import {
|
|
6
|
+
import { onTailwind } from '../test-utils';
|
|
7
|
+
import { componentsOnDisk, droppedFiles, droppedThemeFiles, trackedComponents, untrackedComponents, } from './installed';
|
|
7
8
|
let root;
|
|
8
9
|
const componentsDir = (...folders) => {
|
|
9
10
|
root = mkdtempSync(join(tmpdir(), 'dolan-installed-'));
|
|
@@ -38,4 +39,57 @@ describe('trackedComponents / untrackedComponents', () => {
|
|
|
38
39
|
expect(untrackedComponents(dir, lockfile)).toEqual(['spinner']);
|
|
39
40
|
});
|
|
40
41
|
});
|
|
42
|
+
// Reads the real registry source that the test config copies into dist/ui.
|
|
43
|
+
describe('droppedFiles', () => {
|
|
44
|
+
it("lists the tracked files that upstream doesn't ship", () => {
|
|
45
|
+
const lockfile = createEmptyLockfile();
|
|
46
|
+
lockfile.components['button'] = {
|
|
47
|
+
'button.ts': { hash: 'a' },
|
|
48
|
+
'button-old.ts': { hash: 'b' },
|
|
49
|
+
// Shipped, though only a project with the testing library gets it.
|
|
50
|
+
'button.test.ts': { hash: 'c' },
|
|
51
|
+
};
|
|
52
|
+
expect(droppedFiles('button', lockfile)).toEqual(['button-old.ts']);
|
|
53
|
+
});
|
|
54
|
+
it('is empty for a component the lockfile has no entry for', () => {
|
|
55
|
+
expect(droppedFiles('button', createEmptyLockfile())).toEqual([]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('droppedThemeFiles', () => {
|
|
59
|
+
/**
|
|
60
|
+
* A project on this Tailwind version, without the testing library.
|
|
61
|
+
*/
|
|
62
|
+
const project = (tailwind) => {
|
|
63
|
+
root = mkdtempSync(join(tmpdir(), 'dolan-installed-'));
|
|
64
|
+
onTailwind(root, tailwind);
|
|
65
|
+
return root;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A lockfile that records every theme file either version takes.
|
|
69
|
+
*/
|
|
70
|
+
const lockfile = () => {
|
|
71
|
+
const locked = createEmptyLockfile();
|
|
72
|
+
for (const file of [
|
|
73
|
+
'default.css',
|
|
74
|
+
'dark.css',
|
|
75
|
+
'tailwind.css',
|
|
76
|
+
'tailwind-plugin.ts',
|
|
77
|
+
'tailwind-plugin.test.ts',
|
|
78
|
+
]) {
|
|
79
|
+
locked.theme[file] = { hash: file };
|
|
80
|
+
}
|
|
81
|
+
return locked;
|
|
82
|
+
};
|
|
83
|
+
it('lists the Tailwind 3 plugin and its test on Tailwind 4', () => {
|
|
84
|
+
const cwd = project(4);
|
|
85
|
+
expect(droppedThemeFiles(cwd, cwd, lockfile())).toEqual([
|
|
86
|
+
'tailwind-plugin.ts',
|
|
87
|
+
'tailwind-plugin.test.ts',
|
|
88
|
+
]);
|
|
89
|
+
});
|
|
90
|
+
it("lists tailwind.css on Tailwind 3, but not the plugin's test a project without the testing library doesn't get", () => {
|
|
91
|
+
const cwd = project(3);
|
|
92
|
+
expect(droppedThemeFiles(cwd, cwd, lockfile())).toEqual(['tailwind.css']);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
41
95
|
//# sourceMappingURL=installed.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed.test.js","sourceRoot":"","sources":["../../src/utils/installed.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,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,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,12 +2,12 @@ export declare const getUiSourceDir: () => string;
|
|
|
2
2
|
export declare const getComponentSourceDir: (componentName: string) => string;
|
|
3
3
|
/**
|
|
4
4
|
* The files a component ships: its `.ts` sources and, when `tests` is set,
|
|
5
|
-
* its
|
|
5
|
+
* every one of its tests. Together they cover the component fully under an
|
|
6
|
+
* app's `ng test`, so the app can keep the copies in its coverage report
|
|
7
|
+
* (packages/ui runs them the same way, and checks that). Tests render with
|
|
6
8
|
* `@blotch/angular-lynx-testing-library`, so the commands pass
|
|
7
9
|
* `copiesTests(cwd)`: an app without the library would fail to compile them
|
|
8
|
-
* in `ng test`.
|
|
9
|
-
* component through the library's own JIT test harness, so in an app they
|
|
10
|
-
* wouldn't compile either.
|
|
10
|
+
* in `ng test`.
|
|
11
11
|
*/
|
|
12
12
|
export declare const getComponentFiles: (componentName: string, { tests }: {
|
|
13
13
|
tests: boolean;
|
|
@@ -11,18 +11,16 @@ export const getComponentSourceDir = (componentName) => {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* The files a component ships: its `.ts` sources and, when `tests` is set,
|
|
14
|
-
* its
|
|
14
|
+
* every one of its tests. Together they cover the component fully under an
|
|
15
|
+
* app's `ng test`, so the app can keep the copies in its coverage report
|
|
16
|
+
* (packages/ui runs them the same way, and checks that). Tests render with
|
|
15
17
|
* `@blotch/angular-lynx-testing-library`, so the commands pass
|
|
16
18
|
* `copiesTests(cwd)`: an app without the library would fail to compile them
|
|
17
|
-
* in `ng test`.
|
|
18
|
-
* component through the library's own JIT test harness, so in an app they
|
|
19
|
-
* wouldn't compile either.
|
|
19
|
+
* in `ng test`.
|
|
20
20
|
*/
|
|
21
21
|
export const getComponentFiles = (componentName, { tests }) => {
|
|
22
22
|
const dir = getComponentSourceDir(componentName);
|
|
23
|
-
return readdirSync(dir).filter((f) => f.endsWith('.ts') &&
|
|
24
|
-
!f.endsWith('-render.test.ts') &&
|
|
25
|
-
(tests || !f.endsWith('.test.ts')));
|
|
23
|
+
return readdirSync(dir).filter((f) => f.endsWith('.ts') && (tests || !f.endsWith('.test.ts')));
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
26
|
* When copying component source files from the bundled @blotch/ui package
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-paths.js","sourceRoot":"","sources":["../../src/utils/resolve-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAW,EAAE;IACzC,iEAAiE;IACjE,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,aAAqB,EAAU,EAAE;IACrE,OAAO,IAAI,CAAC,cAAc,EAAE,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,aAAqB,EACrB,EAAE,KAAK,EAAsB,EACnB,EAAE;IACZ,MAAM,GAAG,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAC5B,CAAC,CAAC,EAAE,EAAE,
|
|
1
|
+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AAE;QAC3B,OAAO,6BAA6B,QAAQ,IAAI,CAAC;IACnD,CAAC,CACF;SACA,OAAO,CACN,0DAA0D,EAC1D,CAAC,MAAM,EAAE,UAAkB,EAAE,EAAE;QAC7B,OAAO,+BAA+B,UAAU,IAAI,CAAC;IACvD,CAAC,CACF,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -31,11 +31,15 @@ describe('getComponentFiles', () => {
|
|
|
31
31
|
expect(file.endsWith('.ts')).toBe(true);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
it(
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
it('ships every test in the component folder', () => {
|
|
35
|
+
// Together they cover the component, so an app's coverage report can
|
|
36
|
+
// include the copies (packages/ui checks the coverage).
|
|
37
|
+
const components = join(getUiSourceDir(), 'components');
|
|
38
|
+
for (const name of readdirSync(components)) {
|
|
39
|
+
const tests = readdirSync(join(components, name)).filter((file) => file.endsWith('.test.ts'));
|
|
40
|
+
expect(tests, name).not.toEqual([]);
|
|
41
|
+
expect(getComponentFiles(name, { tests: true }), name).toEqual(expect.arrayContaining(tests));
|
|
42
|
+
}
|
|
39
43
|
});
|
|
40
44
|
it('leaves every test behind for an app without the testing library', () => {
|
|
41
45
|
const files = getComponentFiles('line-chart', { tests: false });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-paths.test.js","sourceRoot":"","sources":["../../src/utils/resolve-paths.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,8EAA8E;A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TAILWIND_CONFIG_FILES: string[];
|
|
3
|
+
/** The Tailwind config in the project's folder, if it has one. */
|
|
4
|
+
export declare const tailwindConfigFile: (cwd: string) => string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* The version of Tailwind CSS installed for the project, resolved from its
|
|
7
|
+
* folder as the build resolves it. Reading the project's package.json missed
|
|
8
|
+
* two setups that build fine: a workspace whose root installs `tailwindcss`
|
|
9
|
+
* for every package, and a Tailwind 4 app that lists only
|
|
10
|
+
* `@tailwindcss/postcss`, which depends on `tailwindcss` itself.
|
|
11
|
+
*
|
|
12
|
+
* npm hoists that dependency next to the plugin, where the app finds it.
|
|
13
|
+
* pnpm's strict layout keeps it out of the app's reach, so this looks from
|
|
14
|
+
* the plugin's own folder too. The build still finds it under pnpm: pnpm's
|
|
15
|
+
* bin scripts, `ng` among them, put the packages pnpm hoists on `NODE_PATH`,
|
|
16
|
+
* and Tailwind resolves the stylesheet's `@import 'tailwindcss'` against it.
|
|
17
|
+
* Undefined when neither finds it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const installedTailwindVersion: (cwd: string) => string | undefined;
|
|
20
|
+
/** A version's major, `4` for `4.3.3`. */
|
|
21
|
+
export declare const majorVersion: (version: string) => number;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the project is set up for Tailwind 4, where the stylesheet imports
|
|
24
|
+
* the theme's `tailwind.css` rather than `tailwind.config.ts` listing its
|
|
25
|
+
* plugin: it has no Tailwind config, and Tailwind 4 installed, as
|
|
26
|
+
* `ng add @blotch/angular-lynx` and `ng new --style=tailwind` set it up. A
|
|
27
|
+
* config means a Tailwind 3 setup, even with Tailwind 4 installed, as
|
|
28
|
+
* `doctor` warns.
|
|
29
|
+
*/
|
|
30
|
+
export declare const usesTailwind4: (cwd: string) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The theme files a project takes: the colors, and what maps them to
|
|
33
|
+
* Tailwind's utilities, `tailwind.css` for Tailwind 4 (imported in the
|
|
34
|
+
* stylesheet) or `tailwind-plugin.ts` for Tailwind 3 (a config plugin).
|
|
35
|
+
*
|
|
36
|
+
* With `tests`, the plugin comes with its test, for the same reason as a
|
|
37
|
+
* component's (see getComponentFiles): it covers the plugin in the app's
|
|
38
|
+
* coverage report. `tailwind.css` has no code to cover. The theme folder's
|
|
39
|
+
* other tests stay behind: they check the theme in packages/ui with Node,
|
|
40
|
+
* against the components and Tailwind's own builds, which an app's `ng test`
|
|
41
|
+
* can't do.
|
|
42
|
+
*/
|
|
43
|
+
export declare const themeFilesFor: (cwd: string, { tests }?: {
|
|
44
|
+
tests?: boolean;
|
|
45
|
+
}) => string[];
|