@luxfi/ui 7.4.9 → 7.4.10
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 -10
- package/dist/next.js +5 -9
- package/package.json +1 -1
- package/src/engine.ts +0 -25
- package/src/next.ts +32 -1
package/dist/next.cjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
-
});
|
|
3
|
+
var module$1 = require('module');
|
|
4
|
+
|
|
5
|
+
// src/next.ts
|
|
9
6
|
|
|
10
7
|
// src/engine.ts
|
|
11
8
|
var GUI_PACKAGES = [
|
|
@@ -90,9 +87,10 @@ var ALIASABLE = [
|
|
|
90
87
|
"@tanstack/react-query",
|
|
91
88
|
...GUI_PACKAGES
|
|
92
89
|
];
|
|
90
|
+
|
|
91
|
+
// src/next.ts
|
|
93
92
|
function guiAliases(from) {
|
|
94
|
-
const
|
|
95
|
-
const require_ = createRequire(`${from.replace(/\/?$/, "/")}noop.js`);
|
|
93
|
+
const require_ = module$1.createRequire(`${from.replace(/\/?$/, "/")}noop.js`);
|
|
96
94
|
const alias = {};
|
|
97
95
|
for (const pkg of ALIASABLE) {
|
|
98
96
|
try {
|
|
@@ -102,8 +100,6 @@ function guiAliases(from) {
|
|
|
102
100
|
}
|
|
103
101
|
return alias;
|
|
104
102
|
}
|
|
105
|
-
|
|
106
|
-
// src/next.ts
|
|
107
103
|
function withLuxUi(config = {}) {
|
|
108
104
|
const userWebpack = config.webpack;
|
|
109
105
|
const engine = guiAliases(config.dir ?? process.cwd());
|
package/dist/next.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
|
|
3
|
+
// src/next.ts
|
|
7
4
|
|
|
8
5
|
// src/engine.ts
|
|
9
6
|
var GUI_PACKAGES = [
|
|
@@ -88,8 +85,9 @@ var ALIASABLE = [
|
|
|
88
85
|
"@tanstack/react-query",
|
|
89
86
|
...GUI_PACKAGES
|
|
90
87
|
];
|
|
88
|
+
|
|
89
|
+
// src/next.ts
|
|
91
90
|
function guiAliases(from) {
|
|
92
|
-
const { createRequire } = __require("module");
|
|
93
91
|
const require_ = createRequire(`${from.replace(/\/?$/, "/")}noop.js`);
|
|
94
92
|
const alias = {};
|
|
95
93
|
for (const pkg of ALIASABLE) {
|
|
@@ -100,8 +98,6 @@ function guiAliases(from) {
|
|
|
100
98
|
}
|
|
101
99
|
return alias;
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
// src/next.ts
|
|
105
101
|
function withLuxUi(config = {}) {
|
|
106
102
|
const userWebpack = config.webpack;
|
|
107
103
|
const engine = guiAliases(config.dir ?? process.cwd());
|
package/package.json
CHANGED
package/src/engine.ts
CHANGED
|
@@ -140,28 +140,3 @@ export const ALIASABLE: ReadonlyArray<string> = [
|
|
|
140
140
|
'@tanstack/react-query',
|
|
141
141
|
...GUI_PACKAGES,
|
|
142
142
|
];
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Exact-match aliases pinning every aliasable package to ONE entry file, for
|
|
146
|
-
* bundlers that have no `dedupe` of their own (webpack, turbopack).
|
|
147
|
-
*
|
|
148
|
-
* Keys carry webpack's `$` exact-match suffix so only the bare specifier is
|
|
149
|
-
* redirected — a deep import keeps resolving normally. Packages that are not
|
|
150
|
-
* physically installed are skipped rather than throwing: the list is the
|
|
151
|
-
* engine's full surface and no single app pulls all of it.
|
|
152
|
-
*/
|
|
153
|
-
export function guiAliases(from: string): Record<string, string> {
|
|
154
|
-
// Deferred so this module stays importable from a browser bundle (the
|
|
155
|
-
// wrappers are build-time only, but `engine.ts` is plain values).
|
|
156
|
-
const { createRequire } = require('node:module') as typeof import('node:module');
|
|
157
|
-
const require_ = createRequire(`${ from.replace(/\/?$/, '/') }noop.js`);
|
|
158
|
-
const alias: Record<string, string> = {};
|
|
159
|
-
for (const pkg of ALIASABLE) {
|
|
160
|
-
try {
|
|
161
|
-
alias[`${ pkg }$`] = require_.resolve(pkg);
|
|
162
|
-
} catch {
|
|
163
|
-
// Not installed in this app — nothing to dedupe.
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return alias;
|
|
167
|
-
}
|
package/src/next.ts
CHANGED
|
@@ -18,7 +18,38 @@
|
|
|
18
18
|
// Node-only (a build-time module) and dependency-free: it takes and returns a
|
|
19
19
|
// plain object, so it does not force `next` into anyone's type graph.
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { createRequire } from 'node:module';
|
|
22
|
+
|
|
23
|
+
import { ALIASABLE, GUI_DEFINES, GUI_PACKAGES } from './engine';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Exact-match aliases pinning every aliasable package to ONE entry file, for
|
|
27
|
+
* bundlers that have no `dedupe` of their own.
|
|
28
|
+
*
|
|
29
|
+
* Lives HERE, not in ./engine, because it needs `node:module`. `engine.ts` is
|
|
30
|
+
* plain values so a browser bundle can import it; a `require('node:module')`
|
|
31
|
+
* deferred inside it survived the CJS build and then died the moment a surface
|
|
32
|
+
* used an ESM `next.config.mjs` — esbuild emits `Dynamic require of "module" is
|
|
33
|
+
* not supported` and Next never boots. A build-time concern belongs in the
|
|
34
|
+
* build-time module.
|
|
35
|
+
*
|
|
36
|
+
* Keys carry webpack's `$` exact-match suffix so only the bare specifier is
|
|
37
|
+
* redirected — a deep import keeps resolving normally. Packages that are not
|
|
38
|
+
* physically installed are skipped rather than throwing: the list is the
|
|
39
|
+
* engine's full surface and no single app pulls all of it.
|
|
40
|
+
*/
|
|
41
|
+
function guiAliases(from: string): Record<string, string> {
|
|
42
|
+
const require_ = createRequire(`${ from.replace(/\/?$/, '/') }noop.js`);
|
|
43
|
+
const alias: Record<string, string> = {};
|
|
44
|
+
for (const pkg of ALIASABLE) {
|
|
45
|
+
try {
|
|
46
|
+
alias[`${ pkg }$`] = require_.resolve(pkg);
|
|
47
|
+
} catch {
|
|
48
|
+
// Not installed in this app — nothing to dedupe.
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return alias;
|
|
52
|
+
}
|
|
22
53
|
|
|
23
54
|
interface WebpackConfig {
|
|
24
55
|
resolve?: { alias?: Record<string, unknown> };
|