@atomic-variants/next-plugin 0.1.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/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@atomic-variants/constants`);c=s(c);let l=require(`@atomic-variants/webpack-plugin`);l=s(l);function u(e){return{...e,webpack:(t,n)=>(t.plugins?.push(new l.default),typeof e.webpack==`function`?e.webpack(t,n):t),experimental:{...e.experimental,swcPlugins:[...e.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:c.ATOMIC_TAG}]]}}}exports.withAtomicVariants=u;
@@ -0,0 +1,281 @@
1
+ import * as next_dist_compiled_webpack_webpack0 from "next/dist/compiled/webpack/webpack";
2
+ import * as next_dist_build_webpack_plugins_subresource_integrity_plugin0 from "next/dist/build/webpack/plugins/subresource-integrity-plugin";
3
+ import * as next_dist_shared_lib_utils0 from "next/dist/shared/lib/utils";
4
+ import * as next_dist_server_config_shared0 from "next/dist/server/config-shared";
5
+ import * as next_dist_server_lib_experimental_ppr0 from "next/dist/server/lib/experimental/ppr";
6
+ import * as next0 from "next";
7
+ import { NextConfig } from "next";
8
+ import * as next_dist_cli_next_test0 from "next/dist/cli/next-test";
9
+ import * as next_dist_lib_load_custom_routes0 from "next/dist/lib/load-custom-routes";
10
+ import * as next_dist_shared_lib_image_config0 from "next/dist/shared/lib/image-config";
11
+ import { Configuration } from "webpack";
12
+
13
+ //#region src/index.d.ts
14
+ type WebpackOptionsType = Parameters<NonNullable<NextConfig["webpack"]>>["1"];
15
+ declare function withAtomicVariants(nextConfig: NextConfig): {
16
+ webpack: (webpackConfig: Configuration, options: WebpackOptionsType) => any;
17
+ experimental: {
18
+ swcPlugins: ([string, Record<string, unknown>] | (string | {
19
+ tag: string;
20
+ })[])[];
21
+ adapterPath?: string;
22
+ useSkewCookie?: boolean;
23
+ cacheHandlers?: {
24
+ default?: string;
25
+ remote?: string;
26
+ static?: string;
27
+ [handlerName: string]: string | undefined;
28
+ };
29
+ multiZoneDraftMode?: boolean;
30
+ appNavFailHandling?: boolean;
31
+ prerenderEarlyExit?: boolean;
32
+ linkNoTouchStart?: boolean;
33
+ caseSensitiveRoutes?: boolean;
34
+ clientSegmentCache?: boolean | "client-only";
35
+ clientParamParsing?: boolean;
36
+ dynamicOnHover?: boolean;
37
+ appDocumentPreloading?: boolean;
38
+ preloadEntriesOnStart?: boolean;
39
+ clientRouterFilter?: boolean;
40
+ clientRouterFilterRedirects?: boolean;
41
+ staleTimes?: {
42
+ dynamic?: number;
43
+ static?: number;
44
+ };
45
+ cacheLife?: {
46
+ [profile: string]: {
47
+ stale?: number;
48
+ revalidate?: number;
49
+ expire?: number;
50
+ };
51
+ };
52
+ clientRouterFilterAllowedRate?: number;
53
+ externalMiddlewareRewritesResolve?: boolean;
54
+ extensionAlias?: Record<string, any>;
55
+ allowedRevalidateHeaderKeys?: string[];
56
+ fetchCacheKeyPrefix?: string;
57
+ imgOptConcurrency?: number | null;
58
+ imgOptTimeoutInSeconds?: number;
59
+ imgOptMaxInputPixels?: number;
60
+ imgOptSequentialRead?: boolean | null;
61
+ imgOptSkipMetadata?: boolean | null;
62
+ optimisticClientCache?: boolean;
63
+ expireTime?: number;
64
+ middlewarePrefetch?: "strict" | "flexible";
65
+ manualClientBasePath?: boolean;
66
+ cssChunking?: boolean | "strict";
67
+ disablePostcssPresetEnv?: boolean;
68
+ cpus?: number;
69
+ memoryBasedWorkersCount?: boolean;
70
+ proxyTimeout?: number;
71
+ isrFlushToDisk?: boolean;
72
+ workerThreads?: boolean;
73
+ optimizeCss?: boolean | Record<string, unknown>;
74
+ nextScriptWorkers?: boolean;
75
+ scrollRestoration?: boolean;
76
+ externalDir?: boolean;
77
+ amp?: {
78
+ optimizer?: any;
79
+ validator?: string;
80
+ skipValidation?: boolean;
81
+ };
82
+ disableOptimizedLoading?: boolean;
83
+ gzipSize?: boolean;
84
+ craCompat?: boolean;
85
+ esmExternals?: boolean | "loose";
86
+ fullySpecified?: boolean;
87
+ urlImports?: NonNullable<next_dist_compiled_webpack_webpack0.webpack.Configuration["experiments"]>["buildHttp"];
88
+ swcTraceProfiling?: boolean;
89
+ forceSwcTransforms?: boolean;
90
+ largePageDataBytes?: number;
91
+ fallbackNodePolyfills?: false;
92
+ sri?: {
93
+ algorithm?: next_dist_build_webpack_plugins_subresource_integrity_plugin0.SubresourceIntegrityAlgorithm;
94
+ };
95
+ webVitalsAttribution?: Array<typeof next_dist_shared_lib_utils0.WEB_VITALS[number]>;
96
+ optimizePackageImports?: string[];
97
+ optimizeServerReact?: boolean;
98
+ turbo?: next_dist_server_config_shared0.DeprecatedExperimentalTurboOptions;
99
+ turbopackMemoryLimit?: number;
100
+ turbopackMinify?: boolean;
101
+ turbopackScopeHoisting?: boolean;
102
+ turbopackPersistentCaching?: boolean;
103
+ turbopackSourceMaps?: boolean;
104
+ turbopackTreeShaking?: boolean;
105
+ turbopackRemoveUnusedExports?: boolean;
106
+ mdxRs?: boolean | {
107
+ development?: boolean;
108
+ jsx?: boolean;
109
+ jsxRuntime?: string;
110
+ jsxImportSource?: string;
111
+ providerImportSource?: string;
112
+ mdxType?: "gfm" | "commonmark";
113
+ };
114
+ typedRoutes?: boolean;
115
+ typedEnv?: boolean;
116
+ parallelServerCompiles?: boolean;
117
+ parallelServerBuildTraces?: boolean;
118
+ webpackBuildWorker?: boolean;
119
+ webpackMemoryOptimizations?: boolean;
120
+ clientTraceMetadata?: string[];
121
+ ppr?: next_dist_server_lib_experimental_ppr0.ExperimentalPPRConfig;
122
+ taint?: boolean;
123
+ routerBFCache?: boolean;
124
+ removeUncaughtErrorAndRejectionListeners?: boolean;
125
+ validateRSCRequestHeaders?: boolean;
126
+ serverActions?: {
127
+ bodySizeLimit?: next0.SizeLimit;
128
+ allowedOrigins?: string[];
129
+ };
130
+ serverMinification?: boolean;
131
+ enablePrerenderSourceMaps?: boolean;
132
+ serverSourceMaps?: boolean;
133
+ useWasmBinary?: boolean;
134
+ useLightningcss?: boolean;
135
+ viewTransition?: boolean;
136
+ testProxy?: boolean;
137
+ defaultTestRunner?: next_dist_cli_next_test0.SupportedTestRunners;
138
+ allowDevelopmentBuild?: true;
139
+ bundlePagesExternals?: boolean;
140
+ serverComponentsExternalPackages?: string[];
141
+ reactCompiler?: boolean | next_dist_server_config_shared0.ReactCompilerOptions;
142
+ staticGenerationRetryCount?: number;
143
+ staticGenerationMaxConcurrency?: number;
144
+ staticGenerationMinPagesPerWorker?: number;
145
+ serverComponentsHmrCache?: boolean;
146
+ cacheComponents?: boolean;
147
+ dynamicIO?: boolean;
148
+ inlineCss?: boolean;
149
+ authInterrupts?: boolean;
150
+ useCache?: boolean;
151
+ slowModuleDetection?: {
152
+ buildTimeThresholdMs: number;
153
+ };
154
+ globalNotFound?: boolean;
155
+ devtoolSegmentExplorer?: boolean;
156
+ browserDebugInfoInTerminal?: boolean | {
157
+ depthLimit?: number;
158
+ edgeLimit?: number;
159
+ showSourceLocation?: boolean;
160
+ };
161
+ optimizeRouterScrolling?: boolean;
162
+ rootParams?: boolean;
163
+ middlewareClientMaxBodySize?: next0.SizeLimit;
164
+ };
165
+ allowedDevOrigins?: string[];
166
+ exportPathMap?: (defaultMap: next_dist_server_config_shared0.ExportPathMap, ctx: {
167
+ dev: boolean;
168
+ dir: string;
169
+ outDir: string | null;
170
+ distDir: string;
171
+ buildId: string;
172
+ }) => Promise<next_dist_server_config_shared0.ExportPathMap> | next_dist_server_config_shared0.ExportPathMap;
173
+ i18n?: next_dist_server_config_shared0.I18NConfig | null;
174
+ eslint?: next_dist_server_config_shared0.ESLintConfig;
175
+ typescript?: next_dist_server_config_shared0.TypeScriptConfig;
176
+ typedRoutes?: boolean;
177
+ headers?: () => Promise<next_dist_lib_load_custom_routes0.Header[]>;
178
+ rewrites?: () => Promise<next_dist_lib_load_custom_routes0.Rewrite[] | {
179
+ beforeFiles?: next_dist_lib_load_custom_routes0.Rewrite[];
180
+ afterFiles?: next_dist_lib_load_custom_routes0.Rewrite[];
181
+ fallback?: next_dist_lib_load_custom_routes0.Rewrite[];
182
+ }>;
183
+ redirects?: () => Promise<next_dist_lib_load_custom_routes0.Redirect[]>;
184
+ excludeDefaultMomentLocales?: boolean;
185
+ trailingSlash?: boolean;
186
+ env?: Record<string, string | undefined>;
187
+ distDir?: string;
188
+ cleanDistDir?: boolean;
189
+ assetPrefix?: string;
190
+ cacheHandler?: string | undefined;
191
+ cacheMaxMemorySize?: number;
192
+ useFileSystemPublicRoutes?: boolean;
193
+ generateBuildId?: () => string | null | Promise<string | null>;
194
+ generateEtags?: boolean;
195
+ pageExtensions?: string[];
196
+ compress?: boolean;
197
+ poweredByHeader?: boolean;
198
+ images?: next_dist_shared_lib_image_config0.ImageConfig;
199
+ devIndicators?: false | {
200
+ appIsrStatus?: boolean;
201
+ buildActivity?: boolean;
202
+ buildActivityPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
203
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
204
+ };
205
+ onDemandEntries?: {
206
+ maxInactiveAge?: number;
207
+ pagesBufferLength?: number;
208
+ };
209
+ amp?: {
210
+ canonicalBase?: string;
211
+ };
212
+ deploymentId?: string;
213
+ basePath?: string;
214
+ sassOptions?: {
215
+ implementation?: string;
216
+ [key: string]: any;
217
+ };
218
+ productionBrowserSourceMaps?: boolean;
219
+ reactProductionProfiling?: boolean;
220
+ reactStrictMode?: boolean | null;
221
+ reactMaxHeadersLength?: number;
222
+ publicRuntimeConfig?: {
223
+ [key: string]: any;
224
+ };
225
+ serverRuntimeConfig?: {
226
+ [key: string]: any;
227
+ };
228
+ httpAgentOptions?: {
229
+ keepAlive?: boolean;
230
+ };
231
+ staticPageGenerationTimeout?: number;
232
+ crossOrigin?: "anonymous" | "use-credentials";
233
+ compiler?: {
234
+ reactRemoveProperties?: boolean | {
235
+ properties?: string[];
236
+ };
237
+ relay?: {
238
+ src: string;
239
+ artifactDirectory?: string;
240
+ language?: "typescript" | "javascript" | "flow";
241
+ eagerEsModules?: boolean;
242
+ };
243
+ removeConsole?: boolean | {
244
+ exclude?: string[];
245
+ };
246
+ styledComponents?: boolean | next_dist_server_config_shared0.StyledComponentsConfig;
247
+ emotion?: boolean | next_dist_server_config_shared0.EmotionConfig;
248
+ styledJsx?: boolean | {
249
+ useLightningcss?: boolean;
250
+ };
251
+ define?: Record<string, string>;
252
+ defineServer?: Record<string, string>;
253
+ runAfterProductionCompile?: (metadata: {
254
+ projectDir: string;
255
+ distDir: string;
256
+ }) => Promise<void>;
257
+ };
258
+ output?: "standalone" | "export";
259
+ transpilePackages?: string[];
260
+ turbopack?: next_dist_server_config_shared0.TurbopackOptions;
261
+ skipMiddlewareUrlNormalize?: boolean;
262
+ skipTrailingSlashRedirect?: boolean;
263
+ modularizeImports?: Record<string, {
264
+ transform: string | Record<string, string>;
265
+ preventFullImport?: boolean;
266
+ skipDefaultConversion?: boolean;
267
+ }>;
268
+ logging?: next_dist_server_config_shared0.LoggingConfig | false;
269
+ expireTime?: number;
270
+ bundlePagesRouterDependencies?: boolean;
271
+ serverExternalPackages?: string[];
272
+ outputFileTracingRoot?: string;
273
+ outputFileTracingExcludes?: Record<string, string[]>;
274
+ outputFileTracingIncludes?: Record<string, string[]>;
275
+ watchOptions?: {
276
+ pollIntervalMs?: number;
277
+ };
278
+ htmlLimitedBots?: RegExp;
279
+ };
280
+ //#endregion
281
+ export { withAtomicVariants };
@@ -0,0 +1,281 @@
1
+ import * as next_dist_compiled_webpack_webpack0 from "next/dist/compiled/webpack/webpack";
2
+ import * as next_dist_build_webpack_plugins_subresource_integrity_plugin0 from "next/dist/build/webpack/plugins/subresource-integrity-plugin";
3
+ import * as next_dist_shared_lib_utils0 from "next/dist/shared/lib/utils";
4
+ import * as next_dist_server_config_shared0 from "next/dist/server/config-shared";
5
+ import * as next_dist_server_lib_experimental_ppr0 from "next/dist/server/lib/experimental/ppr";
6
+ import * as next0 from "next";
7
+ import { NextConfig } from "next";
8
+ import * as next_dist_cli_next_test0 from "next/dist/cli/next-test";
9
+ import * as next_dist_lib_load_custom_routes0 from "next/dist/lib/load-custom-routes";
10
+ import * as next_dist_shared_lib_image_config0 from "next/dist/shared/lib/image-config";
11
+ import { Configuration } from "webpack";
12
+
13
+ //#region src/index.d.ts
14
+ type WebpackOptionsType = Parameters<NonNullable<NextConfig["webpack"]>>["1"];
15
+ declare function withAtomicVariants(nextConfig: NextConfig): {
16
+ webpack: (webpackConfig: Configuration, options: WebpackOptionsType) => any;
17
+ experimental: {
18
+ swcPlugins: ([string, Record<string, unknown>] | (string | {
19
+ tag: string;
20
+ })[])[];
21
+ adapterPath?: string;
22
+ useSkewCookie?: boolean;
23
+ cacheHandlers?: {
24
+ default?: string;
25
+ remote?: string;
26
+ static?: string;
27
+ [handlerName: string]: string | undefined;
28
+ };
29
+ multiZoneDraftMode?: boolean;
30
+ appNavFailHandling?: boolean;
31
+ prerenderEarlyExit?: boolean;
32
+ linkNoTouchStart?: boolean;
33
+ caseSensitiveRoutes?: boolean;
34
+ clientSegmentCache?: boolean | "client-only";
35
+ clientParamParsing?: boolean;
36
+ dynamicOnHover?: boolean;
37
+ appDocumentPreloading?: boolean;
38
+ preloadEntriesOnStart?: boolean;
39
+ clientRouterFilter?: boolean;
40
+ clientRouterFilterRedirects?: boolean;
41
+ staleTimes?: {
42
+ dynamic?: number;
43
+ static?: number;
44
+ };
45
+ cacheLife?: {
46
+ [profile: string]: {
47
+ stale?: number;
48
+ revalidate?: number;
49
+ expire?: number;
50
+ };
51
+ };
52
+ clientRouterFilterAllowedRate?: number;
53
+ externalMiddlewareRewritesResolve?: boolean;
54
+ extensionAlias?: Record<string, any>;
55
+ allowedRevalidateHeaderKeys?: string[];
56
+ fetchCacheKeyPrefix?: string;
57
+ imgOptConcurrency?: number | null;
58
+ imgOptTimeoutInSeconds?: number;
59
+ imgOptMaxInputPixels?: number;
60
+ imgOptSequentialRead?: boolean | null;
61
+ imgOptSkipMetadata?: boolean | null;
62
+ optimisticClientCache?: boolean;
63
+ expireTime?: number;
64
+ middlewarePrefetch?: "strict" | "flexible";
65
+ manualClientBasePath?: boolean;
66
+ cssChunking?: boolean | "strict";
67
+ disablePostcssPresetEnv?: boolean;
68
+ cpus?: number;
69
+ memoryBasedWorkersCount?: boolean;
70
+ proxyTimeout?: number;
71
+ isrFlushToDisk?: boolean;
72
+ workerThreads?: boolean;
73
+ optimizeCss?: boolean | Record<string, unknown>;
74
+ nextScriptWorkers?: boolean;
75
+ scrollRestoration?: boolean;
76
+ externalDir?: boolean;
77
+ amp?: {
78
+ optimizer?: any;
79
+ validator?: string;
80
+ skipValidation?: boolean;
81
+ };
82
+ disableOptimizedLoading?: boolean;
83
+ gzipSize?: boolean;
84
+ craCompat?: boolean;
85
+ esmExternals?: boolean | "loose";
86
+ fullySpecified?: boolean;
87
+ urlImports?: NonNullable<next_dist_compiled_webpack_webpack0.webpack.Configuration["experiments"]>["buildHttp"];
88
+ swcTraceProfiling?: boolean;
89
+ forceSwcTransforms?: boolean;
90
+ largePageDataBytes?: number;
91
+ fallbackNodePolyfills?: false;
92
+ sri?: {
93
+ algorithm?: next_dist_build_webpack_plugins_subresource_integrity_plugin0.SubresourceIntegrityAlgorithm;
94
+ };
95
+ webVitalsAttribution?: Array<typeof next_dist_shared_lib_utils0.WEB_VITALS[number]>;
96
+ optimizePackageImports?: string[];
97
+ optimizeServerReact?: boolean;
98
+ turbo?: next_dist_server_config_shared0.DeprecatedExperimentalTurboOptions;
99
+ turbopackMemoryLimit?: number;
100
+ turbopackMinify?: boolean;
101
+ turbopackScopeHoisting?: boolean;
102
+ turbopackPersistentCaching?: boolean;
103
+ turbopackSourceMaps?: boolean;
104
+ turbopackTreeShaking?: boolean;
105
+ turbopackRemoveUnusedExports?: boolean;
106
+ mdxRs?: boolean | {
107
+ development?: boolean;
108
+ jsx?: boolean;
109
+ jsxRuntime?: string;
110
+ jsxImportSource?: string;
111
+ providerImportSource?: string;
112
+ mdxType?: "gfm" | "commonmark";
113
+ };
114
+ typedRoutes?: boolean;
115
+ typedEnv?: boolean;
116
+ parallelServerCompiles?: boolean;
117
+ parallelServerBuildTraces?: boolean;
118
+ webpackBuildWorker?: boolean;
119
+ webpackMemoryOptimizations?: boolean;
120
+ clientTraceMetadata?: string[];
121
+ ppr?: next_dist_server_lib_experimental_ppr0.ExperimentalPPRConfig;
122
+ taint?: boolean;
123
+ routerBFCache?: boolean;
124
+ removeUncaughtErrorAndRejectionListeners?: boolean;
125
+ validateRSCRequestHeaders?: boolean;
126
+ serverActions?: {
127
+ bodySizeLimit?: next0.SizeLimit;
128
+ allowedOrigins?: string[];
129
+ };
130
+ serverMinification?: boolean;
131
+ enablePrerenderSourceMaps?: boolean;
132
+ serverSourceMaps?: boolean;
133
+ useWasmBinary?: boolean;
134
+ useLightningcss?: boolean;
135
+ viewTransition?: boolean;
136
+ testProxy?: boolean;
137
+ defaultTestRunner?: next_dist_cli_next_test0.SupportedTestRunners;
138
+ allowDevelopmentBuild?: true;
139
+ bundlePagesExternals?: boolean;
140
+ serverComponentsExternalPackages?: string[];
141
+ reactCompiler?: boolean | next_dist_server_config_shared0.ReactCompilerOptions;
142
+ staticGenerationRetryCount?: number;
143
+ staticGenerationMaxConcurrency?: number;
144
+ staticGenerationMinPagesPerWorker?: number;
145
+ serverComponentsHmrCache?: boolean;
146
+ cacheComponents?: boolean;
147
+ dynamicIO?: boolean;
148
+ inlineCss?: boolean;
149
+ authInterrupts?: boolean;
150
+ useCache?: boolean;
151
+ slowModuleDetection?: {
152
+ buildTimeThresholdMs: number;
153
+ };
154
+ globalNotFound?: boolean;
155
+ devtoolSegmentExplorer?: boolean;
156
+ browserDebugInfoInTerminal?: boolean | {
157
+ depthLimit?: number;
158
+ edgeLimit?: number;
159
+ showSourceLocation?: boolean;
160
+ };
161
+ optimizeRouterScrolling?: boolean;
162
+ rootParams?: boolean;
163
+ middlewareClientMaxBodySize?: next0.SizeLimit;
164
+ };
165
+ allowedDevOrigins?: string[];
166
+ exportPathMap?: (defaultMap: next_dist_server_config_shared0.ExportPathMap, ctx: {
167
+ dev: boolean;
168
+ dir: string;
169
+ outDir: string | null;
170
+ distDir: string;
171
+ buildId: string;
172
+ }) => Promise<next_dist_server_config_shared0.ExportPathMap> | next_dist_server_config_shared0.ExportPathMap;
173
+ i18n?: next_dist_server_config_shared0.I18NConfig | null;
174
+ eslint?: next_dist_server_config_shared0.ESLintConfig;
175
+ typescript?: next_dist_server_config_shared0.TypeScriptConfig;
176
+ typedRoutes?: boolean;
177
+ headers?: () => Promise<next_dist_lib_load_custom_routes0.Header[]>;
178
+ rewrites?: () => Promise<next_dist_lib_load_custom_routes0.Rewrite[] | {
179
+ beforeFiles?: next_dist_lib_load_custom_routes0.Rewrite[];
180
+ afterFiles?: next_dist_lib_load_custom_routes0.Rewrite[];
181
+ fallback?: next_dist_lib_load_custom_routes0.Rewrite[];
182
+ }>;
183
+ redirects?: () => Promise<next_dist_lib_load_custom_routes0.Redirect[]>;
184
+ excludeDefaultMomentLocales?: boolean;
185
+ trailingSlash?: boolean;
186
+ env?: Record<string, string | undefined>;
187
+ distDir?: string;
188
+ cleanDistDir?: boolean;
189
+ assetPrefix?: string;
190
+ cacheHandler?: string | undefined;
191
+ cacheMaxMemorySize?: number;
192
+ useFileSystemPublicRoutes?: boolean;
193
+ generateBuildId?: () => string | null | Promise<string | null>;
194
+ generateEtags?: boolean;
195
+ pageExtensions?: string[];
196
+ compress?: boolean;
197
+ poweredByHeader?: boolean;
198
+ images?: next_dist_shared_lib_image_config0.ImageConfig;
199
+ devIndicators?: false | {
200
+ appIsrStatus?: boolean;
201
+ buildActivity?: boolean;
202
+ buildActivityPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
203
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
204
+ };
205
+ onDemandEntries?: {
206
+ maxInactiveAge?: number;
207
+ pagesBufferLength?: number;
208
+ };
209
+ amp?: {
210
+ canonicalBase?: string;
211
+ };
212
+ deploymentId?: string;
213
+ basePath?: string;
214
+ sassOptions?: {
215
+ implementation?: string;
216
+ [key: string]: any;
217
+ };
218
+ productionBrowserSourceMaps?: boolean;
219
+ reactProductionProfiling?: boolean;
220
+ reactStrictMode?: boolean | null;
221
+ reactMaxHeadersLength?: number;
222
+ publicRuntimeConfig?: {
223
+ [key: string]: any;
224
+ };
225
+ serverRuntimeConfig?: {
226
+ [key: string]: any;
227
+ };
228
+ httpAgentOptions?: {
229
+ keepAlive?: boolean;
230
+ };
231
+ staticPageGenerationTimeout?: number;
232
+ crossOrigin?: "anonymous" | "use-credentials";
233
+ compiler?: {
234
+ reactRemoveProperties?: boolean | {
235
+ properties?: string[];
236
+ };
237
+ relay?: {
238
+ src: string;
239
+ artifactDirectory?: string;
240
+ language?: "typescript" | "javascript" | "flow";
241
+ eagerEsModules?: boolean;
242
+ };
243
+ removeConsole?: boolean | {
244
+ exclude?: string[];
245
+ };
246
+ styledComponents?: boolean | next_dist_server_config_shared0.StyledComponentsConfig;
247
+ emotion?: boolean | next_dist_server_config_shared0.EmotionConfig;
248
+ styledJsx?: boolean | {
249
+ useLightningcss?: boolean;
250
+ };
251
+ define?: Record<string, string>;
252
+ defineServer?: Record<string, string>;
253
+ runAfterProductionCompile?: (metadata: {
254
+ projectDir: string;
255
+ distDir: string;
256
+ }) => Promise<void>;
257
+ };
258
+ output?: "standalone" | "export";
259
+ transpilePackages?: string[];
260
+ turbopack?: next_dist_server_config_shared0.TurbopackOptions;
261
+ skipMiddlewareUrlNormalize?: boolean;
262
+ skipTrailingSlashRedirect?: boolean;
263
+ modularizeImports?: Record<string, {
264
+ transform: string | Record<string, string>;
265
+ preventFullImport?: boolean;
266
+ skipDefaultConversion?: boolean;
267
+ }>;
268
+ logging?: next_dist_server_config_shared0.LoggingConfig | false;
269
+ expireTime?: number;
270
+ bundlePagesRouterDependencies?: boolean;
271
+ serverExternalPackages?: string[];
272
+ outputFileTracingRoot?: string;
273
+ outputFileTracingExcludes?: Record<string, string[]>;
274
+ outputFileTracingIncludes?: Record<string, string[]>;
275
+ watchOptions?: {
276
+ pollIntervalMs?: number;
277
+ };
278
+ htmlLimitedBots?: RegExp;
279
+ };
280
+ //#endregion
281
+ export { withAtomicVariants };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{ATOMIC_TAG as e}from"@atomic-variants/constants";import t from"@atomic-variants/webpack-plugin";function n(n){return{...n,webpack:(e,r)=>(e.plugins?.push(new t),typeof n.webpack==`function`?n.webpack(e,r):e),experimental:{...n.experimental,swcPlugins:[...n.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:e}]]}}}export{n as withAtomicVariants};
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@atomic-variants/next-plugin",
3
+ "version": "0.1.0",
4
+ "description": "Next.js plugin for atomic-variants to enable responsive, type-safe TailwindCSS variants at build time.",
5
+ "keywords": [
6
+ "atomic-variants",
7
+ "tailwindcss",
8
+ "nextjs",
9
+ "plugin",
10
+ "responsive",
11
+ "variants",
12
+ "type-safe"
13
+ ],
14
+ "bugs": {
15
+ "url": "https://github.com/burakgormek/atomic-variants/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/burakgormek/atomic-variants"
20
+ },
21
+ "license": "MIT",
22
+ "author": "Burak Emre Görmek <burak.gormek@gmail.com>",
23
+ "sideEffects": false,
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js",
29
+ "require": "./dist/index.cjs"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "main": "./dist/index.cjs",
34
+ "module": "./dist/index.js",
35
+ "types": "./dist/index.d.ts",
36
+ "files": [
37
+ "src",
38
+ "dist"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsdown src/index.ts",
42
+ "release": "bun publish --dry-run",
43
+ "test": "bun test"
44
+ },
45
+ "dependencies": {
46
+ "@atomic-variants/constants": "0.0.1",
47
+ "@atomic-variants/swc-plugin": "0.1.0",
48
+ "@atomic-variants/webpack-plugin": "0.1.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/bun": "latest",
52
+ "@types/jest": "^30.0.0",
53
+ "next": "^15.5.5",
54
+ "tsdown": "^0.15.7",
55
+ "typescript": "^5",
56
+ "webpack": "^5.102.1"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ }
61
+ }
package/src/index.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { ATOMIC_TAG } from "@atomic-variants/constants";
2
+ import AtomicVariantsPlugin from "@atomic-variants/webpack-plugin";
3
+ import type { NextConfig } from "next";
4
+ import type { Configuration } from "webpack";
5
+
6
+ type WebpackOptionsType = Parameters<NonNullable<NextConfig["webpack"]>>["1"];
7
+
8
+ export function withAtomicVariants(nextConfig: NextConfig) {
9
+ return {
10
+ ...nextConfig,
11
+ webpack: (webpackConfig: Configuration, options: WebpackOptionsType) => {
12
+ webpackConfig.plugins?.push(new AtomicVariantsPlugin());
13
+
14
+ if (typeof nextConfig.webpack === "function") {
15
+ return nextConfig.webpack(webpackConfig, options);
16
+ }
17
+
18
+ return webpackConfig;
19
+ },
20
+ experimental: {
21
+ ...nextConfig.experimental,
22
+ swcPlugins: [
23
+ ...(nextConfig.experimental?.swcPlugins || []),
24
+ ["@atomic-variants/swc-plugin", { tag: ATOMIC_TAG }],
25
+ ],
26
+ },
27
+ };
28
+ }