@tamagui/next-plugin 1.0.1-beta.21 → 1.0.1-beta.211
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/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/withTamagui.js +223 -124
- package/dist/cjs/withTamagui.js.map +3 -3
- package/dist/esm/index.js +0 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/withTamagui.js +214 -107
- package/dist/esm/withTamagui.js.map +3 -3
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/withTamagui.js +214 -109
- package/dist/jsx/withTamagui.js.map +7 -0
- package/package.json +24 -15
- package/src/index.ts +1 -0
- package/src/withTamagui.ts +443 -0
- package/types/withTamagui.d.ts +6 -1
- package/types/index.d.ts.map +0 -1
- package/types/withTamagui.d.ts.map +0 -1
package/dist/jsx/withTamagui.js
CHANGED
|
@@ -1,62 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import path from "path";
|
|
1
|
+
import { existsSync } from "fs";
|
|
2
|
+
import path, { dirname, join } from "path";
|
|
4
3
|
import browserslist from "browserslist";
|
|
5
4
|
import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
|
|
5
|
+
import buildResolver from "esm-resolve";
|
|
6
|
+
import InlineCSSPlugin from "html-inline-css-webpack-plugin";
|
|
6
7
|
import MiniCSSExtractPlugin from "mini-css-extract-plugin";
|
|
7
8
|
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
8
9
|
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
9
|
-
import { shouldExclude } from "tamagui-loader";
|
|
10
|
+
import { shouldExclude as shouldExcludeDefault } from "tamagui-loader";
|
|
10
11
|
import webpack from "webpack";
|
|
11
|
-
const withTamagui =
|
|
12
|
+
const withTamagui = (tamaguiOptions) => {
|
|
12
13
|
return (nextConfig = {}) => {
|
|
13
14
|
return {
|
|
14
15
|
...nextConfig,
|
|
15
16
|
webpack: (webpackConfig, options) => {
|
|
16
|
-
var _a;
|
|
17
17
|
const { dir, config, dev, isServer } = options;
|
|
18
|
+
const resolver = buildResolver(join(dir, "index.js"), {
|
|
19
|
+
constraints: "node"
|
|
20
|
+
});
|
|
18
21
|
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
19
22
|
globalThis["__DEV__"] = dev;
|
|
20
23
|
}
|
|
21
|
-
const isNext12 = typeof
|
|
24
|
+
const isNext12 = typeof options.config?.swcMinify === "boolean";
|
|
25
|
+
if (!isNext12) {
|
|
26
|
+
throw new Error(`Next.js 12 only supported`);
|
|
27
|
+
}
|
|
22
28
|
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
23
|
-
const safeResolves =
|
|
24
|
-
|
|
25
|
-
for (const [out, mod
|
|
29
|
+
const safeResolves = (...resolves) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
for (const [out, mod] of resolves) {
|
|
32
|
+
if (out.endsWith("$")) {
|
|
33
|
+
res.push([out, mod]);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
26
36
|
try {
|
|
27
|
-
|
|
28
|
-
if (replace) {
|
|
29
|
-
next[1] = next[1].replace(...replace);
|
|
30
|
-
}
|
|
31
|
-
res.push(next);
|
|
37
|
+
res.push([out, resolveEsm(mod)]);
|
|
32
38
|
} catch (err) {
|
|
39
|
+
if (out.includes(`@gorhom/bottom-sheet`)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (process.env.DEBUG?.startsWith("tamagui")) {
|
|
43
|
+
console.log(prefix, `withTamagui skipping resolving ${out}`, err);
|
|
44
|
+
}
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
return Object.fromEntries(res);
|
|
36
|
-
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
};
|
|
49
|
+
const resolveEsm = (relativePath) => {
|
|
50
|
+
if (isServer)
|
|
51
|
+
return require.resolve(relativePath);
|
|
52
|
+
const esm = resolver(relativePath);
|
|
53
|
+
return esm ? path.join(dir, esm) : require.resolve(relativePath);
|
|
54
|
+
};
|
|
55
|
+
const SEP = path.sep;
|
|
56
|
+
const componentsFullPaths = safeResolves(
|
|
57
|
+
...tamaguiOptions.components.map(
|
|
58
|
+
(moduleName) => [moduleName, moduleName]
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
const componentsBaseDirs = Object.entries(componentsFullPaths).map(
|
|
62
|
+
([_moduleName, fullPath]) => {
|
|
63
|
+
let rootPath = dirname(fullPath);
|
|
64
|
+
while (rootPath.length > 1) {
|
|
65
|
+
const pkg = join(rootPath, "package.json");
|
|
66
|
+
const hasPkg = existsSync(pkg);
|
|
67
|
+
if (hasPkg) {
|
|
68
|
+
return rootPath;
|
|
69
|
+
} else {
|
|
70
|
+
rootPath = join(rootPath, "..");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`Couldn't find package.json in any path above: ${fullPath}`);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
function isInComponentModule(fullPath) {
|
|
77
|
+
return componentsBaseDirs.some((componentDir) => fullPath.startsWith(componentDir));
|
|
78
|
+
}
|
|
79
|
+
const shouldExclude = (path2, projectRoot) => {
|
|
80
|
+
const res = tamaguiOptions.shouldExtract?.(path2, projectRoot);
|
|
81
|
+
if (typeof res === "boolean") {
|
|
82
|
+
return !res;
|
|
83
|
+
}
|
|
84
|
+
if (isInComponentModule(path2)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return shouldExcludeDefault(path2, projectRoot);
|
|
88
|
+
};
|
|
89
|
+
const rnw = tamaguiOptions.useReactNativeWebLite ? "react-native-web-lite" : "react-native-web";
|
|
90
|
+
const tamaguiAliases = safeResolves(
|
|
91
|
+
["@tamagui/core/reset.css", "@tamagui/core/reset.css"],
|
|
92
|
+
["@tamagui/core", "@tamagui/core"],
|
|
93
|
+
["react-native-svg", "@tamagui/react-native-svg"],
|
|
94
|
+
["react/jsx-runtime.js", "react/jsx-runtime"],
|
|
95
|
+
["react/jsx-runtime", "react/jsx-runtime"],
|
|
96
|
+
["react/jsx-dev-runtime.js", "react/jsx-dev-runtime"],
|
|
97
|
+
["react/jsx-dev-runtime", "react/jsx-dev-runtime"],
|
|
98
|
+
["react-native-reanimated", "react-native-reanimated"],
|
|
99
|
+
["react-native$", rnw],
|
|
100
|
+
["react-native-web$", rnw],
|
|
101
|
+
["@testing-library/react-native", "@tamagui/proxy-worm"],
|
|
102
|
+
["@gorhom/bottom-sheet$", "@gorhom/bottom-sheet"],
|
|
103
|
+
["react-native/Libraries/Renderer/shims/ReactFabric", "@tamagui/proxy-worm"],
|
|
104
|
+
...tamaguiOptions.aliasReactPackages ? [
|
|
40
105
|
["react", "react"],
|
|
41
106
|
["react-dom", "react-dom"]
|
|
42
|
-
] : []
|
|
43
|
-
|
|
107
|
+
] : []
|
|
108
|
+
);
|
|
109
|
+
const alias = {
|
|
110
|
+
...webpackConfig.resolve.alias || {},
|
|
111
|
+
...tamaguiAliases
|
|
44
112
|
};
|
|
113
|
+
if (process.env.DEBUG) {
|
|
114
|
+
console.log("Tamagui alias:", alias);
|
|
115
|
+
}
|
|
116
|
+
if (process.env.ANALYZE === "true") {
|
|
117
|
+
Object.assign(webpackConfig.optimization, {
|
|
118
|
+
concatenateModules: false
|
|
119
|
+
});
|
|
120
|
+
}
|
|
45
121
|
webpackConfig.resolve.alias = alias;
|
|
46
|
-
webpackConfig.plugins.push(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
122
|
+
webpackConfig.plugins.push(
|
|
123
|
+
new webpack.DefinePlugin({
|
|
124
|
+
"process.env.IS_STATIC": '""',
|
|
125
|
+
"process.env.TAMAGUI_TARGET": '"web"',
|
|
126
|
+
__DEV__: JSON.stringify(dev)
|
|
127
|
+
})
|
|
128
|
+
);
|
|
51
129
|
const excludeExports = tamaguiOptions.excludeReactNativeWebExports;
|
|
52
130
|
if (Array.isArray(excludeExports)) {
|
|
131
|
+
if (excludeExports.includes("PressResponder")) {
|
|
132
|
+
console.warn(
|
|
133
|
+
`\u26A0\uFE0F Warning: as of beta 118, PressReponder shouldn't be excluded in excludeReactNativeWebExports`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
53
136
|
try {
|
|
54
|
-
const regexStr =
|
|
137
|
+
const regexStr = `react-native-web(-lite)?/.*(${excludeExports.join("|")}).*js`;
|
|
55
138
|
const regex = new RegExp(regexStr);
|
|
56
|
-
|
|
57
|
-
|
|
139
|
+
webpackConfig.plugins.push(
|
|
140
|
+
new webpack.NormalModuleReplacementPlugin(regex, resolveEsm("@tamagui/proxy-worm"))
|
|
141
|
+
);
|
|
58
142
|
} catch (err) {
|
|
59
|
-
console.warn(
|
|
143
|
+
console.warn(
|
|
144
|
+
`Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(", ")}`
|
|
145
|
+
);
|
|
60
146
|
}
|
|
61
147
|
}
|
|
62
148
|
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
@@ -69,39 +155,54 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
69
155
|
}
|
|
70
156
|
}
|
|
71
157
|
if (!dev) {
|
|
72
|
-
const cssMin = webpackConfig.optimization.minimizer.find(
|
|
158
|
+
const cssMin = webpackConfig.optimization.minimizer.find(
|
|
159
|
+
(x) => x.toString().includes("css-minimizer-plugin")
|
|
160
|
+
);
|
|
73
161
|
if (cssMin) {
|
|
74
|
-
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(
|
|
162
|
+
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(
|
|
163
|
+
cssMin.index,
|
|
164
|
+
1
|
|
165
|
+
);
|
|
75
166
|
}
|
|
76
167
|
webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin());
|
|
77
168
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
169
|
+
webpackConfig.resolve.extensions = [
|
|
170
|
+
.../* @__PURE__ */ new Set([".web.tsx", ".web.ts", ".web.js", ...webpackConfig.resolve.extensions])
|
|
171
|
+
];
|
|
81
172
|
webpackConfig.resolve.mainFields.unshift("module:jsx");
|
|
82
173
|
if (isServer) {
|
|
83
|
-
const
|
|
84
|
-
var _a2;
|
|
174
|
+
const externalize = (context, request) => {
|
|
85
175
|
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
176
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
177
|
+
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
178
|
+
context,
|
|
179
|
+
request,
|
|
180
|
+
fullPath
|
|
181
|
+
});
|
|
182
|
+
if (userRes !== void 0) {
|
|
183
|
+
return userRes;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (isInComponentModule(fullPath)) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (fullPath.includes("react-native-web-lite")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) {
|
|
193
|
+
return false;
|
|
93
194
|
}
|
|
94
|
-
if (fullPath.startsWith("react-native-web") || fullPath.includes(
|
|
195
|
+
if (fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)) {
|
|
95
196
|
return `commonjs ${fullPath}`;
|
|
96
197
|
}
|
|
97
|
-
if (fullPath.
|
|
198
|
+
if (fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")) {
|
|
98
199
|
return;
|
|
99
200
|
}
|
|
100
|
-
if (
|
|
201
|
+
if (/^@?react-native-/.test(request)) {
|
|
101
202
|
return false;
|
|
102
203
|
}
|
|
103
204
|
return true;
|
|
104
|
-
}
|
|
205
|
+
};
|
|
105
206
|
webpackConfig.externals = [
|
|
106
207
|
...webpackConfig.externals.map((external) => {
|
|
107
208
|
if (typeof external !== "function") {
|
|
@@ -109,7 +210,7 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
109
210
|
}
|
|
110
211
|
return (ctx, cb) => {
|
|
111
212
|
const isCb = typeof cb === "function";
|
|
112
|
-
const res =
|
|
213
|
+
const res = externalize(ctx.context, ctx.request);
|
|
113
214
|
if (isCb) {
|
|
114
215
|
if (typeof res === "string") {
|
|
115
216
|
return cb(null, res);
|
|
@@ -125,56 +226,88 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
125
226
|
];
|
|
126
227
|
}
|
|
127
228
|
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
128
|
-
const cssLoader = getGlobalCssLoader(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
229
|
+
const cssLoader = getGlobalCssLoader(
|
|
230
|
+
{
|
|
231
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
232
|
+
future: nextConfig.future,
|
|
233
|
+
experimental: nextConfig.experimental || {},
|
|
234
|
+
isClient: !isServer,
|
|
235
|
+
isServer,
|
|
236
|
+
isDevelopment: dev
|
|
237
|
+
},
|
|
238
|
+
() => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),
|
|
239
|
+
[]
|
|
240
|
+
);
|
|
136
241
|
if (oneOfRule) {
|
|
242
|
+
if (!tamaguiOptions.disableFontSupport) {
|
|
243
|
+
oneOfRule.oneOf.unshift({
|
|
244
|
+
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
245
|
+
use: [
|
|
246
|
+
{
|
|
247
|
+
loader: require.resolve("url-loader"),
|
|
248
|
+
options: {
|
|
249
|
+
limit: nextConfig.inlineFontLimit || 1024,
|
|
250
|
+
fallback: require.resolve("file-loader"),
|
|
251
|
+
publicPath: `${nextConfig.assetPrefix || ""}/_next/static/chunks/fonts/`,
|
|
252
|
+
outputPath: `${isServer ? "../" : ""}static/chunks/fonts/`,
|
|
253
|
+
name: "[name].[ext]"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
const cssTest = tamaguiOptions.includeCSSTest ?? ((file) => {
|
|
260
|
+
return file.endsWith(".css");
|
|
261
|
+
});
|
|
137
262
|
if (!dev) {
|
|
138
263
|
const postCSSLoader = cssLoader[cssLoader.length - 1];
|
|
139
264
|
oneOfRule.oneOf.unshift({
|
|
140
|
-
test:
|
|
265
|
+
test: cssTest,
|
|
141
266
|
use: [MiniCSSExtractPlugin.loader, "css-loader", postCSSLoader],
|
|
142
267
|
sideEffects: true
|
|
143
268
|
});
|
|
144
|
-
webpackConfig.plugins.push(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
269
|
+
webpackConfig.plugins.push(
|
|
270
|
+
new MiniCSSExtractPlugin({
|
|
271
|
+
filename: "static/css/[contenthash].css",
|
|
272
|
+
ignoreOrder: true,
|
|
273
|
+
runtime: false
|
|
274
|
+
})
|
|
275
|
+
);
|
|
276
|
+
if (tamaguiOptions.inlineCSS) {
|
|
277
|
+
webpackConfig.plugins.push(new InlineCSSPlugin());
|
|
278
|
+
}
|
|
149
279
|
} else {
|
|
150
280
|
oneOfRule.oneOf.unshift({
|
|
151
|
-
test:
|
|
281
|
+
test: cssTest,
|
|
152
282
|
sideEffects: true,
|
|
153
283
|
use: cssLoader
|
|
154
284
|
});
|
|
155
285
|
}
|
|
156
286
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
287
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
288
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
289
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex(
|
|
290
|
+
(x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api"
|
|
291
|
+
) + 1;
|
|
292
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
293
|
+
oneOfJSRules.splice(
|
|
294
|
+
afterSWCLoaderIndex,
|
|
295
|
+
0,
|
|
296
|
+
{
|
|
297
|
+
test: /(bottom-sheet|react-native-reanimated).*\.[tj]sx?$/,
|
|
164
298
|
use: [
|
|
165
299
|
{
|
|
166
300
|
loader: "babel-loader",
|
|
167
301
|
options: {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"@babel/plugin-transform-react-jsx"
|
|
171
|
-
]
|
|
302
|
+
presets: ["@babel/preset-react"],
|
|
303
|
+
plugins: ["react-native-reanimated/plugin"]
|
|
172
304
|
}
|
|
173
305
|
}
|
|
174
306
|
]
|
|
175
|
-
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
176
309
|
test: /\.(jsx?|tsx?)$/,
|
|
177
|
-
exclude: (path2) => shouldExclude(path2, options.dir
|
|
310
|
+
exclude: (path2) => shouldExclude(path2, options.dir),
|
|
178
311
|
use: [
|
|
179
312
|
...[].concat(swcLoader.use),
|
|
180
313
|
{
|
|
@@ -182,36 +315,8 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
182
315
|
options: tamaguiOptions
|
|
183
316
|
}
|
|
184
317
|
]
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
188
|
-
webpackConfig.module.rules = [
|
|
189
|
-
first,
|
|
190
|
-
second,
|
|
191
|
-
{
|
|
192
|
-
test: /\.(tsx|jsx)$/,
|
|
193
|
-
exclude: (path2) => shouldExclude(path2, options.dir, tamaguiOptions),
|
|
194
|
-
use: [
|
|
195
|
-
"thread-loader",
|
|
196
|
-
{
|
|
197
|
-
loader: "esbuild-loader",
|
|
198
|
-
options: {
|
|
199
|
-
loader: "tsx",
|
|
200
|
-
minify: false
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
loader: "tamagui-loader",
|
|
205
|
-
options: {
|
|
206
|
-
prefixLogs: prefix,
|
|
207
|
-
...tamaguiOptions
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
|
-
...rest
|
|
213
|
-
];
|
|
214
|
-
}
|
|
318
|
+
}
|
|
319
|
+
);
|
|
215
320
|
if (typeof nextConfig.webpack === "function") {
|
|
216
321
|
return nextConfig.webpack(webpackConfig, options);
|
|
217
322
|
}
|
|
@@ -219,7 +324,7 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
219
324
|
}
|
|
220
325
|
};
|
|
221
326
|
};
|
|
222
|
-
}
|
|
327
|
+
};
|
|
223
328
|
function getSupportedBrowsers(dir, isDevelopment) {
|
|
224
329
|
let browsers;
|
|
225
330
|
try {
|
|
@@ -231,7 +336,7 @@ function getSupportedBrowsers(dir, isDevelopment) {
|
|
|
231
336
|
}
|
|
232
337
|
return browsers;
|
|
233
338
|
}
|
|
234
|
-
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
235
339
|
export {
|
|
236
340
|
withTamagui
|
|
237
341
|
};
|
|
342
|
+
//# sourceMappingURL=withTamagui.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
+
"sourcesContent": ["import { existsSync } from 'fs'\nimport path, { dirname, join } from 'path'\n\nimport type { TamaguiOptions } from '@tamagui/static'\nimport browserslist from 'browserslist'\nimport CssMinimizerPlugin from 'css-minimizer-webpack-plugin'\nimport buildResolver from 'esm-resolve'\nimport InlineCSSPlugin from 'html-inline-css-webpack-plugin'\nimport MiniCSSExtractPlugin from 'mini-css-extract-plugin'\nimport { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css'\nimport { getGlobalCssLoader } from 'next/dist/build/webpack/config/blocks/css/loaders'\nimport { shouldExclude as shouldExcludeDefault } from 'tamagui-loader'\nimport webpack from 'webpack'\n\nexport type WithTamaguiProps = TamaguiOptions & {\n useReactNativeWebLite: boolean\n disableFontSupport?: boolean\n aliasReactPackages?: boolean\n includeCSSTest?: RegExp | ((path: string) => boolean)\n inlineCSS?: boolean\n shouldExtract?: (path: string, projectRoot: string) => boolean | undefined\n shouldExcludeFromServer?: (props: {\n context: string\n request: string\n fullPath: string\n }) => boolean | string | undefined\n}\n\nexport const withTamagui = (tamaguiOptions: WithTamaguiProps) => {\n return (nextConfig: any = {}) => {\n return {\n ...nextConfig,\n webpack: (webpackConfig: any, options: any) => {\n const { dir, config, dev, isServer } = options\n\n const resolver = buildResolver(join(dir, 'index.js'), {\n constraints: 'node',\n })\n\n // @ts-ignore\n if (typeof globalThis['__DEV__'] === 'undefined') {\n // @ts-ignore\n globalThis['__DEV__'] = dev\n }\n\n const isNext12 = typeof options.config?.swcMinify === 'boolean'\n if (!isNext12) {\n throw new Error(`Next.js 12 only supported`)\n }\n\n const prefix = `${isServer ? ' ssr ' : ' web '} |`\n\n const safeResolves = (...resolves: [string, string][]) => {\n const res: string[][] = []\n for (const [out, mod] of resolves) {\n if (out.endsWith('$')) {\n res.push([out, mod])\n continue\n }\n try {\n res.push([out, resolveEsm(mod)])\n } catch (err) {\n if (out.includes(`@gorhom/bottom-sheet`)) {\n continue\n }\n if (process.env.DEBUG?.startsWith('tamagui')) {\n // eslint-disable-next-line no-console\n console.log(prefix, `withTamagui skipping resolving ${out}`, err)\n }\n }\n }\n return Object.fromEntries(res)\n }\n\n const resolveEsm = (relativePath: string) => {\n if (isServer) return require.resolve(relativePath)\n const esm = resolver(relativePath)\n return esm ? path.join(dir, esm) : require.resolve(relativePath)\n }\n\n const SEP = path.sep\n\n // automatically compile our given components\n const componentsFullPaths = safeResolves(\n ...tamaguiOptions.components.map(\n (moduleName) => [moduleName, moduleName] as [string, string]\n )\n )\n\n const componentsBaseDirs = Object.entries(componentsFullPaths).map(\n ([_moduleName, fullPath]) => {\n let rootPath = dirname(fullPath as string)\n while (rootPath.length > 1) {\n const pkg = join(rootPath, 'package.json')\n const hasPkg = existsSync(pkg)\n if (hasPkg) {\n return rootPath\n } else {\n rootPath = join(rootPath, '..')\n }\n }\n throw new Error(`Couldn't find package.json in any path above: ${fullPath}`)\n }\n )\n\n function isInComponentModule(fullPath: string) {\n return componentsBaseDirs.some((componentDir) => fullPath.startsWith(componentDir))\n }\n\n // allows configuration\n const shouldExclude = (path: string, projectRoot: string) => {\n const res = tamaguiOptions.shouldExtract?.(path, projectRoot)\n if (typeof res === 'boolean') {\n return !res\n }\n if (isInComponentModule(path)) {\n return false\n }\n return shouldExcludeDefault(path, projectRoot)\n }\n\n const rnw = tamaguiOptions.useReactNativeWebLite\n ? 'react-native-web-lite'\n : 'react-native-web'\n\n const tamaguiAliases = safeResolves(\n ['@tamagui/core/reset.css', '@tamagui/core/reset.css'],\n ['@tamagui/core', '@tamagui/core'],\n ['react-native-svg', '@tamagui/react-native-svg'],\n // fixes https://github.com/kentcdodds/mdx-bundler/issues/143\n ['react/jsx-runtime.js', 'react/jsx-runtime'],\n ['react/jsx-runtime', 'react/jsx-runtime'],\n ['react/jsx-dev-runtime.js', 'react/jsx-dev-runtime'],\n ['react/jsx-dev-runtime', 'react/jsx-dev-runtime'],\n ['react-native-reanimated', 'react-native-reanimated'],\n ['react-native$', rnw],\n ['react-native-web$', rnw],\n ['@testing-library/react-native', '@tamagui/proxy-worm'],\n ['@gorhom/bottom-sheet$', '@gorhom/bottom-sheet'],\n // fix reanimated 3\n ['react-native/Libraries/Renderer/shims/ReactFabric', '@tamagui/proxy-worm'],\n ...(tamaguiOptions.aliasReactPackages\n ? ([\n ['react', 'react'],\n ['react-dom', 'react-dom'],\n ] as any)\n : [])\n )\n\n const alias = {\n ...(webpackConfig.resolve.alias || {}),\n ...tamaguiAliases,\n }\n\n if (process.env.DEBUG) {\n // eslint-disable-next-line no-console\n console.log('Tamagui alias:', alias)\n }\n\n if (process.env.ANALYZE === 'true') {\n Object.assign(webpackConfig.optimization, {\n concatenateModules: false,\n })\n }\n\n webpackConfig.resolve.alias = alias\n\n webpackConfig.plugins.push(\n new webpack.DefinePlugin({\n 'process.env.IS_STATIC': '\"\"',\n 'process.env.TAMAGUI_TARGET': '\"web\"',\n __DEV__: JSON.stringify(dev),\n })\n )\n\n const excludeExports = tamaguiOptions.excludeReactNativeWebExports\n if (Array.isArray(excludeExports)) {\n if (excludeExports.includes('PressResponder')) {\n console.warn(\n `\u26A0\uFE0F Warning: as of beta 118, PressReponder shouldn't be excluded in excludeReactNativeWebExports`\n )\n }\n try {\n const regexStr = `react-native-web(-lite)?/.*(${excludeExports.join('|')}).*js`\n const regex = new RegExp(regexStr)\n // console.log(prefix, 'exclude', regexStr)\n webpackConfig.plugins.push(\n new webpack.NormalModuleReplacementPlugin(regex, resolveEsm('@tamagui/proxy-worm'))\n )\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(\n `Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(', ')}`\n )\n }\n }\n\n if (process.env.IGNORE_TS_CONFIG_PATHS) {\n if (process.env.DEBUG) {\n // eslint-disable-next-line no-console\n console.log(prefix, 'ignoring tsconfig paths')\n }\n if (webpackConfig.resolve.plugins[0]) {\n delete webpackConfig.resolve.plugins[0].paths['@tamagui/*']\n delete webpackConfig.resolve.plugins[0].paths['tamagui']\n }\n }\n\n // TODO document and make configurable\n // replaces minifier with css-minimizer-webpack-plugin which handles deduping atomic styles\n if (!dev) {\n const cssMin = webpackConfig.optimization.minimizer.find((x) =>\n x.toString().includes('css-minimizer-plugin')\n )\n if (cssMin) {\n webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(\n cssMin.index,\n 1\n )\n }\n webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin())\n }\n\n webpackConfig.resolve.extensions = [\n ...new Set(['.web.tsx', '.web.ts', '.web.js', ...webpackConfig.resolve.extensions]),\n ]\n\n // look for compiled js with jsx intact as specified by module:jsx\n webpackConfig.resolve.mainFields.unshift('module:jsx')\n\n if (isServer) {\n const externalize = (context: string, request: string) => {\n const fullPath = request[0] === '.' ? path.join(context, request) : request\n\n if (tamaguiOptions.shouldExcludeFromServer) {\n const userRes = tamaguiOptions.shouldExcludeFromServer({\n context,\n request,\n fullPath,\n })\n if (userRes !== undefined) {\n return userRes\n }\n }\n\n if (isInComponentModule(fullPath)) {\n return false\n }\n\n if (fullPath.includes('react-native-web-lite')) {\n // always inline react-native-web-lite due to errors where next.js resolved the path to esm\n return false\n }\n\n // must inline react-native so we can alias to react-native-web\n if (fullPath === 'react-native' || fullPath.startsWith(`react-native${SEP}`)) {\n return false\n }\n\n if (\n // feather icons uses react-native-svg which needs to be aliased\n // fullPath.includes('/lucide-icons/') ||\n fullPath.startsWith('react-native-web') ||\n fullPath.includes(`node_modules${SEP}react-native-web`) ||\n new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)\n ) {\n return `commonjs ${fullPath}`\n }\n if (\n fullPath.startsWith('moti') ||\n fullPath.startsWith('solito') ||\n fullPath === 'tamagui' ||\n fullPath.startsWith('@tamagui') ||\n fullPath === 'react-native-safe-area-context' ||\n fullPath === 'expo-linear-gradient' ||\n fullPath.startsWith('@react-navigation') ||\n fullPath.startsWith('@gorhom')\n ) {\n return\n }\n if (/^@?react-native-/.test(request)) {\n return false\n }\n return true\n }\n\n // externalize react native things from bundle\n webpackConfig.externals = [\n ...webpackConfig.externals.map((external) => {\n if (typeof external !== 'function') {\n return external\n }\n // only runs on server\n return (ctx, cb) => {\n const isCb = typeof cb === 'function'\n const res = externalize(ctx.context, ctx.request)\n if (isCb) {\n if (typeof res === 'string') {\n return cb(null, res)\n }\n if (res) {\n return external(ctx, cb)\n }\n return cb()\n }\n return !res\n ? Promise.resolve(undefined)\n : typeof res === 'string'\n ? Promise.resolve(res)\n : external(ctx)\n }\n }),\n ]\n }\n\n const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf)\n\n const cssLoader = getGlobalCssLoader(\n // @ts-ignore\n {\n assetPrefix: options.config.assetPrefix || config.assetPrefix,\n future: nextConfig.future,\n experimental: nextConfig.experimental || {},\n isClient: !isServer,\n isServer,\n isDevelopment: dev,\n },\n // @ts-ignore\n () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),\n []\n )\n\n if (oneOfRule) {\n if (!tamaguiOptions.disableFontSupport) {\n // fonts support\n oneOfRule.oneOf.unshift({\n test: /\\.(woff(2)?|eot|ttf|otf)(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n use: [\n {\n loader: require.resolve('url-loader'),\n options: {\n limit: nextConfig.inlineFontLimit || 1024,\n fallback: require.resolve('file-loader'),\n publicPath: `${nextConfig.assetPrefix || ''}/_next/static/chunks/fonts/`,\n outputPath: `${isServer ? '../' : ''}static/chunks/fonts/`,\n name: '[name].[ext]',\n },\n },\n ],\n })\n }\n\n const cssTest =\n tamaguiOptions.includeCSSTest ??\n ((file) => {\n return file.endsWith('.css')\n })\n\n if (!dev) {\n const postCSSLoader = cssLoader[cssLoader.length - 1]\n // replace nextjs picky style rules with simple minicssextract\n oneOfRule.oneOf.unshift({\n test: cssTest,\n use: [MiniCSSExtractPlugin.loader, 'css-loader', postCSSLoader],\n sideEffects: true,\n })\n webpackConfig.plugins.push(\n new MiniCSSExtractPlugin({\n filename: 'static/css/[contenthash].css',\n ignoreOrder: true,\n runtime: false,\n })\n )\n if (tamaguiOptions.inlineCSS) {\n webpackConfig.plugins.push(new InlineCSSPlugin())\n }\n } else {\n oneOfRule.oneOf.unshift({\n test: cssTest,\n sideEffects: true,\n use: cssLoader,\n })\n }\n }\n\n const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf)\n const oneOfJSRules: any[] = webpackConfig.module.rules[firstOneOfRule].oneOf\n const afterSWCLoaderIndex =\n oneOfJSRules.findIndex(\n (x) => x && x.use && x.use.loader === 'next-swc-loader' && x.issuerLayer !== 'api'\n ) + 1\n const swcLoader = oneOfJSRules[afterSWCLoaderIndex]\n\n // put an earlier loader where we just do tamagui stuff before regular swc\n oneOfJSRules.splice(\n afterSWCLoaderIndex,\n 0,\n {\n test: /(bottom-sheet|react-native-reanimated).*\\.[tj]sx?$/,\n use: [\n {\n loader: 'babel-loader',\n options: {\n presets: ['@babel/preset-react'],\n plugins: ['react-native-reanimated/plugin'],\n },\n },\n ],\n },\n {\n test: /\\.(jsx?|tsx?)$/,\n exclude: (path: string) => shouldExclude(path, options.dir),\n use: [\n ...[].concat(swcLoader.use),\n {\n loader: 'tamagui-loader',\n options: tamaguiOptions,\n },\n ],\n }\n )\n\n if (typeof nextConfig.webpack === 'function') {\n return nextConfig.webpack(webpackConfig, options)\n }\n\n return webpackConfig\n },\n }\n }\n}\n\nfunction getSupportedBrowsers(dir, isDevelopment) {\n let browsers\n try {\n browsers = browserslist.loadConfig({\n path: dir,\n env: isDevelopment ? 'development' : 'production',\n })\n } catch {}\n\n return browsers\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,OAAO,QAAQ,SAAS,YAAY;AAGpC,OAAO,kBAAkB;AACzB,OAAO,wBAAwB;AAC/B,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,OAAO,0BAA0B;AACjC,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,iBAAiB,4BAA4B;AACtD,OAAO,aAAa;AAgBb,MAAM,cAAc,CAAC,mBAAqC;AAC/D,SAAO,CAAC,aAAkB,CAAC,MAAM;AAC/B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,SA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B,EAAE,gBAAgB;AAAA,QAC/E,IAAI;AACN,cAAM,YAAY,aAAa;AAG/B,qBAAa;AAAA,UACX;AAAA,UACA;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,KAAK;AAAA,cACH;AAAA,gBACE,QAAQ;AAAA,gBACR,SAAS;AAAA,kBACP,SAAS,CAAC,qBAAqB;AAAA,kBAC/B,SAAS,CAAC,gCAAgC;AAAA,gBAC5C;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,SAAS,CAACA,UAAiB,cAAcA,OAAM,QAAQ,GAAG;AAAA,YAC1D,KAAK;AAAA,cACH,GAAG,CAAC,EAAE,OAAO,UAAU,GAAG;AAAA,cAC1B;AAAA,gBACE,QAAQ;AAAA,gBACR,SAAS;AAAA,cACX;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAEA,YAAI,OAAO,WAAW,YAAY,YAAY;AAC5C,iBAAO,WAAW,QAAQ,eAAe,OAAO;AAAA,QAClD;AAEA,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,qBAAqB,KAAK,eAAe;AAChD,MAAI;AACJ,MAAI;AACF,eAAW,aAAa,WAAW;AAAA,MACjC,MAAM;AAAA,MACN,KAAK,gBAAgB,gBAAgB;AAAA,IACvC,CAAC;AAAA,EACH,QAAE;AAAA,EAAO;AAET,SAAO;AACT;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,41 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/next-plugin",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.211",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
6
|
+
"types": "./types/index.d.ts",
|
|
7
7
|
"main": "dist/cjs",
|
|
8
8
|
"module": "dist/esm",
|
|
9
9
|
"module:jsx": "dist/jsx",
|
|
10
10
|
"files": [
|
|
11
|
+
"src",
|
|
11
12
|
"types",
|
|
12
13
|
"dist"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
15
16
|
"build": "tamagui-build",
|
|
16
17
|
"watch": "tamagui-build --watch",
|
|
18
|
+
"lint": "eslint",
|
|
19
|
+
"lint:fix": "yarn lint --fix",
|
|
17
20
|
"clean": "tamagui-build clean",
|
|
18
21
|
"clean:build": "tamagui-build clean:build"
|
|
19
22
|
},
|
|
20
23
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@tamagui/proxy-worm": "^1.0.1-beta.
|
|
23
|
-
"@tamagui/
|
|
24
|
+
"@babel/preset-react": "^7.18.6",
|
|
25
|
+
"@tamagui/proxy-worm": "^1.0.1-beta.211",
|
|
26
|
+
"@tamagui/react-native-svg": "^1.0.1-beta.211",
|
|
27
|
+
"@tamagui/static": "^1.0.1-beta.211",
|
|
24
28
|
"babel-loader": "^8.2.5",
|
|
25
|
-
"browserslist": "^4.
|
|
26
|
-
"css-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
29
|
+
"browserslist": "^4.21.1",
|
|
30
|
+
"css-loader": "^5.2.4",
|
|
31
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
32
|
+
"esbuild-loader": "^2.19.0",
|
|
33
|
+
"esm-resolve": "^1.0.8",
|
|
34
|
+
"file-loader": "^6.2.0",
|
|
35
|
+
"html-inline-css-webpack-plugin": "^1.11.1",
|
|
36
|
+
"html-webpack-plugin": "^5.5.0",
|
|
37
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
38
|
+
"tamagui-loader": "^1.0.1-beta.211",
|
|
39
|
+
"thread-loader": "^3.0.4",
|
|
40
|
+
"url-loader": "^4.1.1"
|
|
32
41
|
},
|
|
33
42
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
35
|
-
"next": "^
|
|
43
|
+
"@tamagui/build": "^1.0.1-beta.211",
|
|
44
|
+
"next": "^13.0.2"
|
|
36
45
|
},
|
|
37
46
|
"peerDependencies": {
|
|
38
|
-
"next": "
|
|
47
|
+
"next": "13.0.2"
|
|
39
48
|
},
|
|
40
49
|
"publishConfig": {
|
|
41
50
|
"access": "public"
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './withTamagui'
|