@hanzogui/static 8.0.1 → 8.1.1
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/exports.cjs +1 -0
- package/dist/extractor/createExtractor.cjs +2 -1
- package/dist/extractor/esbuildTsconfigPaths.cjs +24 -6
- package/dist/extractor/extractToClassNames.cjs +2 -1
- package/dist/extractor/extractablePath.cjs +51 -0
- package/package.json +31 -16
- package/src/check-dep-versions.ts +5 -1
- package/src/exports.ts +1 -0
- package/src/extractor/bundle.ts +3 -1
- package/src/extractor/createExtractor.ts +8 -6
- package/src/extractor/createLogger.ts +1 -3
- package/src/extractor/esbuildTsconfigPaths.ts +45 -14
- package/src/extractor/extractHelpers.ts +1 -4
- package/src/extractor/extractToClassNames.ts +4 -2
- package/src/extractor/extractablePath.ts +81 -0
- package/src/extractor/loadGui.ts +1 -3
- package/src/extractor/regenerateConfig.ts +1 -4
- package/src/types.ts +1 -4
- package/types/check-dep-versions.d.ts.map +1 -1
- package/types/exports.d.ts +1 -0
- package/types/exports.d.ts.map +1 -1
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/createLogger.d.ts.map +1 -1
- package/types/extractor/esbuildTsconfigPaths.d.ts +2 -1
- package/types/extractor/esbuildTsconfigPaths.d.ts.map +1 -1
- package/types/extractor/extractHelpers.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/extractablePath.d.ts +45 -0
- package/types/extractor/extractablePath.d.ts.map +1 -0
- package/types/extractor/loadGui.d.ts.map +1 -1
- package/types/extractor/regenerateConfig.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
package/dist/exports.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __reExport(exports_exports, require("./types.cjs"), module.exports);
|
|
|
35
35
|
var import_createExtractor = require("./extractor/createExtractor.cjs");
|
|
36
36
|
var import_literalToAst = require("./extractor/literalToAst.cjs");
|
|
37
37
|
__reExport(exports_exports, require("./constants.cjs"), module.exports);
|
|
38
|
+
__reExport(exports_exports, require("./extractor/extractablePath.cjs"), module.exports);
|
|
38
39
|
__reExport(exports_exports, require("./extractor/extractToClassNames.cjs"), module.exports);
|
|
39
40
|
__reExport(exports_exports, require("./extractor/concatClassName.cjs"), module.exports);
|
|
40
41
|
__reExport(exports_exports, require("./extractor/extractToNative.cjs"), module.exports);
|
|
@@ -47,6 +47,7 @@ var import_typescript = require("typescript");
|
|
|
47
47
|
var import_constants = require("../constants.cjs");
|
|
48
48
|
var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
|
|
49
49
|
var import_createEvaluator = require("./createEvaluator.cjs");
|
|
50
|
+
var import_extractablePath = require("./extractablePath.cjs");
|
|
50
51
|
var import_evaluateAstNode = require("./evaluateAstNode.cjs");
|
|
51
52
|
var import_extractHelpers = require("./extractHelpers.cjs");
|
|
52
53
|
var import_findTopmostFunction = require("./findTopmostFunction.cjs");
|
|
@@ -294,7 +295,7 @@ function createExtractor({
|
|
|
294
295
|
throw new Error(`Must provide components`);
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
|
-
if (sourcePath && includeExtensions && !includeExtensions.some(ext => sourcePath.endsWith(ext))) {
|
|
298
|
+
if (sourcePath && includeExtensions && !(0, import_extractablePath.installedPackageOf)(sourcePath) && !includeExtensions.some(ext => sourcePath.endsWith(ext))) {
|
|
298
299
|
if (shouldPrintDebug) {
|
|
299
300
|
logger.info(`Ignoring file due to includeExtensions: ${sourcePath}, includeExtensions: ${includeExtensions.join(", ")}`);
|
|
300
301
|
}
|
|
@@ -39,9 +39,23 @@ __export(esbuildTsconfigPaths_exports, {
|
|
|
39
39
|
module.exports = __toCommonJS(esbuildTsconfigPaths_exports);
|
|
40
40
|
var import_node_fs = __toESM(require("node:fs"));
|
|
41
41
|
var import_node_path = __toESM(require("node:path"));
|
|
42
|
-
var
|
|
42
|
+
var ts = __toESM(require("typescript"));
|
|
43
43
|
const name = "tsconfig-paths";
|
|
44
|
+
const hasProgramApi = typeof ts?.sys?.fileExists === "function";
|
|
45
|
+
let warned = false;
|
|
46
|
+
function warnOnce() {
|
|
47
|
+
if (warned) return;
|
|
48
|
+
warned = true;
|
|
49
|
+
console.warn(` \u27A1 [hanzogui] typescript ${ts?.version ?? "(not found)"} has no program API (7.x removed it from the root export), so tsconfig "paths" are not applied when bundling the gui config. Imports resolve through node.`);
|
|
50
|
+
}
|
|
44
51
|
function TsconfigPathsPlugin() {
|
|
52
|
+
if (!hasProgramApi) {
|
|
53
|
+
warnOnce();
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
setup() {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
45
59
|
const compilerOptions = loadCompilerOptionsFromTsconfig();
|
|
46
60
|
return {
|
|
47
61
|
name,
|
|
@@ -61,7 +75,7 @@ function TsconfigPathsPlugin() {
|
|
|
61
75
|
}
|
|
62
76
|
const {
|
|
63
77
|
resolvedModule
|
|
64
|
-
} =
|
|
78
|
+
} = ts.nodeModuleNameResolver(args.path, args.importer, compilerOptions, ts.sys);
|
|
65
79
|
if (!resolvedModule) {
|
|
66
80
|
return null;
|
|
67
81
|
}
|
|
@@ -79,8 +93,12 @@ function TsconfigPathsPlugin() {
|
|
|
79
93
|
};
|
|
80
94
|
}
|
|
81
95
|
function loadCompilerOptionsFromTsconfig(tsconfig) {
|
|
96
|
+
if (!hasProgramApi) {
|
|
97
|
+
warnOnce();
|
|
98
|
+
return {};
|
|
99
|
+
}
|
|
82
100
|
if (!tsconfig) {
|
|
83
|
-
const configPath =
|
|
101
|
+
const configPath = ts.findConfigFile(process.cwd(), ts.sys.fileExists, "tsconfig.json") || ts.findConfigFile(process.cwd(), ts.sys.fileExists, "jsconfig.json");
|
|
84
102
|
if (configPath) {
|
|
85
103
|
return parseTsconfig(configPath);
|
|
86
104
|
}
|
|
@@ -94,15 +112,15 @@ function loadCompilerOptionsFromTsconfig(tsconfig) {
|
|
|
94
112
|
}
|
|
95
113
|
}
|
|
96
114
|
const baseDir = process.cwd();
|
|
97
|
-
const parsed =
|
|
115
|
+
const parsed = ts.parseJsonConfigFileContent(tsconfig, ts.sys, baseDir);
|
|
98
116
|
return parsed.options;
|
|
99
117
|
}
|
|
100
118
|
function parseTsconfig(configFilePath) {
|
|
101
|
-
const configFile =
|
|
119
|
+
const configFile = ts.readConfigFile(configFilePath, ts.sys.readFile);
|
|
102
120
|
if (configFile.error) {
|
|
103
121
|
throw new Error(`Error reading tsconfig file '${configFilePath}': ${configFile.error.messageText}`);
|
|
104
122
|
}
|
|
105
123
|
const baseDir = import_node_path.default.dirname(configFilePath);
|
|
106
|
-
const parsed =
|
|
124
|
+
const parsed = ts.parseJsonConfigFileContent(configFile.config, ts.sys, baseDir);
|
|
107
125
|
return parsed.options;
|
|
108
126
|
}
|
|
@@ -43,6 +43,7 @@ var path = __toESM(require("node:path"));
|
|
|
43
43
|
var util = __toESM(require("node:util"));
|
|
44
44
|
var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
|
|
45
45
|
var import_babelParse = require("./babelParse.cjs");
|
|
46
|
+
var import_extractablePath = require("./extractablePath.cjs");
|
|
46
47
|
var import_createLogger = require("./createLogger.cjs");
|
|
47
48
|
var import_extractMediaStyle = require("./extractMediaStyle.cjs");
|
|
48
49
|
var import_normalizeTernaries = require("./normalizeTernaries.cjs");
|
|
@@ -64,7 +65,7 @@ async function extractToClassNames({
|
|
|
64
65
|
getCSSStylesAtomic,
|
|
65
66
|
createMediaStyle
|
|
66
67
|
} = (0, import_requireGuiCore.requireGuiCore)("web");
|
|
67
|
-
if (sourcePath.
|
|
68
|
+
if (!(0, import_extractablePath.isExtractable)(sourcePath, options.extractPackages)) {
|
|
68
69
|
return null;
|
|
69
70
|
}
|
|
70
71
|
if (shouldPrintDebug) {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var extractablePath_exports = {};
|
|
24
|
+
__export(extractablePath_exports, {
|
|
25
|
+
DEFAULT_EXTRACT_PACKAGES: () => DEFAULT_EXTRACT_PACKAGES,
|
|
26
|
+
installedPackageOf: () => installedPackageOf,
|
|
27
|
+
isExtractable: () => isExtractable
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(extractablePath_exports);
|
|
30
|
+
const DEFAULT_EXTRACT_PACKAGES = ["@hanzo/ui", "@hanzo/gui", "@hanzogui/*"];
|
|
31
|
+
const NEVER_EXTRACT = ["lucide-icons"];
|
|
32
|
+
const NODE_MODULES = "node_modules/";
|
|
33
|
+
function installedPackageOf(sourcePath) {
|
|
34
|
+
const normalized = sourcePath.replace(/\\/g, "/");
|
|
35
|
+
const at = normalized.lastIndexOf(NODE_MODULES);
|
|
36
|
+
if (at === -1) return "";
|
|
37
|
+
const rest = normalized.slice(at + NODE_MODULES.length);
|
|
38
|
+
const parts = rest.split("/");
|
|
39
|
+
if (!parts[0]) return "";
|
|
40
|
+
return parts[0].startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
41
|
+
}
|
|
42
|
+
function matches(entry, pkg) {
|
|
43
|
+
const prefix = entry.endsWith("/*") ? entry.slice(0, -1) : entry.endsWith("/") ? entry : "";
|
|
44
|
+
return prefix ? pkg.startsWith(prefix) : pkg === entry;
|
|
45
|
+
}
|
|
46
|
+
function isExtractable(sourcePath, extractPackages = []) {
|
|
47
|
+
if (NEVER_EXTRACT.some(name => sourcePath.includes(name))) return false;
|
|
48
|
+
const pkg = installedPackageOf(sourcePath);
|
|
49
|
+
if (!pkg) return true;
|
|
50
|
+
return extractPackages.some(entry => matches(entry, pkg));
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/static",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./types/worker.d.ts",
|
|
23
23
|
"default": "./dist/worker.cjs"
|
|
24
24
|
},
|
|
25
|
+
"./extractablePath": {
|
|
26
|
+
"types": "./types/extractor/extractablePath.d.ts",
|
|
27
|
+
"default": "./dist/extractor/extractablePath.cjs"
|
|
28
|
+
},
|
|
25
29
|
"./checkDeps": {
|
|
26
30
|
"types": "./types/checkDeps.d.ts",
|
|
27
31
|
"default": "./dist/checkDeps.cjs"
|
|
@@ -50,19 +54,19 @@
|
|
|
50
54
|
"@babel/template": "^7.25.0",
|
|
51
55
|
"@babel/traverse": "^7.25.4",
|
|
52
56
|
"@babel/types": "^7.25.4",
|
|
53
|
-
"@hanzogui/cli-color": "8.
|
|
54
|
-
"@hanzogui/config-default": "8.
|
|
55
|
-
"@hanzogui/core": "8.
|
|
56
|
-
"@hanzogui/fake-react-native": "8.
|
|
57
|
-
"@hanzogui/generate-themes": "8.
|
|
58
|
-
"@hanzogui/helpers": "8.
|
|
59
|
-
"@hanzogui/helpers-node": "8.
|
|
60
|
-
"@hanzogui/proxy-worm": "8.
|
|
61
|
-
"@hanzogui/react-native-web-internals": "8.
|
|
62
|
-
"@hanzogui/react-native-web-lite": "8.
|
|
63
|
-
"@hanzogui/shorthands": "8.
|
|
64
|
-
"@hanzogui/types": "8.
|
|
65
|
-
"@hanzogui/web": "8.
|
|
57
|
+
"@hanzogui/cli-color": "8.1.1",
|
|
58
|
+
"@hanzogui/config-default": "8.1.1",
|
|
59
|
+
"@hanzogui/core": "8.1.1",
|
|
60
|
+
"@hanzogui/fake-react-native": "8.1.1",
|
|
61
|
+
"@hanzogui/generate-themes": "8.1.1",
|
|
62
|
+
"@hanzogui/helpers": "8.1.1",
|
|
63
|
+
"@hanzogui/helpers-node": "8.1.1",
|
|
64
|
+
"@hanzogui/proxy-worm": "8.1.1",
|
|
65
|
+
"@hanzogui/react-native-web-internals": "8.1.1",
|
|
66
|
+
"@hanzogui/react-native-web-lite": "8.1.1",
|
|
67
|
+
"@hanzogui/shorthands": "8.1.1",
|
|
68
|
+
"@hanzogui/types": "8.1.1",
|
|
69
|
+
"@hanzogui/web": "8.1.1",
|
|
66
70
|
"babel-literal-to-ast": "^2.1.0",
|
|
67
71
|
"browserslist": "^4.28.1",
|
|
68
72
|
"check-dependency-version-consistency": "^4.1.0",
|
|
@@ -79,7 +83,7 @@
|
|
|
79
83
|
},
|
|
80
84
|
"devDependencies": {
|
|
81
85
|
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
82
|
-
"@hanzogui/build": "8.
|
|
86
|
+
"@hanzogui/build": "8.1.1",
|
|
83
87
|
"@types/babel__core": "^7.20.5",
|
|
84
88
|
"@types/find-root": "^1.1.2",
|
|
85
89
|
"@types/node": "^22.1.0",
|
|
@@ -92,9 +96,20 @@
|
|
|
92
96
|
"typescript": "~5.9.2"
|
|
93
97
|
},
|
|
94
98
|
"peerDependencies": {
|
|
95
|
-
"react": ">=19"
|
|
99
|
+
"react": ">=19",
|
|
100
|
+
"typescript": ">=4"
|
|
101
|
+
},
|
|
102
|
+
"peerDependenciesMeta": {
|
|
103
|
+
"typescript": {
|
|
104
|
+
"optional": true
|
|
105
|
+
}
|
|
96
106
|
},
|
|
97
107
|
"tests": {
|
|
98
108
|
"parallel": true
|
|
109
|
+
},
|
|
110
|
+
"repository": {
|
|
111
|
+
"type": "git",
|
|
112
|
+
"url": "git+https://github.com/hanzoai/gui.git",
|
|
113
|
+
"directory": "pkgs/compiler/static"
|
|
99
114
|
}
|
|
100
115
|
}
|
|
@@ -575,7 +575,11 @@ function check(path: string): {
|
|
|
575
575
|
dependencies: Dependencies
|
|
576
576
|
} {
|
|
577
577
|
const options: Options = {
|
|
578
|
-
includeDepPattern: [
|
|
578
|
+
includeDepPattern: [
|
|
579
|
+
'hanzogui',
|
|
580
|
+
'react-native-web-lite',
|
|
581
|
+
'react-native-web-internals',
|
|
582
|
+
],
|
|
579
583
|
}
|
|
580
584
|
|
|
581
585
|
if (
|
package/src/exports.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './types'
|
|
|
3
3
|
export { createExtractor } from './extractor/createExtractor'
|
|
4
4
|
export { literalToAst } from './extractor/literalToAst'
|
|
5
5
|
export * from './constants'
|
|
6
|
+
export * from './extractor/extractablePath'
|
|
6
7
|
export * from './extractor/extractToClassNames'
|
|
7
8
|
export * from './extractor/concatClassName'
|
|
8
9
|
export * from './extractor/extractToNative'
|
package/src/extractor/bundle.ts
CHANGED
|
@@ -178,7 +178,9 @@ function getESBuildConfig(
|
|
|
178
178
|
// stub files with top-level await - they're typically runtime-only
|
|
179
179
|
if (hasTopLevelAwait(contents, args.path)) {
|
|
180
180
|
if (process.env.DEBUG?.startsWith('hanzogui')) {
|
|
181
|
-
console.info(
|
|
181
|
+
console.info(
|
|
182
|
+
`[hanzogui] stubbing file with top-level await: ${args.path}`
|
|
183
|
+
)
|
|
182
184
|
}
|
|
183
185
|
return {
|
|
184
186
|
// Keep this as an ESM-shaped stub so esbuild doesn't inline a
|
|
@@ -30,6 +30,7 @@ import type {
|
|
|
30
30
|
} from '../types'
|
|
31
31
|
import type { LoadedComponents, GuiProjectInfo } from './bundleConfig'
|
|
32
32
|
import { createEvaluator, createSafeEvaluator } from './createEvaluator'
|
|
33
|
+
import { installedPackageOf } from './extractablePath'
|
|
33
34
|
import { evaluateAstNode } from './evaluateAstNode'
|
|
34
35
|
import {
|
|
35
36
|
attrStr,
|
|
@@ -351,9 +352,15 @@ export function createExtractor(
|
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
354
|
|
|
355
|
+
// includeExtensions describes the app's OWN source, where the author picks
|
|
356
|
+
// the extension. An installed package ships whatever its build emits —
|
|
357
|
+
// .mjs, .js — and it already passed the package allowlist to get here, so
|
|
358
|
+
// holding it to ['.ts', '.tsx', '.jsx'] rejected every design-system file
|
|
359
|
+
// the allowlist had just admitted.
|
|
354
360
|
if (
|
|
355
361
|
sourcePath &&
|
|
356
362
|
includeExtensions &&
|
|
363
|
+
!installedPackageOf(sourcePath) &&
|
|
357
364
|
!includeExtensions.some((ext) => sourcePath.endsWith(ext))
|
|
358
365
|
) {
|
|
359
366
|
if (shouldPrintDebug) {
|
|
@@ -2156,12 +2163,7 @@ export function createExtractor(
|
|
|
2156
2163
|
hasImportedTheme = true
|
|
2157
2164
|
programPath.node.body.push(
|
|
2158
2165
|
t.importDeclaration(
|
|
2159
|
-
[
|
|
2160
|
-
t.importSpecifier(
|
|
2161
|
-
t.identifier('_GuiTheme'),
|
|
2162
|
-
t.identifier('Theme')
|
|
2163
|
-
),
|
|
2164
|
-
],
|
|
2166
|
+
[t.importSpecifier(t.identifier('_GuiTheme'), t.identifier('Theme'))],
|
|
2165
2167
|
t.stringLiteral('@hanzogui/web')
|
|
2166
2168
|
)
|
|
2167
2169
|
)
|
|
@@ -7,9 +7,7 @@ export function createLogger(sourcePath: string, options: GuiOptions) {
|
|
|
7
7
|
const shouldLogTiming = options.logTimings ?? true
|
|
8
8
|
const start = Date.now()
|
|
9
9
|
const mem =
|
|
10
|
-
process.env.GUI_SHOW_MEMORY_USAGE && shouldLogTiming
|
|
11
|
-
? process.memoryUsage()
|
|
12
|
-
: null
|
|
10
|
+
process.env.GUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null
|
|
13
11
|
|
|
14
12
|
return (res) => {
|
|
15
13
|
if (!shouldLogTiming) {
|
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import type { Plugin } from 'esbuild'
|
|
2
2
|
import fs from 'node:fs'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
-
import
|
|
5
|
-
findConfigFile,
|
|
6
|
-
nodeModuleNameResolver,
|
|
7
|
-
parseJsonConfigFileContent,
|
|
8
|
-
readConfigFile,
|
|
9
|
-
sys,
|
|
10
|
-
} from 'typescript'
|
|
4
|
+
import * as ts from 'typescript'
|
|
11
5
|
|
|
12
6
|
const name = 'tsconfig-paths'
|
|
13
7
|
|
|
8
|
+
/**
|
|
9
|
+
* This package does not own the `typescript` it reads — it borrows whatever the
|
|
10
|
+
* app installed, and what that means changed. `typescript@7` ships the native
|
|
11
|
+
* compiler, and its root export is `{ version, versionMajorMinor }`: `sys`,
|
|
12
|
+
* `findConfigFile` and `nodeModuleNameResolver` are gone. Reading `sys.fileExists`
|
|
13
|
+
* off it threw `Cannot read properties of undefined` while BUNDLING THE GUI
|
|
14
|
+
* CONFIG, so on any app that took TS 7 the whole compiler plugin died before it
|
|
15
|
+
* could write a single rule — measured on hanzoai/chat.
|
|
16
|
+
*
|
|
17
|
+
* The API is therefore probed, not assumed. Without it this plugin stops
|
|
18
|
+
* rewriting `compilerOptions.paths` and esbuild resolves on its own, which costs
|
|
19
|
+
* a gui config that imports through a TS path alias and costs everything else
|
|
20
|
+
* nothing. Losing an alias beats losing the stylesheet.
|
|
21
|
+
*/
|
|
22
|
+
const hasProgramApi = typeof (ts as any)?.sys?.fileExists === 'function'
|
|
23
|
+
|
|
24
|
+
let warned = false
|
|
25
|
+
function warnOnce() {
|
|
26
|
+
if (warned) return
|
|
27
|
+
warned = true
|
|
28
|
+
console.warn(
|
|
29
|
+
` ➡ [hanzogui] typescript ${(ts as any)?.version ?? '(not found)'} has no program API ` +
|
|
30
|
+
`(7.x removed it from the root export), so tsconfig "paths" are not applied when ` +
|
|
31
|
+
`bundling the gui config. Imports resolve through node.`
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
14
35
|
interface Tsconfig {
|
|
15
36
|
compilerOptions?: {
|
|
16
37
|
baseUrl?: string
|
|
@@ -19,6 +40,11 @@ interface Tsconfig {
|
|
|
19
40
|
}
|
|
20
41
|
|
|
21
42
|
export function TsconfigPathsPlugin(): Plugin {
|
|
43
|
+
if (!hasProgramApi) {
|
|
44
|
+
warnOnce()
|
|
45
|
+
return { name, setup() {} }
|
|
46
|
+
}
|
|
47
|
+
|
|
22
48
|
const compilerOptions = loadCompilerOptionsFromTsconfig()
|
|
23
49
|
|
|
24
50
|
return {
|
|
@@ -39,11 +65,11 @@ export function TsconfigPathsPlugin(): Plugin {
|
|
|
39
65
|
return null
|
|
40
66
|
}
|
|
41
67
|
|
|
42
|
-
const { resolvedModule } = nodeModuleNameResolver(
|
|
68
|
+
const { resolvedModule } = ts.nodeModuleNameResolver(
|
|
43
69
|
args.path,
|
|
44
70
|
args.importer,
|
|
45
71
|
compilerOptions,
|
|
46
|
-
sys
|
|
72
|
+
ts.sys
|
|
47
73
|
)
|
|
48
74
|
|
|
49
75
|
if (!resolvedModule) {
|
|
@@ -65,10 +91,15 @@ export function TsconfigPathsPlugin(): Plugin {
|
|
|
65
91
|
}
|
|
66
92
|
|
|
67
93
|
export function loadCompilerOptionsFromTsconfig(tsconfig?: Tsconfig | string) {
|
|
94
|
+
if (!hasProgramApi) {
|
|
95
|
+
warnOnce()
|
|
96
|
+
return {}
|
|
97
|
+
}
|
|
98
|
+
|
|
68
99
|
if (!tsconfig) {
|
|
69
100
|
const configPath =
|
|
70
|
-
findConfigFile(process.cwd(), sys.fileExists, 'tsconfig.json') ||
|
|
71
|
-
findConfigFile(process.cwd(), sys.fileExists, 'jsconfig.json')
|
|
101
|
+
ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json') ||
|
|
102
|
+
ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'jsconfig.json')
|
|
72
103
|
|
|
73
104
|
if (configPath) {
|
|
74
105
|
return parseTsconfig(configPath)
|
|
@@ -85,12 +116,12 @@ export function loadCompilerOptionsFromTsconfig(tsconfig?: Tsconfig | string) {
|
|
|
85
116
|
}
|
|
86
117
|
|
|
87
118
|
const baseDir = process.cwd()
|
|
88
|
-
const parsed = parseJsonConfigFileContent(tsconfig, sys, baseDir)
|
|
119
|
+
const parsed = ts.parseJsonConfigFileContent(tsconfig, ts.sys, baseDir)
|
|
89
120
|
return parsed.options
|
|
90
121
|
}
|
|
91
122
|
|
|
92
123
|
function parseTsconfig(configFilePath: string) {
|
|
93
|
-
const configFile = readConfigFile(configFilePath, sys.readFile)
|
|
124
|
+
const configFile = ts.readConfigFile(configFilePath, ts.sys.readFile)
|
|
94
125
|
if (configFile.error) {
|
|
95
126
|
throw new Error(
|
|
96
127
|
`Error reading tsconfig file '${configFilePath}': ${configFile.error.messageText}`
|
|
@@ -98,6 +129,6 @@ function parseTsconfig(configFilePath: string) {
|
|
|
98
129
|
}
|
|
99
130
|
|
|
100
131
|
const baseDir = path.dirname(configFilePath)
|
|
101
|
-
const parsed = parseJsonConfigFileContent(configFile.config, sys, baseDir)
|
|
132
|
+
const parsed = ts.parseJsonConfigFileContent(configFile.config, ts.sys, baseDir)
|
|
102
133
|
return parsed.options
|
|
103
134
|
}
|
|
@@ -130,10 +130,7 @@ export const isInsideComponentPackage = (
|
|
|
130
130
|
})
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
export const isComponentPackage = (
|
|
134
|
-
props: GuiOptionsWithFileInfo,
|
|
135
|
-
srcName: string
|
|
136
|
-
) => {
|
|
133
|
+
export const isComponentPackage = (props: GuiOptionsWithFileInfo, srcName: string) => {
|
|
137
134
|
return getValidComponentsPaths(props).some((path) => {
|
|
138
135
|
return srcName.startsWith(path)
|
|
139
136
|
})
|
|
@@ -7,6 +7,7 @@ import * as util from 'node:util'
|
|
|
7
7
|
import { requireGuiCore } from '../helpers/requireGuiCore'
|
|
8
8
|
import type { StyleObject, GuiOptions, Ternary } from '../types'
|
|
9
9
|
import { babelParse } from './babelParse'
|
|
10
|
+
import { isExtractable } from './extractablePath'
|
|
10
11
|
import type { Extractor } from './createExtractor'
|
|
11
12
|
import { createLogger } from './createLogger'
|
|
12
13
|
import { extractMediaStyle } from './extractMediaStyle'
|
|
@@ -57,7 +58,7 @@ export async function extractToClassNames({
|
|
|
57
58
|
const tm = timer()
|
|
58
59
|
const { getCSSStylesAtomic, createMediaStyle } = requireGuiCore('web')
|
|
59
60
|
|
|
60
|
-
if (sourcePath.
|
|
61
|
+
if (!isExtractable(sourcePath, options.extractPackages)) {
|
|
61
62
|
return null
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -219,7 +220,8 @@ export async function extractToClassNames({
|
|
|
219
220
|
// deoptProps changes — it only ever bails the animated case to runtime,
|
|
220
221
|
// never widens what extracts.
|
|
221
222
|
const hasCSSOnlyAnimationDriver =
|
|
222
|
-
hanzoguiConfig.animations.outputStyle === 'css' &&
|
|
223
|
+
hanzoguiConfig.animations.outputStyle === 'css' &&
|
|
224
|
+
!hanzoguiConfig.animationDrivers
|
|
223
225
|
let elementIsAnimated = false
|
|
224
226
|
for (const attr of jsxPath.node.openingElement.attributes) {
|
|
225
227
|
if (!t.isJSXAttribute(attr) || !t.isJSXIdentifier(attr.name)) continue
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One place decides which files the compiler may read styles out of.
|
|
3
|
+
*
|
|
4
|
+
* The compiler used to answer this with `sourcePath.includes('node_modules')`,
|
|
5
|
+
* in two places that had to agree by hand — the webpack loader and
|
|
6
|
+
* extractToClassNames. That answer was right about the cost and wrong about
|
|
7
|
+
* the design system: for a *consumer*, `@hanzo/ui` and every `@hanzogui/*`
|
|
8
|
+
* package IS node_modules, so no app could ask the compiler to look at them
|
|
9
|
+
* even if it wanted to.
|
|
10
|
+
*
|
|
11
|
+
* So this is a policy with a knob, not a hardcoded skip. The knob is
|
|
12
|
+
* `extractPackages`, and it is EMPTY by default, which is exactly the old
|
|
13
|
+
* behavior. What turning it on buys, measured on hanzo.one (Vite 5, @hanzo/ui
|
|
14
|
+
* 8.0.63 on @hanzo/gui 8.1, 5026 modules):
|
|
15
|
+
*
|
|
16
|
+
* extracted files 4 -> 54
|
|
17
|
+
* cached sheet 150,172 -> 151,151 B (+979)
|
|
18
|
+
* CSS injected at runtime 27,376 -> 27,376 B (unchanged, 356 rules both)
|
|
19
|
+
*
|
|
20
|
+
* Every one of those 979 bytes is a `styled()` DEFINITION rule, and the
|
|
21
|
+
* compiler deliberately leaves the definition in place ("the runtime needs
|
|
22
|
+
* real values for animations, context, and group styles"), so the runtime
|
|
23
|
+
* mints the same class again. 10 of the 20 new rules are delivered twice on
|
|
24
|
+
* the home route; the rest are for components that route never renders. The
|
|
25
|
+
* saving that would justify the cost — flattening a `<YStack p={10}>` usage
|
|
26
|
+
* site down to a className — cannot happen inside an installed package at all,
|
|
27
|
+
* because `module:jsx` currently emits the same JSX-lowered output as the ESM
|
|
28
|
+
* build (byte-identical, hardlinked), so there is no JSX left to flatten.
|
|
29
|
+
*
|
|
30
|
+
* Fix that, and turning this on becomes a real win. Until then, an app can opt
|
|
31
|
+
* in with `extractPackages: DEFAULT_EXTRACT_PACKAGES` and get a slightly
|
|
32
|
+
* bigger sheet for its trouble.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** The design-system allowlist an app can opt into. Not the default. */
|
|
36
|
+
export const DEFAULT_EXTRACT_PACKAGES = ['@hanzo/ui', '@hanzo/gui', '@hanzogui/*']
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Generated icon sets: 1760 modules of react-native-svg elements wrapped in
|
|
40
|
+
* `themed()`, holding no `styled()` between them. Parsing them costs a full
|
|
41
|
+
* babel pass each and yields no CSS, installed or in a workspace — which is
|
|
42
|
+
* why the path is skipped rather than the package name. Measured on the same
|
|
43
|
+
* build: 1761 files that the allowlist would otherwise have to reject one at
|
|
44
|
+
* a time.
|
|
45
|
+
*/
|
|
46
|
+
const NEVER_EXTRACT = ['lucide-icons']
|
|
47
|
+
|
|
48
|
+
const NODE_MODULES = 'node_modules/'
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The installed package a file belongs to, or '' when the file is app or
|
|
52
|
+
* workspace source. Reads the LAST `node_modules/` segment, so a nested
|
|
53
|
+
* install and pnpm's `.pnpm/<pkg>@<ver>/node_modules/<pkg>` both name the
|
|
54
|
+
* package that actually owns the file.
|
|
55
|
+
*/
|
|
56
|
+
export function installedPackageOf(sourcePath: string): string {
|
|
57
|
+
const normalized = sourcePath.replace(/\\/g, '/')
|
|
58
|
+
const at = normalized.lastIndexOf(NODE_MODULES)
|
|
59
|
+
if (at === -1) return ''
|
|
60
|
+
const rest = normalized.slice(at + NODE_MODULES.length)
|
|
61
|
+
const parts = rest.split('/')
|
|
62
|
+
if (!parts[0]) return ''
|
|
63
|
+
return parts[0].startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* An entry names one package (`@hanzo/ui`) or a whole scope (`@hanzogui/*`,
|
|
68
|
+
* or the equivalent `@hanzogui/`).
|
|
69
|
+
*/
|
|
70
|
+
function matches(entry: string, pkg: string): boolean {
|
|
71
|
+
const prefix = entry.endsWith('/*') ? entry.slice(0, -1) : entry.endsWith('/') ? entry : ''
|
|
72
|
+
return prefix ? pkg.startsWith(prefix) : pkg === entry
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** May the compiler read styles out of this file? */
|
|
76
|
+
export function isExtractable(sourcePath: string, extractPackages: string[] = []): boolean {
|
|
77
|
+
if (NEVER_EXTRACT.some((name) => sourcePath.includes(name))) return false
|
|
78
|
+
const pkg = installedPackageOf(sourcePath)
|
|
79
|
+
if (!pkg) return true
|
|
80
|
+
return extractPackages.some((entry) => matches(entry, pkg))
|
|
81
|
+
}
|
package/src/extractor/loadGui.ts
CHANGED
|
@@ -206,9 +206,7 @@ export async function loadGuiBuildConfigAsync(
|
|
|
206
206
|
/**
|
|
207
207
|
* @deprecated Use loadGuiBuildConfigAsync instead to avoid EPIPE errors
|
|
208
208
|
*/
|
|
209
|
-
export function loadGuiBuildConfigSync(
|
|
210
|
-
hanzoguiOptions: Partial<GuiOptions> | undefined
|
|
211
|
-
) {
|
|
209
|
+
export function loadGuiBuildConfigSync(hanzoguiOptions: Partial<GuiOptions> | undefined) {
|
|
212
210
|
const buildFilePath = hanzoguiOptions?.buildFile ?? './hanzogui.build.ts'
|
|
213
211
|
if (fsExtra.existsSync(buildFilePath)) {
|
|
214
212
|
const registered = registerRequire('web')
|
|
@@ -61,10 +61,7 @@ export function regenerateConfigSync(
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export async function generateGuiThemes(
|
|
65
|
-
hanzoguiOptions: GuiOptions,
|
|
66
|
-
force = false
|
|
67
|
-
) {
|
|
64
|
+
export async function generateGuiThemes(hanzoguiOptions: GuiOptions, force = false) {
|
|
68
65
|
if (!hanzoguiOptions.themeBuilder) {
|
|
69
66
|
return
|
|
70
67
|
}
|
package/src/types.ts
CHANGED
|
@@ -78,10 +78,7 @@ export type GuiOptionsWithFileInfo = GuiOptions & {
|
|
|
78
78
|
allLoadedComponents: LoadedComponents[]
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export type ExtractorParseProps = Omit<
|
|
82
|
-
GuiOptionsWithFileInfo,
|
|
83
|
-
'allLoadedComponents'
|
|
84
|
-
> & {
|
|
81
|
+
export type ExtractorParseProps = Omit<GuiOptionsWithFileInfo, 'allLoadedComponents'> & {
|
|
85
82
|
platform: GuiPlatform
|
|
86
83
|
shouldPrintDebug?: boolean | 'verbose'
|
|
87
84
|
onExtractTag: (props: ExtractTagProps) => void
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-dep-versions.d.ts","sourceRoot":"","sources":["../src/check-dep-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"check-dep-versions.d.ts","sourceRoot":"","sources":["../src/check-dep-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkpBH,+CAA+C;AAC/C,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,SAAS;QACjB,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,SAAS;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAC9C,EAAE,CAAA;CACJ,CAAA;AAED,qBAAa,IAAI;IACf,4GAA4G;IAC5G,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;IAE3C;;;;;;;;;;OAUG;gBACS,IAAI,EAAE,MAAM;IAKjB,iBAAiB,IAAI,MAAM;IAI3B,eAAe,IAAI,SAAS,UAAU,EAAE;IAMxC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAc9C,IAAW,0BAA0B,IAAI,OAAO,CAE/C;CACF"}
|
package/types/exports.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './types';
|
|
|
3
3
|
export { createExtractor } from './extractor/createExtractor';
|
|
4
4
|
export { literalToAst } from './extractor/literalToAst';
|
|
5
5
|
export * from './constants';
|
|
6
|
+
export * from './extractor/extractablePath';
|
|
6
7
|
export * from './extractor/extractToClassNames';
|
|
7
8
|
export * from './extractor/concatClassName';
|
|
8
9
|
export * from './extractor/extractToNative';
|
package/types/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,cAAc,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/extractor/bundle.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAO3C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;CAwBtB,CAAA;AAQV,eAAO,MAAM,uBAAuB,QAAqD,CAAA;AAEzF;;GAEG;AAEH,KAAK,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,GAAG;IAChE,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/extractor/bundle.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAO3C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;CAwBtB,CAAA;AAQV,eAAO,MAAM,uBAAuB,QAAqD,CAAA;AAEzF;;GAEG;AAEH,KAAK,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,GAAG;IAChE,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AA4OD,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBjC"}
|
|
@@ -7,7 +7,7 @@ export type Extractor = ReturnType<typeof createExtractor>;
|
|
|
7
7
|
type FileOrPath = NodePath<t.Program> | t.File;
|
|
8
8
|
export declare function createExtractor({ logger, platform }?: ExtractorOptions): {
|
|
9
9
|
options: {
|
|
10
|
-
logger: import("
|
|
10
|
+
logger: import("..").Logger;
|
|
11
11
|
};
|
|
12
12
|
cleanupBeforeExit: typeof cleanupBeforeExit;
|
|
13
13
|
loadGui: (props: GuiOptions) => Promise<GuiProjectInfo | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAmBjC,OAAO,KAAK,EAGV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EAGX,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAmBjC,OAAO,KAAK,EAGV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EAGX,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAetE,OAAO,EAAE,iBAAiB,EAA6B,MAAM,6BAA6B,CAAA;AAwB1F,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AA6C9C,wBAAgB,eAAe,CAC7B,EAAE,MAAgB,EAAE,QAAgB,EAAE,GAAE,gBAAsC;;;;;qBAsJnD,UAAU;yBAPZ,UAAU;;mBAwBlB,UAAU,SAAS,mBAAmB;;;;;;;eAKpC,UAAU,SAAS,mBAAmB;;;;;;;EAojF1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLogger.d.ts","sourceRoot":"","sources":["../../src/extractor/createLogger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"createLogger.d.ts","sourceRoot":"","sources":["../../src/extractor/createLogger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,IAM1D,QAAG,UA2BZ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'esbuild';
|
|
2
|
+
import * as ts from 'typescript';
|
|
2
3
|
interface Tsconfig {
|
|
3
4
|
compilerOptions?: {
|
|
4
5
|
baseUrl?: string;
|
|
@@ -6,6 +7,6 @@ interface Tsconfig {
|
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
9
|
export declare function TsconfigPathsPlugin(): Plugin;
|
|
9
|
-
export declare function loadCompilerOptionsFromTsconfig(tsconfig?: Tsconfig | string):
|
|
10
|
+
export declare function loadCompilerOptionsFromTsconfig(tsconfig?: Tsconfig | string): ts.CompilerOptions;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=esbuildTsconfigPaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuildTsconfigPaths.d.ts","sourceRoot":"","sources":["../../src/extractor/esbuildTsconfigPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"esbuildTsconfigPaths.d.ts","sourceRoot":"","sources":["../../src/extractor/esbuildTsconfigPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAA;AA+BhC,UAAU,QAAQ;IAChB,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;KACjC,CAAA;CACF;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAiD5C;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,sBA4B3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractHelpers.d.ts","sourceRoot":"","sources":["../../src/extractor/extractHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAI9E,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GACjC,KAAK,IAAI,CAAC,CAEZ;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,kBAAkB,WAExD;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,aAAa,6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C7B,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/B,CAAC,EAAE,CAAC,CAAC,gBAAgB,EACrB,UAAU,CAAC,EAAE,MAAM,WAkBpB;AAED,eAAO,MAAM,wBAAwB,GACnC,OAAO,sBAAsB,EAC7B,YAAY,MAAM,QAKnB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,sBAAsB,EAAE,SAAS,MAAM,QAIhF,CAAA;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM;;SAiBtB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,sBAAsB,EAAE,YAAY,MAAM;;;CAW9E,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,OAAO,sBAAsB,EAC7B,YAAY,MAAM,EAClB,gBAAgB,MAAM;;QAOvB,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,OAAO,sBAAsB,EAC7B,YAAY,MAAM,EAClB,gBAAgB,MAAM,QAMvB,CAAA;AAOD,eAAO,MAAM,uBAAuB;;;CAMlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAKjC,OAAO,KAAK,EAAe,UAAU,EAAW,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAKjC,OAAO,KAAK,EAAe,UAAU,EAAW,MAAM,UAAU,CAAA;AAGhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAYlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;IACX,GAAG,EAAE,GAAG,CAAA;IACR,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,UAAU,CAAA;IACnB,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,CAAA;AAQD,wBAAsB,mBAAmB,CAAC,EACxC,SAAS,EACT,MAAM,EACN,UAAe,EACf,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAknB9D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One place decides which files the compiler may read styles out of.
|
|
3
|
+
*
|
|
4
|
+
* The compiler used to answer this with `sourcePath.includes('node_modules')`,
|
|
5
|
+
* in two places that had to agree by hand — the webpack loader and
|
|
6
|
+
* extractToClassNames. That answer was right about the cost and wrong about
|
|
7
|
+
* the design system: for a *consumer*, `@hanzo/ui` and every `@hanzogui/*`
|
|
8
|
+
* package IS node_modules, so no app could ask the compiler to look at them
|
|
9
|
+
* even if it wanted to.
|
|
10
|
+
*
|
|
11
|
+
* So this is a policy with a knob, not a hardcoded skip. The knob is
|
|
12
|
+
* `extractPackages`, and it is EMPTY by default, which is exactly the old
|
|
13
|
+
* behavior. What turning it on buys, measured on hanzo.one (Vite 5, @hanzo/ui
|
|
14
|
+
* 8.0.63 on @hanzo/gui 8.1, 5026 modules):
|
|
15
|
+
*
|
|
16
|
+
* extracted files 4 -> 54
|
|
17
|
+
* cached sheet 150,172 -> 151,151 B (+979)
|
|
18
|
+
* CSS injected at runtime 27,376 -> 27,376 B (unchanged, 356 rules both)
|
|
19
|
+
*
|
|
20
|
+
* Every one of those 979 bytes is a `styled()` DEFINITION rule, and the
|
|
21
|
+
* compiler deliberately leaves the definition in place ("the runtime needs
|
|
22
|
+
* real values for animations, context, and group styles"), so the runtime
|
|
23
|
+
* mints the same class again. 10 of the 20 new rules are delivered twice on
|
|
24
|
+
* the home route; the rest are for components that route never renders. The
|
|
25
|
+
* saving that would justify the cost — flattening a `<YStack p={10}>` usage
|
|
26
|
+
* site down to a className — cannot happen inside an installed package at all,
|
|
27
|
+
* because `module:jsx` currently emits the same JSX-lowered output as the ESM
|
|
28
|
+
* build (byte-identical, hardlinked), so there is no JSX left to flatten.
|
|
29
|
+
*
|
|
30
|
+
* Fix that, and turning this on becomes a real win. Until then, an app can opt
|
|
31
|
+
* in with `extractPackages: DEFAULT_EXTRACT_PACKAGES` and get a slightly
|
|
32
|
+
* bigger sheet for its trouble.
|
|
33
|
+
*/
|
|
34
|
+
/** The design-system allowlist an app can opt into. Not the default. */
|
|
35
|
+
export declare const DEFAULT_EXTRACT_PACKAGES: string[];
|
|
36
|
+
/**
|
|
37
|
+
* The installed package a file belongs to, or '' when the file is app or
|
|
38
|
+
* workspace source. Reads the LAST `node_modules/` segment, so a nested
|
|
39
|
+
* install and pnpm's `.pnpm/<pkg>@<ver>/node_modules/<pkg>` both name the
|
|
40
|
+
* package that actually owns the file.
|
|
41
|
+
*/
|
|
42
|
+
export declare function installedPackageOf(sourcePath: string): string;
|
|
43
|
+
/** May the compiler read styles out of this file? */
|
|
44
|
+
export declare function isExtractable(sourcePath: string, extractPackages?: string[]): boolean;
|
|
45
|
+
//# sourceMappingURL=extractablePath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractablePath.d.ts","sourceRoot":"","sources":["../../src/extractor/extractablePath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,UAA6C,CAAA;AAclF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAWD,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,GAAE,MAAM,EAAO,GAAG,OAAO,CAKzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadGui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadGui.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AASrF,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,gBAAgB,CAAA;AAkBvB,wBAAsB,OAAO,CAC3B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAC3B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA+ChC;AAKD,eAAO,MAAM,oBAAoB,GAAU,SAAS,UAAU,EAAE,eAAa,kBA6B5E,CAAA;AAQD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS,GAC/C,OAAO,CAAC,UAAU,CAAC,CAqErB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"loadGui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadGui.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AASrF,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,gBAAgB,CAAA;AAkBvB,wBAAsB,OAAO,CAC3B,OAAO,EAAE,OAAO,CAAC,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,eAAe,EAAE,UAAU,EAC3B,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,EAC/B,OAAO,UAAQ,iBAmBhB;AAED,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,UAAU,EAC5B,MAAM,EAAE,aAAa,QAiBtB;AAED,wBAAsB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"regenerateConfig.d.ts","sourceRoot":"","sources":["../../src/extractor/regenerateConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAKjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAMnD;;GAEG;AAEH,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,UAAU,EAC3B,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,EAC/B,OAAO,UAAQ,iBAmBhB;AAED,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,UAAU,EAC5B,MAAM,EAAE,aAAa,QAiBtB;AAED,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,UAAU,EAAE,KAAK,UAAQ,gCA8BjF"}
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA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