@luxfi/ui 7.4.7 → 7.4.9
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/next.cjs +6 -6
- package/dist/next.js +6 -6
- package/package.json +1 -1
- package/src/engine.ts +18 -2
- package/src/next.ts +17 -10
package/dist/next.cjs
CHANGED
|
@@ -80,17 +80,21 @@ var GUI_DEFINES = {
|
|
|
80
80
|
"process.env.EXPO_OS": JSON.stringify("web"),
|
|
81
81
|
"process.env.IS_WEB": JSON.stringify("true")
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
[
|
|
84
84
|
"react",
|
|
85
85
|
"react-dom",
|
|
86
86
|
"@tanstack/react-query",
|
|
87
87
|
...GUI_PACKAGES
|
|
88
88
|
];
|
|
89
|
+
var ALIASABLE = [
|
|
90
|
+
"@tanstack/react-query",
|
|
91
|
+
...GUI_PACKAGES
|
|
92
|
+
];
|
|
89
93
|
function guiAliases(from) {
|
|
90
94
|
const { createRequire } = __require("module");
|
|
91
95
|
const require_ = createRequire(`${from.replace(/\/?$/, "/")}noop.js`);
|
|
92
96
|
const alias = {};
|
|
93
|
-
for (const pkg of
|
|
97
|
+
for (const pkg of ALIASABLE) {
|
|
94
98
|
try {
|
|
95
99
|
alias[`${pkg}$`] = require_.resolve(pkg);
|
|
96
100
|
} catch {
|
|
@@ -103,9 +107,6 @@ function guiAliases(from) {
|
|
|
103
107
|
function withLuxUi(config = {}) {
|
|
104
108
|
const userWebpack = config.webpack;
|
|
105
109
|
const engine = guiAliases(config.dir ?? process.cwd());
|
|
106
|
-
const engineTurbopack = Object.fromEntries(
|
|
107
|
-
Object.entries(engine).map(([k, v]) => [k.replace(/\$$/, ""), v])
|
|
108
|
-
);
|
|
109
110
|
const { dir: _dir, ...rest } = config;
|
|
110
111
|
return {
|
|
111
112
|
...rest,
|
|
@@ -114,7 +115,6 @@ function withLuxUi(config = {}) {
|
|
|
114
115
|
...config.turbopack,
|
|
115
116
|
resolveAlias: {
|
|
116
117
|
"react-native": "react-native-web",
|
|
117
|
-
...engineTurbopack,
|
|
118
118
|
...config.turbopack?.resolveAlias
|
|
119
119
|
}
|
|
120
120
|
},
|
package/dist/next.js
CHANGED
|
@@ -78,17 +78,21 @@ var GUI_DEFINES = {
|
|
|
78
78
|
"process.env.EXPO_OS": JSON.stringify("web"),
|
|
79
79
|
"process.env.IS_WEB": JSON.stringify("true")
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
[
|
|
82
82
|
"react",
|
|
83
83
|
"react-dom",
|
|
84
84
|
"@tanstack/react-query",
|
|
85
85
|
...GUI_PACKAGES
|
|
86
86
|
];
|
|
87
|
+
var ALIASABLE = [
|
|
88
|
+
"@tanstack/react-query",
|
|
89
|
+
...GUI_PACKAGES
|
|
90
|
+
];
|
|
87
91
|
function guiAliases(from) {
|
|
88
92
|
const { createRequire } = __require("module");
|
|
89
93
|
const require_ = createRequire(`${from.replace(/\/?$/, "/")}noop.js`);
|
|
90
94
|
const alias = {};
|
|
91
|
-
for (const pkg of
|
|
95
|
+
for (const pkg of ALIASABLE) {
|
|
92
96
|
try {
|
|
93
97
|
alias[`${pkg}$`] = require_.resolve(pkg);
|
|
94
98
|
} catch {
|
|
@@ -101,9 +105,6 @@ function guiAliases(from) {
|
|
|
101
105
|
function withLuxUi(config = {}) {
|
|
102
106
|
const userWebpack = config.webpack;
|
|
103
107
|
const engine = guiAliases(config.dir ?? process.cwd());
|
|
104
|
-
const engineTurbopack = Object.fromEntries(
|
|
105
|
-
Object.entries(engine).map(([k, v]) => [k.replace(/\$$/, ""), v])
|
|
106
|
-
);
|
|
107
108
|
const { dir: _dir, ...rest } = config;
|
|
108
109
|
return {
|
|
109
110
|
...rest,
|
|
@@ -112,7 +113,6 @@ function withLuxUi(config = {}) {
|
|
|
112
113
|
...config.turbopack,
|
|
113
114
|
resolveAlias: {
|
|
114
115
|
"react-native": "react-native-web",
|
|
115
|
-
...engineTurbopack,
|
|
116
116
|
...config.turbopack?.resolveAlias
|
|
117
117
|
}
|
|
118
118
|
},
|
package/package.json
CHANGED
package/src/engine.ts
CHANGED
|
@@ -126,7 +126,23 @@ export const ENGINE_DEDUPE: ReadonlyArray<string> = [
|
|
|
126
126
|
];
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* The subset of ENGINE_DEDUPE that may be pinned by a hard bundler ALIAS.
|
|
130
|
+
*
|
|
131
|
+
* `dedupe` is advisory hoisting; an alias is a hard redirect, and redirecting
|
|
132
|
+
* `react` / `react-dom` inside a Next app breaks the framework's own graph —
|
|
133
|
+
* the RSC client manifest is keyed on Next's copy, so the MPC dashboard died
|
|
134
|
+
* with `Could not find the module … segment-explorer-node.js#SegmentViewNode in
|
|
135
|
+
* the React Client Manifest` followed by `__webpack_modules__[moduleId] is not
|
|
136
|
+
* a function`. Next already guarantees one React; it does not guarantee one
|
|
137
|
+
* react-query, and it does not guarantee one popper.
|
|
138
|
+
*/
|
|
139
|
+
export const ALIASABLE: ReadonlyArray<string> = [
|
|
140
|
+
'@tanstack/react-query',
|
|
141
|
+
...GUI_PACKAGES,
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Exact-match aliases pinning every aliasable package to ONE entry file, for
|
|
130
146
|
* bundlers that have no `dedupe` of their own (webpack, turbopack).
|
|
131
147
|
*
|
|
132
148
|
* Keys carry webpack's `$` exact-match suffix so only the bare specifier is
|
|
@@ -140,7 +156,7 @@ export function guiAliases(from: string): Record<string, string> {
|
|
|
140
156
|
const { createRequire } = require('node:module') as typeof import('node:module');
|
|
141
157
|
const require_ = createRequire(`${ from.replace(/\/?$/, '/') }noop.js`);
|
|
142
158
|
const alias: Record<string, string> = {};
|
|
143
|
-
for (const pkg of
|
|
159
|
+
for (const pkg of ALIASABLE) {
|
|
144
160
|
try {
|
|
145
161
|
alias[`${ pkg }$`] = require_.resolve(pkg);
|
|
146
162
|
} catch {
|
package/src/next.ts
CHANGED
|
@@ -49,15 +49,23 @@ export function withLuxUi(config: LuxUiNextConfig = {}): LuxUiNextConfig {
|
|
|
49
49
|
// so the equivalent is an exact-match alias per package, resolved from the app
|
|
50
50
|
// root — see ./engine for why two copies is a crash and not a size problem.
|
|
51
51
|
const engine = guiAliases(config.dir ?? process.cwd());
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
// Turbopack gets `react-native` and NOTHING ELSE, on purpose.
|
|
53
|
+
//
|
|
54
|
+
// It is the only dev bundler from Next 16, so a path-based dedupe here looked
|
|
55
|
+
// like the way to kill the dev-mode `setReference` storm. It is not. Turbopack
|
|
56
|
+
// resolves an alias VALUE against its own project root, which it infers from
|
|
57
|
+
// the workspace and which is not the app directory: an absolute value comes
|
|
58
|
+
// back as `Can't resolve './Users/…/react/index.js' — server relative imports
|
|
59
|
+
// are not implemented yet`, and a value made relative to `dir` re-anchors to
|
|
60
|
+
// that other root and mis-resolves Next's own runtime — the bootnode console
|
|
61
|
+
// 500'd on every route with `Could not find the module
|
|
62
|
+
// "[project]/work/hanzo/bootnode/web/…/global-error.js#default" in the React
|
|
63
|
+
// Client Manifest`.
|
|
64
|
+
//
|
|
65
|
+
// Prod builds still dedupe through `webpack()` below. A dev-only duplicate is
|
|
66
|
+
// a package-manager problem and belongs in the app's `pnpm.overrides`, not in
|
|
67
|
+
// an alias map that can take the dev server down.
|
|
68
|
+
//
|
|
61
69
|
// `dir` is OURS, not Next's — leaving it on the returned object makes Next
|
|
62
70
|
// print `Unrecognized key(s) in object: 'dir'` on every boot of every surface
|
|
63
71
|
// that passes it. Consume it here.
|
|
@@ -69,7 +77,6 @@ export function withLuxUi(config: LuxUiNextConfig = {}): LuxUiNextConfig {
|
|
|
69
77
|
...config.turbopack,
|
|
70
78
|
resolveAlias: {
|
|
71
79
|
'react-native': 'react-native-web',
|
|
72
|
-
...engineTurbopack,
|
|
73
80
|
...config.turbopack?.resolveAlias,
|
|
74
81
|
},
|
|
75
82
|
},
|