@adonis-agora/agent 0.74.1 → 0.76.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/CHANGELOG.md +42 -0
- package/README.md +16 -0
- package/dist/src/channels/handler.d.ts.map +1 -1
- package/dist/src/channels/handler.js +10 -0
- package/dist/src/channels/handler.js.map +1 -1
- package/dist/src/channels/texts.d.ts +2 -0
- package/dist/src/channels/texts.d.ts.map +1 -1
- package/dist/src/channels/texts.js.map +1 -1
- package/dist/src/genui/catalog.d.ts.map +1 -1
- package/dist/src/genui/catalog.js +3 -1
- package/dist/src/genui/catalog.js.map +1 -1
- package/dist/src/genui/channels.d.ts +32 -5
- package/dist/src/genui/channels.d.ts.map +1 -1
- package/dist/src/genui/channels.js +20 -9
- package/dist/src/genui/channels.js.map +1 -1
- package/dist/src/genui/index.d.ts.map +1 -1
- package/dist/src/genui/index.js +7 -7
- package/dist/src/genui/index.js.map +1 -1
- package/dist/src/genui/kit/bundle.d.ts +12 -0
- package/dist/src/genui/kit/bundle.d.ts.map +1 -1
- package/dist/src/genui/kit/bundle.js +124 -133
- package/dist/src/genui/kit/bundle.js.map +1 -1
- package/dist/src/genui/kit/discover.d.ts +8 -5
- package/dist/src/genui/kit/discover.d.ts.map +1 -1
- package/dist/src/genui/kit/discover.js +45 -18
- package/dist/src/genui/kit/discover.js.map +1 -1
- package/dist/src/genui/kit/docs.d.ts +3 -1
- package/dist/src/genui/kit/docs.d.ts.map +1 -1
- package/dist/src/genui/kit/docs.js +22 -5
- package/dist/src/genui/kit/docs.js.map +1 -1
- package/dist/src/genui/kit/files.d.ts +22 -10
- package/dist/src/genui/kit/files.d.ts.map +1 -1
- package/dist/src/genui/kit/files.js +117 -19
- package/dist/src/genui/kit/files.js.map +1 -1
- package/dist/src/genui/kit/index.d.ts +5 -3
- package/dist/src/genui/kit/index.d.ts.map +1 -1
- package/dist/src/genui/kit/index.js +4 -2
- package/dist/src/genui/kit/index.js.map +1 -1
- package/dist/src/genui/kit/plugin.d.ts +17 -9
- package/dist/src/genui/kit/plugin.d.ts.map +1 -1
- package/dist/src/genui/kit/plugin.js +196 -129
- package/dist/src/genui/kit/plugin.js.map +1 -1
- package/dist/src/genui/kit/styles.d.ts +83 -0
- package/dist/src/genui/kit/styles.d.ts.map +1 -0
- package/dist/src/genui/kit/styles.js +406 -0
- package/dist/src/genui/kit/styles.js.map +1 -0
- package/dist/src/genui/kit/vite-build.d.ts +33 -0
- package/dist/src/genui/kit/vite-build.d.ts.map +1 -0
- package/dist/src/genui/kit/vite-build.js +195 -0
- package/dist/src/genui/kit/vite-build.js.map +1 -0
- package/dist/src/genui/kit/write.d.ts +20 -8
- package/dist/src/genui/kit/write.d.ts.map +1 -1
- package/dist/src/genui/kit/write.js +54 -16
- package/dist/src/genui/kit/write.js.map +1 -1
- package/dist/src/genui/public.d.ts +5 -4
- package/dist/src/genui/public.d.ts.map +1 -1
- package/dist/src/genui/public.js +4 -3
- package/dist/src/genui/public.js.map +1 -1
- package/dist/src/genui/sandbox-jsx-frame-generated.d.ts +2 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.d.ts.map +1 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.js +4 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.js.map +1 -0
- package/dist/src/genui/sandbox-kit.d.ts +50 -17
- package/dist/src/genui/sandbox-kit.d.ts.map +1 -1
- package/dist/src/genui/sandbox-kit.js +20 -10
- package/dist/src/genui/sandbox-kit.js.map +1 -1
- package/dist/src/genui/sandbox-styles.d.ts +113 -0
- package/dist/src/genui/sandbox-styles.d.ts.map +1 -0
- package/dist/src/genui/sandbox-styles.js +487 -0
- package/dist/src/genui/sandbox-styles.js.map +1 -0
- package/dist/src/genui/sandbox-theme.d.ts +13 -9
- package/dist/src/genui/sandbox-theme.d.ts.map +1 -1
- package/dist/src/genui/sandbox-theme.js +52 -60
- package/dist/src/genui/sandbox-theme.js.map +1 -1
- package/dist/src/genui/sandbox.d.ts +21 -15
- package/dist/src/genui/sandbox.d.ts.map +1 -1
- package/dist/src/genui/sandbox.js +66 -17
- package/dist/src/genui/sandbox.js.map +1 -1
- package/dist/src/genui/tools.d.ts +20 -0
- package/dist/src/genui/tools.d.ts.map +1 -1
- package/dist/src/genui/tools.js +19 -4
- package/dist/src/genui/tools.js.map +1 -1
- package/dist/src/hooks/genui_kit.d.ts +6 -2
- package/dist/src/hooks/genui_kit.d.ts.map +1 -1
- package/dist/src/hooks/genui_kit.js +21 -9
- package/dist/src/hooks/genui_kit.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/negotiated-tool-ui.d.ts.map +1 -1
- package/dist/src/negotiated-tool-ui.js +4 -0
- package/dist/src/negotiated-tool-ui.js.map +1 -1
- package/dist/src/react/core/genui/sandbox-assets.d.ts +4 -1
- package/dist/src/react/core/genui/sandbox-assets.d.ts.map +1 -1
- package/dist/src/react/core/genui/sandbox-assets.js +17 -5
- package/dist/src/react/core/genui/sandbox-assets.js.map +1 -1
- package/dist/src/react/core/genui/sandbox.d.ts +1 -1
- package/dist/src/react/core/genui/sandbox.d.ts.map +1 -1
- package/dist/src/react/core/genui/sandbox.js +20 -4
- package/dist/src/react/core/genui/sandbox.js.map +1 -1
- package/dist/src/react-native/genui/index.d.ts +20 -0
- package/dist/src/react-native/genui/index.d.ts.map +1 -0
- package/dist/src/react-native/genui/index.js +18 -0
- package/dist/src/react-native/genui/index.js.map +1 -0
- package/dist/src/react-native/genui/provider.d.ts +19 -0
- package/dist/src/react-native/genui/provider.d.ts.map +1 -0
- package/dist/src/react-native/genui/provider.js +23 -0
- package/dist/src/react-native/genui/provider.js.map +1 -0
- package/dist/src/react-native/genui/sandbox-assets.d.ts +57 -0
- package/dist/src/react-native/genui/sandbox-assets.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox-assets.js +153 -0
- package/dist/src/react-native/genui/sandbox-assets.js.map +1 -0
- package/dist/src/react-native/genui/sandbox-host.d.ts +119 -0
- package/dist/src/react-native/genui/sandbox-host.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox-host.js +188 -0
- package/dist/src/react-native/genui/sandbox-host.js.map +1 -0
- package/dist/src/react-native/genui/sandbox.d.ts +86 -0
- package/dist/src/react-native/genui/sandbox.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox.js +376 -0
- package/dist/src/react-native/genui/sandbox.js.map +1 -0
- package/dist/src/vite/index.d.ts +10 -7
- package/dist/src/vite/index.d.ts.map +1 -1
- package/dist/src/vite/index.js +10 -7
- package/dist/src/vite/index.js.map +1 -1
- package/package.json +28 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { SandboxKitDocs } from '../sandbox-kit.js';
|
|
2
|
+
import { type CssVocabulary, type TailwindTokens } from '../sandbox-styles.js';
|
|
3
|
+
/** Extensions a style entry may have. */
|
|
4
|
+
export declare const STYLE_EXTENSIONS: string[];
|
|
5
|
+
/**
|
|
6
|
+
* A stylesheet import as CSS resolves it: relative, absolute, an alias of the app's Vite config, or
|
|
7
|
+
* a package (`bootstrap/dist/css/bootstrap.css`, `shadcn/tailwind.css`, `@fontsource-variable/geist`
|
|
8
|
+
* — its `exports` under the `style` condition, its `style` field).
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveStyleImport(spec: string, fromDir: string, alias?: Record<string, string>): string | undefined;
|
|
11
|
+
/** One stylesheet the app's styles are made of, as written. */
|
|
12
|
+
export interface StyleSource {
|
|
13
|
+
file: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The style entries and every stylesheet they `@import` (plain CSS imports are followed through
|
|
18
|
+
* packages; Sass/Less partials are read for detection only). The `tailwindcss` package itself is
|
|
19
|
+
* not read (the frame brings its own runtime).
|
|
20
|
+
*/
|
|
21
|
+
export declare function collectStyleSources(entries: readonly string[], options?: {
|
|
22
|
+
alias?: Record<string, string>;
|
|
23
|
+
}): StyleSource[];
|
|
24
|
+
/** The `styles` option as files: paths and globs relative to the root, or package stylesheets. */
|
|
25
|
+
export declare function resolveStyleEntries(root: string, styles: string | readonly string[]): {
|
|
26
|
+
files: string[];
|
|
27
|
+
missing: string[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The app's style entries, found from its Vite setup — what `genuiSandboxKit()` uses without
|
|
31
|
+
* `styles`: the stylesheets among `build.rollupOptions.input` (the AdonisJS plugin puts its
|
|
32
|
+
* `entrypoints` there) or linked from `index.html`, and those the script entries import directly
|
|
33
|
+
* (`import './app.css'`). CSS modules are left out.
|
|
34
|
+
*/
|
|
35
|
+
export declare function discoverStyleEntries(root: string, options?: {
|
|
36
|
+
input?: unknown;
|
|
37
|
+
}): string[];
|
|
38
|
+
/** The app's styles, compiled and understood. */
|
|
39
|
+
export interface SandboxKitStyles {
|
|
40
|
+
/** Compiled CSS (fonts and images inlined). */
|
|
41
|
+
css: string;
|
|
42
|
+
hash: string;
|
|
43
|
+
/** The files the styles are made of (entries and what they import) — what to watch. */
|
|
44
|
+
files: string[];
|
|
45
|
+
tailwind?: {
|
|
46
|
+
version: 3 | 4;
|
|
47
|
+
tokens: TailwindTokens;
|
|
48
|
+
directives: string;
|
|
49
|
+
};
|
|
50
|
+
vocabulary?: CssVocabulary;
|
|
51
|
+
/** Custom properties on the styles' root. */
|
|
52
|
+
vars: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
export interface BuildSandboxKitStylesOptions {
|
|
55
|
+
root: string;
|
|
56
|
+
entries: readonly string[];
|
|
57
|
+
resolve?: Record<string, unknown>;
|
|
58
|
+
css?: Record<string, unknown>;
|
|
59
|
+
publicDir?: string | false;
|
|
60
|
+
plugins?: unknown[];
|
|
61
|
+
inlineAssetLimit?: number;
|
|
62
|
+
inlineAssetBudget?: number;
|
|
63
|
+
warn?: (message: string) => void;
|
|
64
|
+
/** Compile with Vite. Default true; false reads the files as they are (plain CSS only). */
|
|
65
|
+
compile?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** Aliases of a resolved Vite `resolve` (object or array form) as `find → replacement` strings. */
|
|
68
|
+
export declare function stringAliases(resolveOptions: Record<string, unknown> | undefined): Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Compile the style entries with the app's Vite CSS pipeline and work out what they are: Tailwind
|
|
71
|
+
* (its version, tokens, and the directives the frame's runtime needs — v3's config theme mapped to
|
|
72
|
+
* v4), or plain CSS (its class vocabulary). `null` with no entries.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildSandboxKitStyles(options: BuildSandboxKitStylesOptions): Promise<SandboxKitStyles | null>;
|
|
75
|
+
/** The docs half of compiled styles (what the model is told). */
|
|
76
|
+
export declare function stylesDocs(styles: SandboxKitStyles | null): Pick<SandboxKitDocs, 'tailwind' | 'vocabulary'>;
|
|
77
|
+
/** `stylesDocs`: a file (markdown, text) relative to the root, or the guidance itself. */
|
|
78
|
+
export declare function readStylesGuide(root: string, stylesDocs: string | undefined): string | undefined;
|
|
79
|
+
/** A fresh instance of the app's Tailwind Vite plugin, when the app has one and the kit has none. */
|
|
80
|
+
export declare function tailwindVitePluginFor(root: string, appPlugins: readonly {
|
|
81
|
+
name?: string;
|
|
82
|
+
}[], given: readonly unknown[]): Promise<unknown[]>;
|
|
83
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/genui/kit/styles.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,cAAc,EAKpB,MAAM,sBAAsB,CAAC;AAK9B,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAuCF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAM,CAAC,MAAM,EAA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which files they are (given, or found from the
|
|
3
|
+
* app's Vite entrypoints), what they are (Tailwind v3/v4 or plain CSS), and what they compile to
|
|
4
|
+
* with the app's own Vite CSS pipeline (Sass, Less, PostCSS, CSS modules, Tailwind's plugin…).
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
import { dirname, extname, isAbsolute, join, resolve } from 'node:path';
|
|
9
|
+
import { pathToFileURL } from 'node:url';
|
|
10
|
+
import { extractCssVocabulary, tailwindDirectivesFromCss, tailwindTokensFromCss, tailwindV3ConfigToCss, tailwindVersionOf, } from '../sandbox-styles.js';
|
|
11
|
+
import { themeVarsFromCss } from '../sandbox-theme.js';
|
|
12
|
+
import { globFiles } from './files.js';
|
|
13
|
+
import { contentHash, runKitViteBuild } from './vite-build.js';
|
|
14
|
+
/** Extensions a style entry may have. */
|
|
15
|
+
export const STYLE_EXTENSIONS = [
|
|
16
|
+
'.css',
|
|
17
|
+
'.scss',
|
|
18
|
+
'.sass',
|
|
19
|
+
'.less',
|
|
20
|
+
'.styl',
|
|
21
|
+
'.stylus',
|
|
22
|
+
'.pcss',
|
|
23
|
+
'.postcss',
|
|
24
|
+
'.sss',
|
|
25
|
+
];
|
|
26
|
+
const isStyleFile = (file) => STYLE_EXTENSIONS.includes(extname(file.split('?')[0] ?? file).toLowerCase());
|
|
27
|
+
/** The package a bare specifier names, found from `fromDir` up. */
|
|
28
|
+
function packageDir(name, fromDir) {
|
|
29
|
+
let dir = fromDir;
|
|
30
|
+
for (;;) {
|
|
31
|
+
const candidate = join(dir, 'node_modules', name);
|
|
32
|
+
if (existsSync(join(candidate, 'package.json')))
|
|
33
|
+
return candidate;
|
|
34
|
+
const parent = dirname(dir);
|
|
35
|
+
if (parent === dir)
|
|
36
|
+
return undefined;
|
|
37
|
+
dir = parent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** An `exports` target under the conditions a stylesheet import uses (`style`, then the defaults). */
|
|
41
|
+
function exportTarget(value) {
|
|
42
|
+
if (typeof value === 'string')
|
|
43
|
+
return value;
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
for (const each of value) {
|
|
46
|
+
const found = exportTarget(each);
|
|
47
|
+
if (found !== undefined)
|
|
48
|
+
return found;
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === 'object' && value !== null) {
|
|
53
|
+
const record = value;
|
|
54
|
+
for (const condition of ['style', 'sass', 'import', 'default', 'require']) {
|
|
55
|
+
if (condition in record) {
|
|
56
|
+
const found = exportTarget(record[condition]);
|
|
57
|
+
if (found !== undefined)
|
|
58
|
+
return found;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A stylesheet import as CSS resolves it: relative, absolute, an alias of the app's Vite config, or
|
|
66
|
+
* a package (`bootstrap/dist/css/bootstrap.css`, `shadcn/tailwind.css`, `@fontsource-variable/geist`
|
|
67
|
+
* — its `exports` under the `style` condition, its `style` field).
|
|
68
|
+
*/
|
|
69
|
+
export function resolveStyleImport(spec, fromDir, alias = {}) {
|
|
70
|
+
let target = spec.replace(/^~(?!\/)/, '');
|
|
71
|
+
for (const [key, value] of Object.entries(alias)) {
|
|
72
|
+
if (target === key || target.startsWith(`${key}/`)) {
|
|
73
|
+
target = `${value}${target.slice(key.length)}`;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const file = (path) => (existsSync(path) && statSync(path).isFile() ? path : undefined);
|
|
78
|
+
if (target.startsWith('.') || isAbsolute(target)) {
|
|
79
|
+
const path = resolve(fromDir, target);
|
|
80
|
+
return file(path) ?? file(`${path}.css`) ?? file(join(path, 'index.css'));
|
|
81
|
+
}
|
|
82
|
+
const parts = target.split('/');
|
|
83
|
+
const name = target.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0];
|
|
84
|
+
const sub = parts.slice(target.startsWith('@') ? 2 : 1).join('/');
|
|
85
|
+
const dir = packageDir(name, fromDir);
|
|
86
|
+
if (dir === undefined)
|
|
87
|
+
return undefined;
|
|
88
|
+
let manifest = {};
|
|
89
|
+
try {
|
|
90
|
+
manifest = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
/* no manifest: paths only */
|
|
94
|
+
}
|
|
95
|
+
const exportsField = manifest.exports;
|
|
96
|
+
if (typeof exportsField === 'object' && exportsField !== null && !Array.isArray(exportsField)) {
|
|
97
|
+
const map = exportsField;
|
|
98
|
+
const key = sub === '' ? '.' : `./${sub}`;
|
|
99
|
+
const exact = map[key] !== undefined ? exportTarget(map[key]) : undefined;
|
|
100
|
+
if (exact !== undefined)
|
|
101
|
+
return file(join(dir, exact));
|
|
102
|
+
for (const [pattern, value] of Object.entries(map)) {
|
|
103
|
+
if (!pattern.includes('*'))
|
|
104
|
+
continue;
|
|
105
|
+
const [before, after] = pattern.split('*');
|
|
106
|
+
if (key.startsWith(before) && key.endsWith(after)) {
|
|
107
|
+
const star = key.slice(before.length, key.length - after.length);
|
|
108
|
+
const found = exportTarget(value);
|
|
109
|
+
if (found !== undefined)
|
|
110
|
+
return file(join(dir, found.replace('*', star)));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (typeof exportsField === 'string' && sub === '')
|
|
115
|
+
return file(join(dir, exportsField));
|
|
116
|
+
if (sub !== '')
|
|
117
|
+
return file(join(dir, sub)) ?? file(join(dir, `${sub}.css`));
|
|
118
|
+
if (manifest.style !== undefined)
|
|
119
|
+
return file(join(dir, manifest.style));
|
|
120
|
+
if (manifest.main !== undefined && isStyleFile(manifest.main))
|
|
121
|
+
return file(join(dir, manifest.main));
|
|
122
|
+
return file(join(dir, 'index.css'));
|
|
123
|
+
}
|
|
124
|
+
/** The `@import`s of a stylesheet (plain CSS, and Sass/Less `@use`/`@forward`/`@import`). */
|
|
125
|
+
function importsOf(text) {
|
|
126
|
+
const out = [];
|
|
127
|
+
const clean = text.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
128
|
+
for (const match of clean.matchAll(/@(?:import|use|forward)\s+(?:url\(\s*)?["']([^"']+)["']/g))
|
|
129
|
+
out.push(match[1]);
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The style entries and every stylesheet they `@import` (plain CSS imports are followed through
|
|
134
|
+
* packages; Sass/Less partials are read for detection only). The `tailwindcss` package itself is
|
|
135
|
+
* not read (the frame brings its own runtime).
|
|
136
|
+
*/
|
|
137
|
+
export function collectStyleSources(entries, options = {}) {
|
|
138
|
+
const seen = new Set();
|
|
139
|
+
const out = [];
|
|
140
|
+
const visit = (file, depth) => {
|
|
141
|
+
if (seen.has(file) || depth > 16)
|
|
142
|
+
return;
|
|
143
|
+
seen.add(file);
|
|
144
|
+
let text;
|
|
145
|
+
try {
|
|
146
|
+
text = readFileSync(file, 'utf8');
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
out.push({ file, text });
|
|
152
|
+
for (const spec of importsOf(text)) {
|
|
153
|
+
if (/^(https?:)?\/\//.test(spec) || /^tailwindcss(\/|$)/.test(spec))
|
|
154
|
+
continue;
|
|
155
|
+
const found = resolveStyleImport(spec, dirname(file), options.alias);
|
|
156
|
+
if (found !== undefined && /\.(css|pcss|postcss)$/i.test(found))
|
|
157
|
+
visit(found, depth + 1);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
for (const entry of entries)
|
|
161
|
+
visit(entry, 0);
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
/** The `styles` option as files: paths and globs relative to the root, or package stylesheets. */
|
|
165
|
+
export function resolveStyleEntries(root, styles) {
|
|
166
|
+
const files = [];
|
|
167
|
+
const missing = [];
|
|
168
|
+
for (const spec of typeof styles === 'string' ? [styles] : styles) {
|
|
169
|
+
if (/[*?{]/.test(spec)) {
|
|
170
|
+
const matched = globFiles(root, spec);
|
|
171
|
+
if (matched.length === 0)
|
|
172
|
+
missing.push(spec);
|
|
173
|
+
files.push(...matched);
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const path = isAbsolute(spec) ? spec : resolve(root, spec);
|
|
177
|
+
if (existsSync(path) && statSync(path).isFile()) {
|
|
178
|
+
files.push(path);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const found = spec.startsWith('.') ? undefined : resolveStyleImport(spec, root);
|
|
182
|
+
if (found !== undefined)
|
|
183
|
+
files.push(found);
|
|
184
|
+
else
|
|
185
|
+
missing.push(spec);
|
|
186
|
+
}
|
|
187
|
+
return { files: [...new Set(files)], missing };
|
|
188
|
+
}
|
|
189
|
+
function inputList(input) {
|
|
190
|
+
if (typeof input === 'string')
|
|
191
|
+
return [input];
|
|
192
|
+
if (Array.isArray(input))
|
|
193
|
+
return input.filter((each) => typeof each === 'string');
|
|
194
|
+
if (typeof input === 'object' && input !== null)
|
|
195
|
+
return Object.values(input).filter((each) => typeof each === 'string');
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The app's style entries, found from its Vite setup — what `genuiSandboxKit()` uses without
|
|
200
|
+
* `styles`: the stylesheets among `build.rollupOptions.input` (the AdonisJS plugin puts its
|
|
201
|
+
* `entrypoints` there) or linked from `index.html`, and those the script entries import directly
|
|
202
|
+
* (`import './app.css'`). CSS modules are left out.
|
|
203
|
+
*/
|
|
204
|
+
export function discoverStyleEntries(root, options = {}) {
|
|
205
|
+
const entries = inputList(options.input).map((each) => isAbsolute(each) ? each : resolve(root, each));
|
|
206
|
+
if (entries.length === 0) {
|
|
207
|
+
const html = join(root, 'index.html');
|
|
208
|
+
if (existsSync(html)) {
|
|
209
|
+
const text = readFileSync(html, 'utf8');
|
|
210
|
+
for (const match of text.matchAll(/<link\b[^>]*>/gi)) {
|
|
211
|
+
const tag = match[0];
|
|
212
|
+
if (!/rel\s*=\s*["']?stylesheet/i.test(tag))
|
|
213
|
+
continue;
|
|
214
|
+
const href = /href\s*=\s*["']([^"']+)["']/i.exec(tag)?.[1];
|
|
215
|
+
if (href !== undefined && !/^(https?:)?\/\//.test(href))
|
|
216
|
+
entries.push(resolve(root, href.replace(/^\//, '')));
|
|
217
|
+
}
|
|
218
|
+
for (const match of text.matchAll(/<script\b[^>]*type\s*=\s*["']module["'][^>]*>/gi)) {
|
|
219
|
+
const src = /src\s*=\s*["']([^"']+)["']/i.exec(match[0])?.[1];
|
|
220
|
+
if (src !== undefined && !/^(https?:)?\/\//.test(src))
|
|
221
|
+
entries.push(resolve(root, src.replace(/^\//, '')));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const styles = [];
|
|
226
|
+
const add = (file) => {
|
|
227
|
+
if (!/\.module\.[a-z]+$/i.test(file) && existsSync(file) && !styles.includes(file))
|
|
228
|
+
styles.push(file);
|
|
229
|
+
};
|
|
230
|
+
for (const entry of entries) {
|
|
231
|
+
if (isStyleFile(entry)) {
|
|
232
|
+
add(entry);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (!existsSync(entry))
|
|
236
|
+
continue;
|
|
237
|
+
let text;
|
|
238
|
+
try {
|
|
239
|
+
text = readFileSync(entry, 'utf8');
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
for (const match of text.matchAll(/^\s*import\s+["']([^"']+)["']/gm)) {
|
|
245
|
+
const spec = match[1];
|
|
246
|
+
if (!isStyleFile(spec))
|
|
247
|
+
continue;
|
|
248
|
+
const found = spec.startsWith('.') || isAbsolute(spec)
|
|
249
|
+
? resolve(dirname(entry), spec)
|
|
250
|
+
: resolveStyleImport(spec, dirname(entry));
|
|
251
|
+
if (found !== undefined)
|
|
252
|
+
add(found);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return styles;
|
|
256
|
+
}
|
|
257
|
+
/** A Tailwind v3 config's theme as v4 directives (`tailwind.config.*` in the root, or `@config`). */
|
|
258
|
+
async function tailwindV3Css(root, sources, warn) {
|
|
259
|
+
let path;
|
|
260
|
+
for (const source of sources) {
|
|
261
|
+
const spec = /@config\s+["']([^"']+)["']/.exec(source.text)?.[1];
|
|
262
|
+
if (spec !== undefined) {
|
|
263
|
+
path = resolve(dirname(source.file), spec);
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
path ??= ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs']
|
|
268
|
+
.map((extension) => join(root, `tailwind.config.${extension}`))
|
|
269
|
+
.find((candidate) => existsSync(candidate));
|
|
270
|
+
if (path === undefined || !existsSync(path))
|
|
271
|
+
return '';
|
|
272
|
+
try {
|
|
273
|
+
const mod = (await import(`${pathToFileURL(path).href}?t=${statSync(path).mtimeMs}`));
|
|
274
|
+
return tailwindV3ConfigToCss(mod.default ?? mod);
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
warn?.(`the Tailwind v3 config ${path} did not load (${error instanceof Error ? error.message : String(error)}); the frame's Tailwind has the default theme`);
|
|
278
|
+
return '';
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/** Aliases of a resolved Vite `resolve` (object or array form) as `find → replacement` strings. */
|
|
282
|
+
export function stringAliases(resolveOptions) {
|
|
283
|
+
const alias = resolveOptions?.alias;
|
|
284
|
+
const out = {};
|
|
285
|
+
if (Array.isArray(alias)) {
|
|
286
|
+
for (const entry of alias)
|
|
287
|
+
if (typeof entry.find === 'string' && typeof entry.replacement === 'string')
|
|
288
|
+
out[entry.find] = entry.replacement;
|
|
289
|
+
}
|
|
290
|
+
else if (typeof alias === 'object' && alias !== null) {
|
|
291
|
+
for (const [find, replacement] of Object.entries(alias))
|
|
292
|
+
if (typeof replacement === 'string')
|
|
293
|
+
out[find] = replacement;
|
|
294
|
+
}
|
|
295
|
+
return out;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Compile the style entries with the app's Vite CSS pipeline and work out what they are: Tailwind
|
|
299
|
+
* (its version, tokens, and the directives the frame's runtime needs — v3's config theme mapped to
|
|
300
|
+
* v4), or plain CSS (its class vocabulary). `null` with no entries.
|
|
301
|
+
*/
|
|
302
|
+
export async function buildSandboxKitStyles(options) {
|
|
303
|
+
if (options.entries.length === 0)
|
|
304
|
+
return null;
|
|
305
|
+
const sources = collectStyleSources(options.entries, { alias: stringAliases(options.resolve) });
|
|
306
|
+
let css;
|
|
307
|
+
if (options.compile === false) {
|
|
308
|
+
css = sources
|
|
309
|
+
.filter((source) => /\.css$/i.test(source.file))
|
|
310
|
+
.map((source) => source.text)
|
|
311
|
+
.join('\n');
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
const built = await runKitViteBuild({
|
|
315
|
+
root: options.root,
|
|
316
|
+
entry: options.entries.map((file) => `import ${JSON.stringify(file)};`).join('\n'),
|
|
317
|
+
...(options.resolve !== undefined ? { resolve: options.resolve } : {}),
|
|
318
|
+
...(options.css !== undefined ? { css: options.css } : {}),
|
|
319
|
+
...(options.publicDir !== undefined ? { publicDir: options.publicDir } : {}),
|
|
320
|
+
...(options.plugins !== undefined ? { plugins: options.plugins } : {}),
|
|
321
|
+
...(options.inlineAssetLimit !== undefined
|
|
322
|
+
? { inlineAssetLimit: options.inlineAssetLimit }
|
|
323
|
+
: {}),
|
|
324
|
+
...(options.inlineAssetBudget !== undefined
|
|
325
|
+
? { inlineAssetBudget: options.inlineAssetBudget }
|
|
326
|
+
: {}),
|
|
327
|
+
...(options.warn !== undefined ? { warn: options.warn } : {}),
|
|
328
|
+
});
|
|
329
|
+
css = built.css;
|
|
330
|
+
}
|
|
331
|
+
const versions = [
|
|
332
|
+
...sources.map((source) => tailwindVersionOf(source.text)),
|
|
333
|
+
tailwindVersionOf(css),
|
|
334
|
+
].filter((version) => version !== null);
|
|
335
|
+
const version = versions.includes(4) ? 4 : versions.includes(3) ? 3 : undefined;
|
|
336
|
+
const result = {
|
|
337
|
+
css,
|
|
338
|
+
hash: contentHash(css),
|
|
339
|
+
files: sources.map((source) => source.file),
|
|
340
|
+
vars: themeVarsFromCss(css, { rootOnly: true }),
|
|
341
|
+
};
|
|
342
|
+
if (version !== undefined) {
|
|
343
|
+
const parts = new Set();
|
|
344
|
+
if (version === 3) {
|
|
345
|
+
const mapped = await tailwindV3Css(options.root, sources, options.warn);
|
|
346
|
+
if (mapped !== '')
|
|
347
|
+
parts.add(mapped);
|
|
348
|
+
}
|
|
349
|
+
for (const source of sources) {
|
|
350
|
+
const directives = tailwindDirectivesFromCss(source.text);
|
|
351
|
+
if (directives !== '')
|
|
352
|
+
parts.add(directives);
|
|
353
|
+
}
|
|
354
|
+
const directives = [...parts].join('\n');
|
|
355
|
+
result.tailwind = { version, tokens: tailwindTokensFromCss(directives), directives };
|
|
356
|
+
if (Object.keys(result.vars).length === 0) {
|
|
357
|
+
for (const source of sources)
|
|
358
|
+
Object.assign(result.vars, {
|
|
359
|
+
...themeVarsFromCss(source.text, { rootOnly: true }),
|
|
360
|
+
...result.vars,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
result.vocabulary = extractCssVocabulary(css);
|
|
366
|
+
}
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
/** The docs half of compiled styles (what the model is told). */
|
|
370
|
+
export function stylesDocs(styles) {
|
|
371
|
+
if (styles === null)
|
|
372
|
+
return {};
|
|
373
|
+
if (styles.tailwind !== undefined)
|
|
374
|
+
return { tailwind: { version: styles.tailwind.version, tokens: styles.tailwind.tokens } };
|
|
375
|
+
return styles.vocabulary !== undefined ? { vocabulary: styles.vocabulary } : {};
|
|
376
|
+
}
|
|
377
|
+
/** `stylesDocs`: a file (markdown, text) relative to the root, or the guidance itself. */
|
|
378
|
+
export function readStylesGuide(root, stylesDocs) {
|
|
379
|
+
if (stylesDocs === undefined)
|
|
380
|
+
return undefined;
|
|
381
|
+
if (!stylesDocs.includes('\n') && stylesDocs.length < 400) {
|
|
382
|
+
const path = isAbsolute(stylesDocs) ? stylesDocs : resolve(root, stylesDocs);
|
|
383
|
+
if (existsSync(path) && statSync(path).isFile())
|
|
384
|
+
return readFileSync(path, 'utf8');
|
|
385
|
+
}
|
|
386
|
+
return stylesDocs;
|
|
387
|
+
}
|
|
388
|
+
/** A fresh instance of the app's Tailwind Vite plugin, when the app has one and the kit has none. */
|
|
389
|
+
export async function tailwindVitePluginFor(root, appPlugins, given) {
|
|
390
|
+
const named = (list) => list
|
|
391
|
+
.flat(Number.POSITIVE_INFINITY)
|
|
392
|
+
.map((plugin) => String(plugin?.name ?? ''));
|
|
393
|
+
if (!appPlugins.some((plugin) => String(plugin.name ?? '').startsWith('@tailwindcss/vite')))
|
|
394
|
+
return [];
|
|
395
|
+
if (named(given).some((name) => name.startsWith('@tailwindcss/vite')))
|
|
396
|
+
return [];
|
|
397
|
+
try {
|
|
398
|
+
const path = createRequire(resolve(root, 'package.json')).resolve('@tailwindcss/vite');
|
|
399
|
+
const mod = (await import(pathToFileURL(path).href));
|
|
400
|
+
return [mod.default()];
|
|
401
|
+
}
|
|
402
|
+
catch {
|
|
403
|
+
return [];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/genui/kit/styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;A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Every CSS file the build emitted, together, its `url()`s made network-less. */
|
|
6
|
+
css: string;
|
|
7
|
+
/** The app modules the build read (`node_modules` and virtual ones left out). */
|
|
8
|
+
modules: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface KitBuildOptions {
|
|
11
|
+
root: string;
|
|
12
|
+
/** The entry module's source (a virtual module; may import anything the app can). */
|
|
13
|
+
entry: string;
|
|
14
|
+
/** `resolve` from the app's Vite config (aliases, dedupe, conditions). */
|
|
15
|
+
resolve?: Record<string, unknown>;
|
|
16
|
+
/** `css` from the app's Vite config (preprocessorOptions, modules, postcss, transformer…). */
|
|
17
|
+
css?: Record<string, unknown>;
|
|
18
|
+
/** The app's public directory (absolute urls in CSS are read from it), or `false`. */
|
|
19
|
+
publicDir?: string | false;
|
|
20
|
+
/** Extra Vite plugins (Tailwind's, one the components need to compile). */
|
|
21
|
+
plugins?: unknown[];
|
|
22
|
+
/** Largest asset inlined, in bytes. */
|
|
23
|
+
inlineAssetLimit?: number;
|
|
24
|
+
/** Most bytes inlined in all. */
|
|
25
|
+
inlineAssetBudget?: number;
|
|
26
|
+
/** Told about every asset left out. */
|
|
27
|
+
warn?: (message: string) => void;
|
|
28
|
+
/** Default true. */
|
|
29
|
+
minify?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function runKitViteBuild(options: KitBuildOptions): Promise<KitBuildOutput>;
|
|
32
|
+
export declare function contentHash(text: string): string;
|
|
33
|
+
//# sourceMappingURL=vite-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-build.d.ts","sourceRoot":"","sources":["../../../../src/genui/kit/vite-build.ts"],"names":[],"mappings":"AAYA,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,oBAAoB;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAkCD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAoJvF;AAqBD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|