@jk2908/cxx 0.1.5-canary.2 → 0.1.5-canary.4

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.
@@ -1,14 +1,125 @@
1
- import * as next_dist_server_lib_revalidate from 'next/dist/server/lib/revalidate';
2
1
  import * as next_dist_shared_lib_image_config from 'next/dist/shared/lib/image-config';
3
2
  import * as next_dist_lib_load_custom_routes from 'next/dist/lib/load-custom-routes';
4
3
  import * as next_dist_server_config_shared from 'next/dist/server/config-shared';
5
4
  import { WebpackConfigContext } from 'next/dist/server/config-shared';
6
- import { Configuration } from 'webpack';
5
+ import * as next_dist_cli_next_test from 'next/dist/cli/next-test';
6
+ import * as next from 'next';
7
7
  import { NextConfig } from 'next';
8
+ import * as next_dist_server_lib_experimental_ppr from 'next/dist/server/lib/experimental/ppr';
9
+ import * as next_dist_shared_lib_utils from 'next/dist/shared/lib/utils';
10
+ import * as next_dist_build_webpack_plugins_subresource_integrity_plugin from 'next/dist/build/webpack/plugins/subresource-integrity-plugin';
11
+ import * as next_dist_compiled_webpack_webpack from 'next/dist/compiled/webpack/webpack';
12
+ import * as next_dist_server_lib_revalidate from 'next/dist/server/lib/revalidate';
13
+ import { Configuration } from 'webpack';
8
14
  import { Config } from '../inject/index.js';
9
15
 
10
16
  declare function withCxx(nextConfig?: NextConfig, config?: Config): {
11
- experimental: any;
17
+ experimental: {
18
+ turbo: any;
19
+ flyingShuttle?: boolean;
20
+ prerenderEarlyExit?: boolean;
21
+ linkNoTouchStart?: boolean;
22
+ caseSensitiveRoutes?: boolean;
23
+ appDocumentPreloading?: boolean;
24
+ preloadEntriesOnStart?: boolean;
25
+ strictNextHead?: boolean;
26
+ clientRouterFilter?: boolean;
27
+ clientRouterFilterRedirects?: boolean;
28
+ staleTimes?: {
29
+ dynamic?: number;
30
+ static?: number;
31
+ };
32
+ clientRouterFilterAllowedRate?: number;
33
+ externalMiddlewareRewritesResolve?: boolean;
34
+ extensionAlias?: Record<string, any>;
35
+ allowedRevalidateHeaderKeys?: string[];
36
+ fetchCacheKeyPrefix?: string;
37
+ optimisticClientCache?: boolean;
38
+ swrDelta?: next_dist_server_lib_revalidate.SwrDelta;
39
+ middlewarePrefetch?: "strict" | "flexible";
40
+ manualClientBasePath?: boolean;
41
+ cssChunking?: "strict" | "loose";
42
+ disablePostcssPresetEnv?: boolean;
43
+ cpus?: number;
44
+ memoryBasedWorkersCount?: boolean;
45
+ proxyTimeout?: number;
46
+ isrFlushToDisk?: boolean;
47
+ workerThreads?: boolean;
48
+ optimizeCss?: boolean | Record<string, unknown>;
49
+ nextScriptWorkers?: boolean;
50
+ scrollRestoration?: boolean;
51
+ externalDir?: boolean;
52
+ amp?: {
53
+ optimizer?: any;
54
+ validator?: string;
55
+ skipValidation?: boolean;
56
+ };
57
+ disableOptimizedLoading?: boolean;
58
+ gzipSize?: boolean;
59
+ craCompat?: boolean;
60
+ esmExternals?: boolean | "loose";
61
+ fullySpecified?: boolean;
62
+ urlImports?: NonNullable<next_dist_compiled_webpack_webpack.webpack.Configuration["experiments"]>["buildHttp"];
63
+ outputFileTracingRoot?: string;
64
+ outputFileTracingExcludes?: Record<string, string[]>;
65
+ outputFileTracingIgnores?: string[];
66
+ outputFileTracingIncludes?: Record<string, string[]>;
67
+ swcTraceProfiling?: boolean;
68
+ forceSwcTransforms?: boolean;
69
+ swcPlugins?: Array<[string, Record<string, unknown>]>;
70
+ largePageDataBytes?: number;
71
+ fallbackNodePolyfills?: false;
72
+ sri?: {
73
+ algorithm?: next_dist_build_webpack_plugins_subresource_integrity_plugin.SubresourceIntegrityAlgorithm;
74
+ };
75
+ adjustFontFallbacks?: boolean;
76
+ adjustFontFallbacksWithSizeAdjust?: boolean;
77
+ webVitalsAttribution?: Array<typeof next_dist_shared_lib_utils.WEB_VITALS[number]>;
78
+ optimizePackageImports?: string[];
79
+ optimizeServerReact?: boolean;
80
+ turbotrace?: {
81
+ logLevel?: "bug" | "fatal" | "error" | "warning" | "hint" | "note" | "suggestions" | "info";
82
+ logDetail?: boolean;
83
+ logAll?: boolean;
84
+ contextDirectory?: string;
85
+ processCwd?: string;
86
+ memoryLimit?: number;
87
+ };
88
+ mdxRs?: boolean | {
89
+ development?: boolean;
90
+ jsx?: boolean;
91
+ jsxRuntime?: string;
92
+ jsxImportSource?: string;
93
+ providerImportSource?: string;
94
+ mdxType?: "gfm" | "commonmark";
95
+ };
96
+ typedRoutes?: boolean;
97
+ parallelServerCompiles?: boolean;
98
+ parallelServerBuildTraces?: boolean;
99
+ webpackBuildWorker?: boolean;
100
+ webpackMemoryOptimizations?: boolean;
101
+ instrumentationHook?: boolean;
102
+ clientTraceMetadata?: string[];
103
+ ppr?: next_dist_server_lib_experimental_ppr.ExperimentalPPRConfig;
104
+ taint?: boolean;
105
+ serverActions?: {
106
+ bodySizeLimit?: next.SizeLimit;
107
+ allowedOrigins?: string[];
108
+ };
109
+ serverMinification?: boolean;
110
+ serverSourceMaps?: boolean;
111
+ staticWorkerRequestDeduping?: boolean;
112
+ useWasmBinary?: boolean;
113
+ useLightningcss?: boolean;
114
+ useEarlyImport?: boolean;
115
+ testProxy?: boolean;
116
+ defaultTestRunner?: next_dist_cli_next_test.SupportedTestRunners;
117
+ allowDevelopmentBuild?: true;
118
+ bundlePagesExternals?: boolean;
119
+ serverComponentsExternalPackages?: string[];
120
+ reactCompiler?: boolean | next_dist_server_config_shared.ReactCompilerOptions;
121
+ after?: boolean;
122
+ };
12
123
  webpack(conf: Configuration, options: WebpackConfigContext): any;
13
124
  exportPathMap?: (defaultMap: next_dist_server_config_shared.ExportPathMap, ctx: {
14
125
  dev: boolean;
@@ -9,15 +9,15 @@ const require = __node_cjsModule.createRequire(import.meta.url);
9
9
  function withCxx(nextConfig = {}, config) {
10
10
  const IS_CANARY = require('next/package.json').version?.includes('canary') ?? false;
11
11
  const CXX_LOADER = __node_cjsPath.resolve(__dirname, 'cxx-loader.js');
12
- const turbo = {
12
+ const turboConfig = {
13
13
  ...nextConfig.turbo,
14
14
  rules: {
15
15
  ...nextConfig.turbo?.rules ?? {},
16
- './app/**/*.tsx': {
16
+ './{app,pages,src/app,src/pages}/**/*.(tsx|jsx)': {
17
17
  loaders: [
18
18
  CXX_LOADER
19
19
  ],
20
- as: './tsx'
20
+ as: './{tsx,jsx}'
21
21
  }
22
22
  }
23
23
  };
@@ -26,7 +26,7 @@ function withCxx(nextConfig = {}, config) {
26
26
  webpack (conf, options) {
27
27
  const resolvedWebpackConfig = typeof nextConfig?.webpack === 'function' ? nextConfig?.webpack(conf, options) : conf;
28
28
  resolvedWebpackConfig?.module?.rules?.push({
29
- test: /\.(js|jsx|ts|tsx)$/,
29
+ test: /[\\/](pages|app|src[\\/]pages|src[\\/]app)[\\/].*\.(jsx|tsx)$/,
30
30
  exclude: /node_modules/,
31
31
  use: {
32
32
  loader: CXX_LOADER,
@@ -38,9 +38,12 @@ function withCxx(nextConfig = {}, config) {
38
38
  return resolvedWebpackConfig;
39
39
  },
40
40
  ...IS_CANARY ? {
41
- experimental: turbo
41
+ experimental: {
42
+ ...nextConfig?.experimental,
43
+ turbo: turboConfig
44
+ }
42
45
  } : {
43
- turbo
46
+ turbo: turboConfig
44
47
  }
45
48
  };
46
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jk2908/cxx",
3
- "version": "0.1.5-canary.2",
3
+ "version": "0.1.5-canary.4",
4
4
  "type": "module",
5
5
  "author": "Jerome Kenway",
6
6
  "repository": {
@@ -83,8 +83,5 @@
83
83
  "vite": {
84
84
  "optional": true
85
85
  }
86
- },
87
- "dependencies": {
88
- "@jk2908/cxx": "0.1.5-canary.1"
89
86
  }
90
87
  }
package/src/next/index.ts CHANGED
@@ -10,13 +10,13 @@ export function withCxx(nextConfig: NextConfig = {}, config?: Config) {
10
10
  const IS_CANARY = require('next/package.json').version?.includes('canary') ?? false
11
11
  const CXX_LOADER = path.resolve(__dirname, 'cxx-loader.js')
12
12
 
13
- const turbo = {
13
+ const turboConfig = {
14
14
  ...nextConfig.turbo,
15
15
  rules: {
16
16
  ...(nextConfig.turbo?.rules ?? {}),
17
- './app/**/*.tsx': {
17
+ './{app,pages,src/app,src/pages}/**/*.(tsx|jsx)': {
18
18
  loaders: [CXX_LOADER],
19
- as: './tsx',
19
+ as: './{tsx,jsx}',
20
20
  },
21
21
  },
22
22
  }
@@ -29,7 +29,7 @@ export function withCxx(nextConfig: NextConfig = {}, config?: Config) {
29
29
  ) satisfies Configuration
30
30
 
31
31
  resolvedWebpackConfig?.module?.rules?.push({
32
- test: /\.(js|jsx|ts|tsx)$/,
32
+ test: /[\\/](pages|app|src[\\/]pages|src[\\/]app)[\\/].*\.(jsx|tsx)$/,
33
33
  exclude: /node_modules/,
34
34
  use: {
35
35
  loader: CXX_LOADER,
@@ -41,6 +41,8 @@ export function withCxx(nextConfig: NextConfig = {}, config?: Config) {
41
41
 
42
42
  return resolvedWebpackConfig
43
43
  },
44
- ...(IS_CANARY ? { experimental: turbo } : { turbo }),
44
+ ...(IS_CANARY
45
+ ? { experimental: { ...nextConfig?.experimental, turbo: turboConfig } }
46
+ : { turbo: turboConfig }),
45
47
  }
46
48
  }