vinext 0.0.30 → 0.0.31
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/README.md +12 -6
- package/dist/build/prerender.d.ts +188 -0
- package/dist/build/prerender.js +675 -0
- package/dist/build/prerender.js.map +1 -0
- package/dist/build/report.d.ts +45 -46
- package/dist/build/report.js +247 -276
- package/dist/build/report.js.map +1 -1
- package/dist/build/run-prerender.d.ts +62 -0
- package/dist/build/run-prerender.js +183 -0
- package/dist/build/run-prerender.js.map +1 -0
- package/dist/build/server-manifest.d.ts +19 -0
- package/dist/build/server-manifest.js +29 -0
- package/dist/build/server-manifest.js.map +1 -0
- package/dist/build/static-export.d.ts +51 -66
- package/dist/build/static-export.js +51 -545
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.d.ts +26 -24
- package/dist/check.js +591 -571
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +1 -15
- package/dist/cli.js +430 -491
- package/dist/cli.js.map +1 -1
- package/dist/client/entry.d.ts +1 -2
- package/dist/client/entry.js +49 -62
- package/dist/client/entry.js.map +1 -1
- package/dist/client/validate-module-path.d.ts +4 -1
- package/dist/client/validate-module-path.js +23 -28
- package/dist/client/validate-module-path.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +15 -20
- package/dist/client/vinext-next-data.js +0 -1
- package/dist/cloudflare/index.d.ts +3 -8
- package/dist/cloudflare/index.js +3 -8
- package/dist/cloudflare/kv-cache-handler.d.ts +95 -105
- package/dist/cloudflare/kv-cache-handler.js +354 -380
- package/dist/cloudflare/kv-cache-handler.js.map +1 -1
- package/dist/cloudflare/tpr.d.ts +36 -34
- package/dist/cloudflare/tpr.js +460 -603
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.d.ts +31 -40
- package/dist/config/config-matchers.js +727 -936
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/dotenv.d.ts +18 -11
- package/dist/config/dotenv.js +79 -84
- package/dist/config/dotenv.js.map +1 -1
- package/dist/config/next-config.d.ts +156 -146
- package/dist/config/next-config.js +374 -464
- package/dist/config/next-config.js.map +1 -1
- package/dist/deploy.d.ts +87 -96
- package/dist/deploy.js +490 -628
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +4 -1
- package/dist/entries/app-browser-entry.js +12 -8
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +33 -20
- package/dist/entries/app-rsc-entry.js +442 -211
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-ssr-entry.d.ts +9 -1
- package/dist/entries/app-ssr-entry.js +61 -28
- package/dist/entries/app-ssr-entry.js.map +1 -1
- package/dist/entries/pages-client-entry.d.ts +6 -2
- package/dist/entries/pages-client-entry.js +30 -33
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-entry-helpers.d.ts +5 -1
- package/dist/entries/pages-entry-helpers.js +17 -14
- package/dist/entries/pages-entry-helpers.js.map +1 -1
- package/dist/entries/pages-server-entry.d.ts +6 -2
- package/dist/entries/pages-server-entry.js +84 -113
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/index.d.ts +82 -62
- package/dist/index.js +2172 -3133
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +40 -37
- package/dist/init.js +201 -258
- package/dist/init.js.map +1 -1
- package/dist/plugins/async-hooks-stub.d.ts +7 -3
- package/dist/plugins/async-hooks-stub.js +39 -42
- package/dist/plugins/async-hooks-stub.js.map +1 -1
- package/dist/plugins/client-reference-dedup.d.ts +7 -3
- package/dist/plugins/client-reference-dedup.js +63 -88
- package/dist/plugins/client-reference-dedup.js.map +1 -1
- package/dist/routing/app-router.d.ts +100 -96
- package/dist/routing/app-router.js +560 -670
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.d.ts +18 -15
- package/dist/routing/file-matcher.js +65 -65
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.d.ts +23 -24
- package/dist/routing/pages-router.js +147 -172
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-trie.d.ts +23 -20
- package/dist/routing/route-trie.js +131 -151
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/route-validation.d.ts +5 -2
- package/dist/routing/route-validation.js +98 -130
- package/dist/routing/route-validation.js.map +1 -1
- package/dist/routing/utils.d.ts +10 -7
- package/dist/routing/utils.js +75 -111
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.d.ts +8 -13
- package/dist/server/api-handler.js +161 -193
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-router-entry.d.ts +6 -16
- package/dist/server/app-router-entry.js +26 -54
- package/dist/server/app-router-entry.js.map +1 -1
- package/dist/server/dev-module-runner.d.ts +11 -64
- package/dist/server/dev-module-runner.js +89 -101
- package/dist/server/dev-module-runner.js.map +1 -1
- package/dist/server/dev-origin-check.d.ts +12 -10
- package/dist/server/dev-origin-check.js +98 -108
- package/dist/server/dev-origin-check.js.map +1 -1
- package/dist/server/dev-server.d.ts +17 -14
- package/dist/server/dev-server.js +542 -869
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/html.d.ts +4 -1
- package/dist/server/html.js +25 -26
- package/dist/server/html.js.map +1 -1
- package/dist/server/image-optimization.d.ts +31 -28
- package/dist/server/image-optimization.js +181 -210
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/instrumentation.d.ts +25 -22
- package/dist/server/instrumentation.js +110 -122
- package/dist/server/instrumentation.js.map +1 -1
- package/dist/server/isr-cache.d.ts +16 -26
- package/dist/server/isr-cache.js +106 -128
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/metadata-routes.d.ts +85 -88
- package/dist/server/metadata-routes.js +270 -317
- package/dist/server/metadata-routes.js.map +1 -1
- package/dist/server/middleware-codegen.d.ts +7 -4
- package/dist/server/middleware-codegen.js +61 -61
- package/dist/server/middleware-codegen.js.map +1 -1
- package/dist/server/middleware-request-headers.d.ts +8 -6
- package/dist/server/middleware-request-headers.js +47 -65
- package/dist/server/middleware-request-headers.js.map +1 -1
- package/dist/server/middleware.d.ts +31 -47
- package/dist/server/middleware.js +273 -404
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/normalize-path.d.ts +4 -1
- package/dist/server/normalize-path.js +33 -47
- package/dist/server/normalize-path.js.map +1 -1
- package/dist/server/pages-i18n.d.ts +38 -30
- package/dist/server/pages-i18n.js +112 -139
- package/dist/server/pages-i18n.js.map +1 -1
- package/dist/server/prod-server.d.ts +19 -31
- package/dist/server/prod-server.js +714 -945
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/request-log.d.ts +18 -12
- package/dist/server/request-log.js +45 -52
- package/dist/server/request-log.js.map +1 -1
- package/dist/server/request-pipeline.d.ts +9 -17
- package/dist/server/request-pipeline.js +133 -184
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/worker-utils.d.ts +4 -1
- package/dist/server/worker-utils.js +31 -37
- package/dist/server/worker-utils.js.map +1 -1
- package/dist/shims/amp.d.ts +5 -2
- package/dist/shims/amp.js +19 -15
- package/dist/shims/amp.js.map +1 -1
- package/dist/shims/app.d.ts +8 -10
- package/dist/shims/app.js +0 -1
- package/dist/shims/cache-runtime.d.ts +20 -45
- package/dist/shims/cache-runtime.js +271 -422
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +130 -121
- package/dist/shims/cache.js +339 -427
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/client-only.d.ts +1 -18
- package/dist/shims/client-only.js +0 -17
- package/dist/shims/compat-router.d.ts +4 -1
- package/dist/shims/compat-router.js +23 -19
- package/dist/shims/compat-router.js.map +1 -1
- package/dist/shims/config.d.ts +7 -5
- package/dist/shims/config.js +16 -23
- package/dist/shims/config.js.map +1 -1
- package/dist/shims/constants.d.ts +119 -118
- package/dist/shims/constants.js +159 -164
- package/dist/shims/constants.js.map +1 -1
- package/dist/shims/document.d.ts +20 -16
- package/dist/shims/document.js +41 -22
- package/dist/shims/document.js.map +1 -1
- package/dist/shims/dynamic.d.ts +13 -22
- package/dist/shims/dynamic.js +122 -136
- package/dist/shims/dynamic.js.map +1 -1
- package/dist/shims/error-boundary.d.ts +22 -15
- package/dist/shims/error-boundary.js +81 -79
- package/dist/shims/error-boundary.js.map +1 -1
- package/dist/shims/error.d.ts +11 -12
- package/dist/shims/error.js +35 -39
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/fetch-cache.d.ts +16 -14
- package/dist/shims/fetch-cache.js +437 -645
- package/dist/shims/fetch-cache.js.map +1 -1
- package/dist/shims/font-google-base.d.ts +28 -26
- package/dist/shims/font-google-base.js +238 -325
- package/dist/shims/font-google-base.js.map +1 -1
- package/dist/shims/font-google.d.ts +3 -3
- package/dist/shims/font-google.generated.d.ts +1928 -1924
- package/dist/shims/font-google.generated.js +1928 -2133
- package/dist/shims/font-google.generated.js.map +1 -1
- package/dist/shims/font-google.js +3 -3
- package/dist/shims/font-local.d.ts +28 -26
- package/dist/shims/font-local.js +204 -260
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/form.d.ts +13 -27
- package/dist/shims/form.js +128 -180
- package/dist/shims/form.js.map +1 -1
- package/dist/shims/head-state.d.ts +8 -13
- package/dist/shims/head-state.js +25 -42
- package/dist/shims/head-state.js.map +1 -1
- package/dist/shims/head.d.ts +16 -20
- package/dist/shims/head.js +172 -250
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +84 -78
- package/dist/shims/headers.js +447 -575
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/i18n-context.d.ts +16 -20
- package/dist/shims/i18n-context.js +35 -48
- package/dist/shims/i18n-context.js.map +1 -1
- package/dist/shims/i18n-state.d.ts +8 -14
- package/dist/shims/i18n-state.js +34 -42
- package/dist/shims/i18n-state.js.map +1 -1
- package/dist/shims/image-config.d.ts +11 -8
- package/dist/shims/image-config.js +50 -83
- package/dist/shims/image-config.js.map +1 -1
- package/dist/shims/image.d.ts +37 -46
- package/dist/shims/image.js +283 -308
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/api-utils.d.ts +7 -4
- package/dist/shims/internal/api-utils.js +0 -6
- package/dist/shims/internal/app-router-context.d.ts +22 -17
- package/dist/shims/internal/app-router-context.js +17 -13
- package/dist/shims/internal/app-router-context.js.map +1 -1
- package/dist/shims/internal/cookies.d.ts +2 -9
- package/dist/shims/internal/cookies.js +2 -9
- package/dist/shims/internal/parse-cookie-header.d.ts +4 -1
- package/dist/shims/internal/parse-cookie-header.js +29 -29
- package/dist/shims/internal/parse-cookie-header.js.map +1 -1
- package/dist/shims/internal/router-context.d.ts +6 -1
- package/dist/shims/internal/router-context.js +11 -7
- package/dist/shims/internal/router-context.js.map +1 -1
- package/dist/shims/internal/utils.d.ts +40 -37
- package/dist/shims/internal/utils.js +24 -30
- package/dist/shims/internal/utils.js.map +1 -1
- package/dist/shims/internal/work-unit-async-storage.d.ts +6 -10
- package/dist/shims/internal/work-unit-async-storage.js +14 -11
- package/dist/shims/internal/work-unit-async-storage.js.map +1 -1
- package/dist/shims/layout-segment-context.d.ts +11 -14
- package/dist/shims/layout-segment-context.js +24 -23
- package/dist/shims/layout-segment-context.js.map +1 -1
- package/dist/shims/legacy-image.d.ts +39 -46
- package/dist/shims/legacy-image.js +47 -42
- package/dist/shims/legacy-image.js.map +1 -1
- package/dist/shims/link.d.ts +32 -36
- package/dist/shims/link.js +255 -391
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +210 -202
- package/dist/shims/metadata.js +545 -546
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation-state.d.ts +10 -18
- package/dist/shims/navigation-state.js +66 -74
- package/dist/shims/navigation-state.js.map +1 -1
- package/dist/shims/navigation.d.ts +59 -63
- package/dist/shims/navigation.js +505 -704
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/og.d.ts +2 -20
- package/dist/shims/og.js +2 -19
- package/dist/shims/readonly-url-search-params.d.ts +8 -5
- package/dist/shims/readonly-url-search-params.js +26 -22
- package/dist/shims/readonly-url-search-params.js.map +1 -1
- package/dist/shims/request-context.d.ts +8 -5
- package/dist/shims/request-context.js +50 -60
- package/dist/shims/request-context.js.map +1 -1
- package/dist/shims/request-state-types.d.ts +11 -11
- package/dist/shims/request-state-types.js +0 -1
- package/dist/shims/router-state.d.ts +13 -10
- package/dist/shims/router-state.js +34 -43
- package/dist/shims/router-state.js.map +1 -1
- package/dist/shims/router.d.ts +81 -85
- package/dist/shims/router.js +506 -628
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script.d.ts +39 -48
- package/dist/shims/script.js +107 -160
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server-only.d.ts +1 -19
- package/dist/shims/server-only.js +0 -18
- package/dist/shims/server.d.ts +175 -164
- package/dist/shims/server.js +462 -478
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/unified-request-context.d.ts +20 -20
- package/dist/shims/unified-request-context.js +81 -99
- package/dist/shims/unified-request-context.js.map +1 -1
- package/dist/shims/url-safety.d.ts +4 -1
- package/dist/shims/url-safety.js +15 -11
- package/dist/shims/url-safety.js.map +1 -1
- package/dist/shims/url-utils.d.ts +8 -5
- package/dist/shims/url-utils.js +62 -93
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/shims/web-vitals.d.ts +10 -8
- package/dist/shims/web-vitals.js +9 -15
- package/dist/shims/web-vitals.js.map +1 -1
- package/dist/utils/base-path.d.ts +5 -2
- package/dist/utils/base-path.js +21 -19
- package/dist/utils/base-path.js.map +1 -1
- package/dist/utils/domain-locale.d.ts +17 -9
- package/dist/utils/domain-locale.js +36 -56
- package/dist/utils/domain-locale.js.map +1 -1
- package/dist/utils/hash.d.ts +4 -1
- package/dist/utils/hash.js +19 -17
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/manifest-paths.d.ts +6 -3
- package/dist/utils/manifest-paths.js +15 -16
- package/dist/utils/manifest-paths.js.map +1 -1
- package/dist/utils/project.d.ts +13 -11
- package/dist/utils/project.js +169 -216
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/query.d.ts +8 -6
- package/dist/utils/query.js +57 -67
- package/dist/utils/query.js.map +1 -1
- package/package.json +10 -9
- package/dist/build/report.d.ts.map +0 -1
- package/dist/build/static-export.d.ts.map +0 -1
- package/dist/check.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/entry.d.ts.map +0 -1
- package/dist/client/validate-module-path.d.ts.map +0 -1
- package/dist/client/vinext-next-data.d.ts.map +0 -1
- package/dist/client/vinext-next-data.js.map +0 -1
- package/dist/cloudflare/index.d.ts.map +0 -1
- package/dist/cloudflare/index.js.map +0 -1
- package/dist/cloudflare/kv-cache-handler.d.ts.map +0 -1
- package/dist/cloudflare/tpr.d.ts.map +0 -1
- package/dist/config/config-matchers.d.ts.map +0 -1
- package/dist/config/dotenv.d.ts.map +0 -1
- package/dist/config/next-config.d.ts.map +0 -1
- package/dist/deploy.d.ts.map +0 -1
- package/dist/entries/app-browser-entry.d.ts.map +0 -1
- package/dist/entries/app-rsc-entry.d.ts.map +0 -1
- package/dist/entries/app-ssr-entry.d.ts.map +0 -1
- package/dist/entries/pages-client-entry.d.ts.map +0 -1
- package/dist/entries/pages-entry-helpers.d.ts.map +0 -1
- package/dist/entries/pages-server-entry.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/plugins/async-hooks-stub.d.ts.map +0 -1
- package/dist/plugins/client-reference-dedup.d.ts.map +0 -1
- package/dist/routing/app-router.d.ts.map +0 -1
- package/dist/routing/file-matcher.d.ts.map +0 -1
- package/dist/routing/pages-router.d.ts.map +0 -1
- package/dist/routing/route-trie.d.ts.map +0 -1
- package/dist/routing/route-validation.d.ts.map +0 -1
- package/dist/routing/utils.d.ts.map +0 -1
- package/dist/server/api-handler.d.ts.map +0 -1
- package/dist/server/app-router-entry.d.ts.map +0 -1
- package/dist/server/dev-module-runner.d.ts.map +0 -1
- package/dist/server/dev-origin-check.d.ts.map +0 -1
- package/dist/server/dev-server.d.ts.map +0 -1
- package/dist/server/html.d.ts.map +0 -1
- package/dist/server/image-optimization.d.ts.map +0 -1
- package/dist/server/instrumentation.d.ts.map +0 -1
- package/dist/server/isr-cache.d.ts.map +0 -1
- package/dist/server/metadata-routes.d.ts.map +0 -1
- package/dist/server/middleware-codegen.d.ts.map +0 -1
- package/dist/server/middleware-request-headers.d.ts.map +0 -1
- package/dist/server/middleware.d.ts.map +0 -1
- package/dist/server/normalize-path.d.ts.map +0 -1
- package/dist/server/pages-i18n.d.ts.map +0 -1
- package/dist/server/prod-server.d.ts.map +0 -1
- package/dist/server/request-log.d.ts.map +0 -1
- package/dist/server/request-pipeline.d.ts.map +0 -1
- package/dist/server/worker-utils.d.ts.map +0 -1
- package/dist/shims/amp.d.ts.map +0 -1
- package/dist/shims/app.d.ts.map +0 -1
- package/dist/shims/app.js.map +0 -1
- package/dist/shims/cache-runtime.d.ts.map +0 -1
- package/dist/shims/cache.d.ts.map +0 -1
- package/dist/shims/client-only.d.ts.map +0 -1
- package/dist/shims/client-only.js.map +0 -1
- package/dist/shims/compat-router.d.ts.map +0 -1
- package/dist/shims/config.d.ts.map +0 -1
- package/dist/shims/constants.d.ts.map +0 -1
- package/dist/shims/document.d.ts.map +0 -1
- package/dist/shims/dynamic.d.ts.map +0 -1
- package/dist/shims/error-boundary.d.ts.map +0 -1
- package/dist/shims/error.d.ts.map +0 -1
- package/dist/shims/fetch-cache.d.ts.map +0 -1
- package/dist/shims/font-google-base.d.ts.map +0 -1
- package/dist/shims/font-google.d.ts.map +0 -1
- package/dist/shims/font-google.generated.d.ts.map +0 -1
- package/dist/shims/font-google.js.map +0 -1
- package/dist/shims/font-local.d.ts.map +0 -1
- package/dist/shims/form.d.ts.map +0 -1
- package/dist/shims/head-state.d.ts.map +0 -1
- package/dist/shims/head.d.ts.map +0 -1
- package/dist/shims/headers.d.ts.map +0 -1
- package/dist/shims/i18n-context.d.ts.map +0 -1
- package/dist/shims/i18n-state.d.ts.map +0 -1
- package/dist/shims/image-config.d.ts.map +0 -1
- package/dist/shims/image.d.ts.map +0 -1
- package/dist/shims/internal/api-utils.d.ts.map +0 -1
- package/dist/shims/internal/api-utils.js.map +0 -1
- package/dist/shims/internal/app-router-context.d.ts.map +0 -1
- package/dist/shims/internal/cookies.d.ts.map +0 -1
- package/dist/shims/internal/cookies.js.map +0 -1
- package/dist/shims/internal/parse-cookie-header.d.ts.map +0 -1
- package/dist/shims/internal/router-context.d.ts.map +0 -1
- package/dist/shims/internal/utils.d.ts.map +0 -1
- package/dist/shims/internal/work-unit-async-storage.d.ts.map +0 -1
- package/dist/shims/layout-segment-context.d.ts.map +0 -1
- package/dist/shims/legacy-image.d.ts.map +0 -1
- package/dist/shims/link.d.ts.map +0 -1
- package/dist/shims/metadata.d.ts.map +0 -1
- package/dist/shims/navigation-state.d.ts.map +0 -1
- package/dist/shims/navigation.d.ts.map +0 -1
- package/dist/shims/og.d.ts.map +0 -1
- package/dist/shims/og.js.map +0 -1
- package/dist/shims/readonly-url-search-params.d.ts.map +0 -1
- package/dist/shims/request-context.d.ts.map +0 -1
- package/dist/shims/request-state-types.d.ts.map +0 -1
- package/dist/shims/request-state-types.js.map +0 -1
- package/dist/shims/router-state.d.ts.map +0 -1
- package/dist/shims/router.d.ts.map +0 -1
- package/dist/shims/script.d.ts.map +0 -1
- package/dist/shims/server-only.d.ts.map +0 -1
- package/dist/shims/server-only.js.map +0 -1
- package/dist/shims/server.d.ts.map +0 -1
- package/dist/shims/unified-request-context.d.ts.map +0 -1
- package/dist/shims/url-safety.d.ts.map +0 -1
- package/dist/shims/url-utils.d.ts.map +0 -1
- package/dist/shims/web-vitals.d.ts.map +0 -1
- package/dist/utils/base-path.d.ts.map +0 -1
- package/dist/utils/domain-locale.d.ts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/manifest-paths.d.ts.map +0 -1
- package/dist/utils/project.d.ts.map +0 -1
- package/dist/utils/query.d.ts.map +0 -1
package/dist/check.js
CHANGED
|
@@ -1,595 +1,615 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vinext check — compatibility scanner for Next.js apps
|
|
3
|
-
*
|
|
4
|
-
* Scans an existing Next.js app and produces a compatibility report
|
|
5
|
-
* showing what will work, what needs changes, and an overall score.
|
|
6
|
-
*/
|
|
7
1
|
import { detectPackageManager } from "./utils/project.js";
|
|
8
2
|
import fs from "node:fs";
|
|
9
3
|
import path from "node:path";
|
|
10
|
-
|
|
4
|
+
//#region src/check.ts
|
|
5
|
+
/**
|
|
6
|
+
* vinext check — compatibility scanner for Next.js apps
|
|
7
|
+
*
|
|
8
|
+
* Scans an existing Next.js app and produces a compatibility report
|
|
9
|
+
* showing what will work, what needs changes, and an overall score.
|
|
10
|
+
*/
|
|
11
11
|
const IMPORT_SUPPORT = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
next: {
|
|
13
|
+
status: "supported",
|
|
14
|
+
detail: "type-only exports (Metadata, NextPage, etc.)"
|
|
15
|
+
},
|
|
16
|
+
"next/link": { status: "supported" },
|
|
17
|
+
"next/image": {
|
|
18
|
+
status: "supported",
|
|
19
|
+
detail: "uses @unpic/react (no local optimization yet)"
|
|
20
|
+
},
|
|
21
|
+
"next/router": { status: "supported" },
|
|
22
|
+
"next/navigation": { status: "supported" },
|
|
23
|
+
"next/headers": { status: "supported" },
|
|
24
|
+
"next/server": {
|
|
25
|
+
status: "supported",
|
|
26
|
+
detail: "NextRequest/NextResponse shimmed"
|
|
27
|
+
},
|
|
28
|
+
"next/cache": {
|
|
29
|
+
status: "supported",
|
|
30
|
+
detail: "revalidateTag, revalidatePath, unstable_cache, cacheLife, cacheTag"
|
|
31
|
+
},
|
|
32
|
+
"next/dynamic": { status: "supported" },
|
|
33
|
+
"next/head": { status: "supported" },
|
|
34
|
+
"next/script": { status: "supported" },
|
|
35
|
+
"next/font/google": {
|
|
36
|
+
status: "partial",
|
|
37
|
+
detail: "fonts loaded from CDN, not self-hosted at build time"
|
|
38
|
+
},
|
|
39
|
+
"next/font/local": {
|
|
40
|
+
status: "supported",
|
|
41
|
+
detail: "className and variable modes both work; no build-time subsetting"
|
|
42
|
+
},
|
|
43
|
+
"next/og": {
|
|
44
|
+
status: "supported",
|
|
45
|
+
detail: "ImageResponse via @vercel/og"
|
|
46
|
+
},
|
|
47
|
+
"next/config": { status: "supported" },
|
|
48
|
+
"next/amp": {
|
|
49
|
+
status: "unsupported",
|
|
50
|
+
detail: "AMP is not supported"
|
|
51
|
+
},
|
|
52
|
+
"next/document": {
|
|
53
|
+
status: "supported",
|
|
54
|
+
detail: "custom _document.tsx"
|
|
55
|
+
},
|
|
56
|
+
"next/app": {
|
|
57
|
+
status: "supported",
|
|
58
|
+
detail: "custom _app.tsx"
|
|
59
|
+
},
|
|
60
|
+
"next/error": { status: "supported" },
|
|
61
|
+
"next/third-parties/google": {
|
|
62
|
+
status: "unsupported",
|
|
63
|
+
detail: "third-party script optimization not implemented"
|
|
64
|
+
},
|
|
65
|
+
"server-only": { status: "supported" },
|
|
66
|
+
"client-only": { status: "supported" }
|
|
46
67
|
};
|
|
47
|
-
// ── Config support map ─────────────────────────────────────────────────────
|
|
48
68
|
const CONFIG_SUPPORT = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
basePath: { status: "supported" },
|
|
70
|
+
trailingSlash: { status: "supported" },
|
|
71
|
+
redirects: { status: "supported" },
|
|
72
|
+
rewrites: { status: "supported" },
|
|
73
|
+
headers: { status: "supported" },
|
|
74
|
+
i18n: {
|
|
75
|
+
status: "supported",
|
|
76
|
+
detail: "path-prefix routing; domain routing for Pages Router"
|
|
77
|
+
},
|
|
78
|
+
env: { status: "supported" },
|
|
79
|
+
images: {
|
|
80
|
+
status: "partial",
|
|
81
|
+
detail: "remotePatterns validated, no local optimization"
|
|
82
|
+
},
|
|
83
|
+
allowedDevOrigins: {
|
|
84
|
+
status: "supported",
|
|
85
|
+
detail: "dev server cross-origin allowlist"
|
|
86
|
+
},
|
|
87
|
+
output: {
|
|
88
|
+
status: "supported",
|
|
89
|
+
detail: "'export' and 'standalone' modes"
|
|
90
|
+
},
|
|
91
|
+
transpilePackages: {
|
|
92
|
+
status: "supported",
|
|
93
|
+
detail: "Vite handles this natively"
|
|
94
|
+
},
|
|
95
|
+
webpack: {
|
|
96
|
+
status: "unsupported",
|
|
97
|
+
detail: "Vite replaces webpack — custom webpack configs need migration"
|
|
98
|
+
},
|
|
99
|
+
"experimental.ppr": {
|
|
100
|
+
status: "unsupported",
|
|
101
|
+
detail: "partial prerendering not yet implemented"
|
|
102
|
+
},
|
|
103
|
+
"experimental.typedRoutes": {
|
|
104
|
+
status: "unsupported",
|
|
105
|
+
detail: "typed routes not implemented"
|
|
106
|
+
},
|
|
107
|
+
"experimental.serverActions": {
|
|
108
|
+
status: "supported",
|
|
109
|
+
detail: "server actions via 'use server' directive"
|
|
110
|
+
},
|
|
111
|
+
"i18n.domains": {
|
|
112
|
+
status: "partial",
|
|
113
|
+
detail: "supported for Pages Router; App Router unchanged"
|
|
114
|
+
},
|
|
115
|
+
reactStrictMode: {
|
|
116
|
+
status: "supported",
|
|
117
|
+
detail: "always enabled"
|
|
118
|
+
},
|
|
119
|
+
poweredByHeader: {
|
|
120
|
+
status: "supported",
|
|
121
|
+
detail: "not sent (matching Next.js default when disabled)"
|
|
122
|
+
}
|
|
79
123
|
};
|
|
80
|
-
// ── Library support map ────────────────────────────────────────────────────
|
|
81
124
|
const LIBRARY_SUPPORT = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
"next-themes": { status: "supported" },
|
|
126
|
+
nuqs: { status: "supported" },
|
|
127
|
+
"next-view-transitions": { status: "supported" },
|
|
128
|
+
"@vercel/analytics": {
|
|
129
|
+
status: "supported",
|
|
130
|
+
detail: "analytics script injected client-side"
|
|
131
|
+
},
|
|
132
|
+
"next-intl": {
|
|
133
|
+
status: "supported",
|
|
134
|
+
detail: "auto-detected from i18n/request.{ts,tsx,js,jsx}; createNextIntlPlugin wrapper not needed"
|
|
135
|
+
},
|
|
136
|
+
"@clerk/nextjs": {
|
|
137
|
+
status: "unsupported",
|
|
138
|
+
detail: "deep Next.js middleware integration not compatible"
|
|
139
|
+
},
|
|
140
|
+
"@auth/nextjs": {
|
|
141
|
+
status: "unsupported",
|
|
142
|
+
detail: "relies on Next.js internal auth handlers; consider migrating to better-auth"
|
|
143
|
+
},
|
|
144
|
+
"next-auth": {
|
|
145
|
+
status: "unsupported",
|
|
146
|
+
detail: "relies on Next.js API route internals; consider migrating to better-auth (see https://authjs.dev/getting-started/migrate-to-better-auth)"
|
|
147
|
+
},
|
|
148
|
+
"better-auth": {
|
|
149
|
+
status: "supported",
|
|
150
|
+
detail: "uses only public next/* APIs (headers, cookies, NextRequest/NextResponse)"
|
|
151
|
+
},
|
|
152
|
+
"@sentry/nextjs": {
|
|
153
|
+
status: "partial",
|
|
154
|
+
detail: "client-side works, server integration needs manual setup"
|
|
155
|
+
},
|
|
156
|
+
"@t3-oss/env-nextjs": { status: "supported" },
|
|
157
|
+
tailwindcss: { status: "supported" },
|
|
158
|
+
"styled-components": {
|
|
159
|
+
status: "supported",
|
|
160
|
+
detail: "SSR via useServerInsertedHTML"
|
|
161
|
+
},
|
|
162
|
+
"@emotion/react": {
|
|
163
|
+
status: "supported",
|
|
164
|
+
detail: "SSR via useServerInsertedHTML"
|
|
165
|
+
},
|
|
166
|
+
"lucide-react": { status: "supported" },
|
|
167
|
+
"framer-motion": { status: "supported" },
|
|
168
|
+
"@radix-ui/react-dialog": { status: "supported" },
|
|
169
|
+
"shadcn-ui": { status: "supported" },
|
|
170
|
+
zod: { status: "supported" },
|
|
171
|
+
"react-hook-form": { status: "supported" },
|
|
172
|
+
prisma: {
|
|
173
|
+
status: "supported",
|
|
174
|
+
detail: "works on Cloudflare Workers with Prisma Accelerate"
|
|
175
|
+
},
|
|
176
|
+
drizzle: {
|
|
177
|
+
status: "supported",
|
|
178
|
+
detail: "works with D1 on Cloudflare Workers"
|
|
179
|
+
}
|
|
122
180
|
};
|
|
123
|
-
// ── Scanning functions ─────────────────────────────────────────────────────
|
|
124
181
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
function findSourceFiles(dir, extensions = [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
return results;
|
|
182
|
+
* Recursively find all source files in a directory.
|
|
183
|
+
*/
|
|
184
|
+
function findSourceFiles(dir, extensions = [
|
|
185
|
+
".ts",
|
|
186
|
+
".tsx",
|
|
187
|
+
".js",
|
|
188
|
+
".jsx",
|
|
189
|
+
".mjs"
|
|
190
|
+
]) {
|
|
191
|
+
const results = [];
|
|
192
|
+
if (!fs.existsSync(dir)) return results;
|
|
193
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
194
|
+
for (const entry of entries) {
|
|
195
|
+
const fullPath = path.join(dir, entry.name);
|
|
196
|
+
if (entry.isDirectory()) {
|
|
197
|
+
if (entry.name === "node_modules" || entry.name === ".next" || entry.name === "dist" || entry.name === ".git") continue;
|
|
198
|
+
results.push(...findSourceFiles(fullPath, extensions));
|
|
199
|
+
} else if (extensions.some((ext) => entry.name.endsWith(ext))) results.push(fullPath);
|
|
200
|
+
}
|
|
201
|
+
return results;
|
|
147
202
|
}
|
|
148
203
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
status: "unsupported",
|
|
199
|
-
detail: "not recognized by vinext",
|
|
200
|
-
files: usedFiles,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
// Sort: unsupported first, then partial, then supported
|
|
205
|
-
items.sort((a, b) => {
|
|
206
|
-
const order = { unsupported: 0, partial: 1, supported: 2 };
|
|
207
|
-
return order[a.status] - order[b.status];
|
|
208
|
-
});
|
|
209
|
-
return items;
|
|
204
|
+
* Scan source files for `import ... from 'next/...'` statements.
|
|
205
|
+
*/
|
|
206
|
+
function scanImports(root) {
|
|
207
|
+
const files = findSourceFiles(root);
|
|
208
|
+
const importUsage = /* @__PURE__ */ new Map();
|
|
209
|
+
const importRegex = /(?:import\s+(?:[\w{},\s*]+\s+from\s+)?|require\s*\()['"]([^'"]+)['"]\)?/g;
|
|
210
|
+
const typeOnlyImportRegex = /import\s+type\s+/;
|
|
211
|
+
for (const file of files) {
|
|
212
|
+
const content = fs.readFileSync(file, "utf-8");
|
|
213
|
+
let match;
|
|
214
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
215
|
+
const mod = match[1];
|
|
216
|
+
const lineStart = content.lastIndexOf("\n", match.index) + 1;
|
|
217
|
+
const line = content.slice(lineStart, match.index + match[0].length);
|
|
218
|
+
if (typeOnlyImportRegex.test(line)) continue;
|
|
219
|
+
if (mod.startsWith("next/") || mod === "next" || mod === "server-only" || mod === "client-only") {
|
|
220
|
+
const normalized = mod === "next" ? "next" : mod;
|
|
221
|
+
if (!importUsage.has(normalized)) importUsage.set(normalized, []);
|
|
222
|
+
const relFile = path.relative(root, file);
|
|
223
|
+
const usedInFiles = importUsage.get(normalized) ?? [];
|
|
224
|
+
if (!usedInFiles.includes(relFile)) usedInFiles.push(relFile);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const items = [];
|
|
229
|
+
for (const [mod, usedFiles] of importUsage) {
|
|
230
|
+
const support = IMPORT_SUPPORT[mod.startsWith("next/") && mod.endsWith(".js") ? mod.replace(/\.js$/, "") : mod];
|
|
231
|
+
if (support) items.push({
|
|
232
|
+
name: mod,
|
|
233
|
+
status: support.status,
|
|
234
|
+
detail: support.detail,
|
|
235
|
+
files: usedFiles
|
|
236
|
+
});
|
|
237
|
+
else items.push({
|
|
238
|
+
name: mod,
|
|
239
|
+
status: "unsupported",
|
|
240
|
+
detail: "not recognized by vinext",
|
|
241
|
+
files: usedFiles
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
items.sort((a, b) => {
|
|
245
|
+
const order = {
|
|
246
|
+
unsupported: 0,
|
|
247
|
+
partial: 1,
|
|
248
|
+
supported: 2
|
|
249
|
+
};
|
|
250
|
+
return order[a.status] - order[b.status];
|
|
251
|
+
});
|
|
252
|
+
return items;
|
|
210
253
|
}
|
|
211
254
|
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
});
|
|
292
|
-
return items;
|
|
255
|
+
* Analyze next.config.js/mjs/ts for supported and unsupported options.
|
|
256
|
+
*/
|
|
257
|
+
function analyzeConfig(root) {
|
|
258
|
+
const configFiles = [
|
|
259
|
+
"next.config.ts",
|
|
260
|
+
"next.config.mjs",
|
|
261
|
+
"next.config.js",
|
|
262
|
+
"next.config.cjs"
|
|
263
|
+
];
|
|
264
|
+
let configPath = null;
|
|
265
|
+
for (const f of configFiles) {
|
|
266
|
+
const p = path.join(root, f);
|
|
267
|
+
if (fs.existsSync(p)) {
|
|
268
|
+
configPath = p;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (!configPath) return [{
|
|
273
|
+
name: "next.config",
|
|
274
|
+
status: "supported",
|
|
275
|
+
detail: "no config file found (defaults are fine)"
|
|
276
|
+
}];
|
|
277
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
278
|
+
const items = [];
|
|
279
|
+
for (const opt of [
|
|
280
|
+
"basePath",
|
|
281
|
+
"trailingSlash",
|
|
282
|
+
"redirects",
|
|
283
|
+
"rewrites",
|
|
284
|
+
"headers",
|
|
285
|
+
"i18n",
|
|
286
|
+
"env",
|
|
287
|
+
"images",
|
|
288
|
+
"allowedDevOrigins",
|
|
289
|
+
"output",
|
|
290
|
+
"transpilePackages",
|
|
291
|
+
"webpack",
|
|
292
|
+
"reactStrictMode",
|
|
293
|
+
"poweredByHeader"
|
|
294
|
+
]) if (new RegExp(`\\b${opt}\\b`).test(content)) {
|
|
295
|
+
const support = CONFIG_SUPPORT[opt];
|
|
296
|
+
if (support) items.push({
|
|
297
|
+
name: opt,
|
|
298
|
+
status: support.status,
|
|
299
|
+
detail: support.detail
|
|
300
|
+
});
|
|
301
|
+
else items.push({
|
|
302
|
+
name: opt,
|
|
303
|
+
status: "unsupported",
|
|
304
|
+
detail: "not recognized"
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (/experimental\s*[:=]\s*\{/.test(content)) {
|
|
308
|
+
if (/\bppr\b/.test(content)) items.push({
|
|
309
|
+
name: "experimental.ppr",
|
|
310
|
+
...CONFIG_SUPPORT["experimental.ppr"]
|
|
311
|
+
});
|
|
312
|
+
if (/\btypedRoutes\b/.test(content)) items.push({
|
|
313
|
+
name: "experimental.typedRoutes",
|
|
314
|
+
...CONFIG_SUPPORT["experimental.typedRoutes"]
|
|
315
|
+
});
|
|
316
|
+
if (/\bserverActions\b/.test(content)) items.push({
|
|
317
|
+
name: "experimental.serverActions",
|
|
318
|
+
...CONFIG_SUPPORT["experimental.serverActions"]
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
if (/domains\s*:/.test(content) && /i18n/.test(content)) items.push({
|
|
322
|
+
name: "i18n.domains",
|
|
323
|
+
...CONFIG_SUPPORT["i18n.domains"]
|
|
324
|
+
});
|
|
325
|
+
items.sort((a, b) => {
|
|
326
|
+
const order = {
|
|
327
|
+
unsupported: 0,
|
|
328
|
+
partial: 1,
|
|
329
|
+
supported: 2
|
|
330
|
+
};
|
|
331
|
+
return order[a.status] - order[b.status];
|
|
332
|
+
});
|
|
333
|
+
return items;
|
|
293
334
|
}
|
|
294
335
|
/**
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
336
|
+
* Check package.json dependencies for known libraries.
|
|
337
|
+
*/
|
|
338
|
+
function checkLibraries(root) {
|
|
339
|
+
const pkgPath = path.join(root, "package.json");
|
|
340
|
+
if (!fs.existsSync(pkgPath)) return [];
|
|
341
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
342
|
+
const allDeps = {
|
|
343
|
+
...pkg.dependencies,
|
|
344
|
+
...pkg.devDependencies
|
|
345
|
+
};
|
|
346
|
+
const items = [];
|
|
347
|
+
for (const [lib, support] of Object.entries(LIBRARY_SUPPORT)) if (allDeps[lib]) items.push({
|
|
348
|
+
name: lib,
|
|
349
|
+
status: support.status,
|
|
350
|
+
detail: support.detail
|
|
351
|
+
});
|
|
352
|
+
items.sort((a, b) => {
|
|
353
|
+
const order = {
|
|
354
|
+
unsupported: 0,
|
|
355
|
+
partial: 1,
|
|
356
|
+
supported: 2
|
|
357
|
+
};
|
|
358
|
+
return order[a.status] - order[b.status];
|
|
359
|
+
});
|
|
360
|
+
return items;
|
|
319
361
|
}
|
|
320
362
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
// Check it's not require() or import() form — just bare string literals in the array
|
|
451
|
-
const pluginsBlock = match[0];
|
|
452
|
-
// If plugins array contains string literals not wrapped in require()
|
|
453
|
-
if (/plugins\s*:\s*\[[\s\n]*['"]/.test(pluginsBlock)) {
|
|
454
|
-
items.push({
|
|
455
|
-
name: `PostCSS string-form plugins (${configFile})`,
|
|
456
|
-
status: "partial",
|
|
457
|
-
detail: "string-form PostCSS plugins need resolution — vinext handles this automatically",
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
break; // Only check the first config file found
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return items;
|
|
363
|
+
* Check file conventions (pages, app directory, middleware, etc.)
|
|
364
|
+
*/
|
|
365
|
+
function checkConventions(root) {
|
|
366
|
+
const items = [];
|
|
367
|
+
const pagesDir = fs.existsSync(path.join(root, "pages")) ? path.join(root, "pages") : fs.existsSync(path.join(root, "src", "pages")) ? path.join(root, "src", "pages") : null;
|
|
368
|
+
const appDirPath = fs.existsSync(path.join(root, "app")) ? path.join(root, "app") : fs.existsSync(path.join(root, "src", "app")) ? path.join(root, "src", "app") : null;
|
|
369
|
+
const hasPages = pagesDir !== null;
|
|
370
|
+
const hasApp = appDirPath !== null;
|
|
371
|
+
const hasProxy = fs.existsSync(path.join(root, "proxy.ts")) || fs.existsSync(path.join(root, "proxy.js"));
|
|
372
|
+
const hasMiddleware = fs.existsSync(path.join(root, "middleware.ts")) || fs.existsSync(path.join(root, "middleware.js"));
|
|
373
|
+
if (pagesDir !== null) {
|
|
374
|
+
const isSrc = pagesDir.includes(path.join("src", "pages"));
|
|
375
|
+
items.push({
|
|
376
|
+
name: isSrc ? "Pages Router (src/pages/)" : "Pages Router (pages/)",
|
|
377
|
+
status: "supported"
|
|
378
|
+
});
|
|
379
|
+
const pageFiles = findSourceFiles(pagesDir);
|
|
380
|
+
const pages = pageFiles.filter((f) => !f.includes("/api/") && !f.includes("_app") && !f.includes("_document") && !f.includes("_error"));
|
|
381
|
+
const apiRoutes = pageFiles.filter((f) => f.includes("/api/"));
|
|
382
|
+
items.push({
|
|
383
|
+
name: `${pages.length} page(s)`,
|
|
384
|
+
status: "supported"
|
|
385
|
+
});
|
|
386
|
+
if (apiRoutes.length) items.push({
|
|
387
|
+
name: `${apiRoutes.length} API route(s)`,
|
|
388
|
+
status: "supported"
|
|
389
|
+
});
|
|
390
|
+
if (pageFiles.some((f) => f.includes("_app"))) items.push({
|
|
391
|
+
name: "Custom _app",
|
|
392
|
+
status: "supported"
|
|
393
|
+
});
|
|
394
|
+
if (pageFiles.some((f) => f.includes("_document"))) items.push({
|
|
395
|
+
name: "Custom _document",
|
|
396
|
+
status: "supported"
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
if (appDirPath !== null) {
|
|
400
|
+
const isSrc = appDirPath.includes(path.join("src", "app"));
|
|
401
|
+
items.push({
|
|
402
|
+
name: isSrc ? "App Router (src/app/)" : "App Router (app/)",
|
|
403
|
+
status: "supported"
|
|
404
|
+
});
|
|
405
|
+
const appFiles = findSourceFiles(appDirPath);
|
|
406
|
+
const pages = appFiles.filter((f) => f.endsWith("page.tsx") || f.endsWith("page.jsx") || f.endsWith("page.ts") || f.endsWith("page.js"));
|
|
407
|
+
const layouts = appFiles.filter((f) => f.endsWith("layout.tsx") || f.endsWith("layout.jsx") || f.endsWith("layout.ts") || f.endsWith("layout.js"));
|
|
408
|
+
const routes = appFiles.filter((f) => f.endsWith("route.tsx") || f.endsWith("route.ts") || f.endsWith("route.js"));
|
|
409
|
+
const loadings = appFiles.filter((f) => f.endsWith("loading.tsx") || f.endsWith("loading.jsx"));
|
|
410
|
+
const errors = appFiles.filter((f) => f.endsWith("error.tsx") || f.endsWith("error.jsx"));
|
|
411
|
+
const notFounds = appFiles.filter((f) => f.endsWith("not-found.tsx") || f.endsWith("not-found.jsx"));
|
|
412
|
+
items.push({
|
|
413
|
+
name: `${pages.length} page(s)`,
|
|
414
|
+
status: "supported"
|
|
415
|
+
});
|
|
416
|
+
if (layouts.length) items.push({
|
|
417
|
+
name: `${layouts.length} layout(s)`,
|
|
418
|
+
status: "supported"
|
|
419
|
+
});
|
|
420
|
+
if (routes.length) items.push({
|
|
421
|
+
name: `${routes.length} route handler(s)`,
|
|
422
|
+
status: "supported"
|
|
423
|
+
});
|
|
424
|
+
if (loadings.length) items.push({
|
|
425
|
+
name: `${loadings.length} loading boundary(ies)`,
|
|
426
|
+
status: "supported"
|
|
427
|
+
});
|
|
428
|
+
if (errors.length) items.push({
|
|
429
|
+
name: `${errors.length} error boundary(ies)`,
|
|
430
|
+
status: "supported"
|
|
431
|
+
});
|
|
432
|
+
if (notFounds.length) items.push({
|
|
433
|
+
name: `${notFounds.length} not-found page(s)`,
|
|
434
|
+
status: "supported"
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
if (hasProxy) items.push({
|
|
438
|
+
name: "proxy.ts (Next.js 16)",
|
|
439
|
+
status: "supported"
|
|
440
|
+
});
|
|
441
|
+
else if (hasMiddleware) items.push({
|
|
442
|
+
name: "middleware.ts (deprecated in Next.js 16)",
|
|
443
|
+
status: "supported"
|
|
444
|
+
});
|
|
445
|
+
if (!hasPages && !hasApp) items.push({
|
|
446
|
+
name: "No pages/ or app/ directory found",
|
|
447
|
+
status: "unsupported",
|
|
448
|
+
detail: "vinext requires a pages/ or app/ directory"
|
|
449
|
+
});
|
|
450
|
+
const pkgPath = path.join(root, "package.json");
|
|
451
|
+
if (fs.existsSync(pkgPath)) {
|
|
452
|
+
if (JSON.parse(fs.readFileSync(pkgPath, "utf-8")).type !== "module") items.push({
|
|
453
|
+
name: "Missing \"type\": \"module\" in package.json",
|
|
454
|
+
status: "unsupported",
|
|
455
|
+
detail: "required for Vite — vinext init will add it automatically"
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
const allSourceFiles = findSourceFiles(root);
|
|
459
|
+
const viewTransitionRegex = /import\s+\{[^}]*\bViewTransition\b[^}]*\}\s+from\s+['"]react['"]/;
|
|
460
|
+
const viewTransitionFiles = [];
|
|
461
|
+
for (const file of allSourceFiles) {
|
|
462
|
+
const content = fs.readFileSync(file, "utf-8");
|
|
463
|
+
if (viewTransitionRegex.test(content)) viewTransitionFiles.push(path.relative(root, file));
|
|
464
|
+
}
|
|
465
|
+
if (viewTransitionFiles.length > 0) items.push({
|
|
466
|
+
name: "ViewTransition (React canary API)",
|
|
467
|
+
status: "partial",
|
|
468
|
+
detail: "vinext auto-shims with a passthrough fallback, view transitions won't animate",
|
|
469
|
+
files: viewTransitionFiles
|
|
470
|
+
});
|
|
471
|
+
for (const configFile of [
|
|
472
|
+
"postcss.config.mjs",
|
|
473
|
+
"postcss.config.js",
|
|
474
|
+
"postcss.config.cjs"
|
|
475
|
+
]) {
|
|
476
|
+
const configPath = path.join(root, configFile);
|
|
477
|
+
if (fs.existsSync(configPath)) {
|
|
478
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
479
|
+
const match = /plugins\s*:\s*\[[\s\S]*?(['"][^'"]+['"])[\s\S]*?\]/.exec(content);
|
|
480
|
+
if (match) {
|
|
481
|
+
const pluginsBlock = match[0];
|
|
482
|
+
if (/plugins\s*:\s*\[[\s\n]*['"]/.test(pluginsBlock)) items.push({
|
|
483
|
+
name: `PostCSS string-form plugins (${configFile})`,
|
|
484
|
+
status: "partial",
|
|
485
|
+
detail: "string-form PostCSS plugins need resolution — vinext handles this automatically"
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return items;
|
|
465
492
|
}
|
|
466
493
|
/**
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
494
|
+
* Run the full compatibility check.
|
|
495
|
+
*/
|
|
496
|
+
function runCheck(root) {
|
|
497
|
+
const imports = scanImports(root);
|
|
498
|
+
const config = analyzeConfig(root);
|
|
499
|
+
const libraries = checkLibraries(root);
|
|
500
|
+
const conventions = checkConventions(root);
|
|
501
|
+
const allItems = [
|
|
502
|
+
...imports,
|
|
503
|
+
...config,
|
|
504
|
+
...libraries,
|
|
505
|
+
...conventions
|
|
506
|
+
];
|
|
507
|
+
const supported = allItems.filter((i) => i.status === "supported").length;
|
|
508
|
+
const partial = allItems.filter((i) => i.status === "partial").length;
|
|
509
|
+
const unsupported = allItems.filter((i) => i.status === "unsupported").length;
|
|
510
|
+
const total = allItems.length;
|
|
511
|
+
return {
|
|
512
|
+
imports,
|
|
513
|
+
config,
|
|
514
|
+
libraries,
|
|
515
|
+
conventions,
|
|
516
|
+
summary: {
|
|
517
|
+
supported,
|
|
518
|
+
partial,
|
|
519
|
+
unsupported,
|
|
520
|
+
total,
|
|
521
|
+
score: total > 0 ? Math.round((supported + partial * .5) / total * 100) : 100
|
|
522
|
+
}
|
|
523
|
+
};
|
|
488
524
|
}
|
|
489
525
|
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
if (item.status === "partial") {
|
|
576
|
-
lines.push(` \x1b[33m~\x1b[0m ${item.name}${item.detail ? ` — ${item.detail}` : ""}`);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
// Actionable next steps (skip when called from init — it prints its own summary)
|
|
581
|
-
if (!opts?.calledFromInit) {
|
|
582
|
-
lines.push("");
|
|
583
|
-
lines.push(" \x1b[1mRecommended next steps:\x1b[0m");
|
|
584
|
-
lines.push(` Run \x1b[36mvinext init\x1b[0m to set up your project automatically`);
|
|
585
|
-
lines.push("");
|
|
586
|
-
lines.push(" Or manually:");
|
|
587
|
-
lines.push(` 1. Add \x1b[36m"type": "module"\x1b[0m to package.json`);
|
|
588
|
-
lines.push(` 2. Install: \x1b[36m${detectPackageManager(process.cwd())} vinext vite @vitejs/plugin-rsc\x1b[0m`);
|
|
589
|
-
lines.push(` 3. Create vite.config.ts (see docs)`);
|
|
590
|
-
lines.push(` 4. Run: \x1b[36mnpx vite dev\x1b[0m`);
|
|
591
|
-
}
|
|
592
|
-
lines.push("");
|
|
593
|
-
return lines.join("\n");
|
|
526
|
+
* Format the check result as a colored terminal report.
|
|
527
|
+
*/
|
|
528
|
+
function formatReport(result, opts) {
|
|
529
|
+
const lines = [];
|
|
530
|
+
const hasAppRouter = result.conventions.some((item) => item.name === "App Router (app/)" || item.name === "App Router (src/app/)");
|
|
531
|
+
const statusIcon = (s) => s === "supported" ? "\x1B[32m✓\x1B[0m" : s === "partial" ? "\x1B[33m~\x1B[0m" : "\x1B[31m✗\x1B[0m";
|
|
532
|
+
lines.push("");
|
|
533
|
+
lines.push(" \x1B[1mvinext compatibility report\x1B[0m");
|
|
534
|
+
lines.push(" " + "=".repeat(40));
|
|
535
|
+
lines.push("");
|
|
536
|
+
if (result.imports.length > 0) {
|
|
537
|
+
const importSupported = result.imports.filter((i) => i.status === "supported").length;
|
|
538
|
+
lines.push(` \x1b[1mImports\x1b[0m: ${importSupported}/${result.imports.length} fully supported`);
|
|
539
|
+
for (const item of result.imports) {
|
|
540
|
+
const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
|
|
541
|
+
const fileCount = item.files ? ` \x1b[90m(${item.files.length} file${item.files.length === 1 ? "" : "s"})\x1b[0m` : "";
|
|
542
|
+
lines.push(` ${statusIcon(item.status)} ${item.name}${fileCount}${suffix}`);
|
|
543
|
+
}
|
|
544
|
+
lines.push("");
|
|
545
|
+
}
|
|
546
|
+
if (result.config.length > 0) {
|
|
547
|
+
const configSupported = result.config.filter((i) => i.status === "supported").length;
|
|
548
|
+
lines.push(` \x1b[1mConfig\x1b[0m: ${configSupported}/${result.config.length} options supported`);
|
|
549
|
+
for (const item of result.config) {
|
|
550
|
+
const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
|
|
551
|
+
lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
|
|
552
|
+
}
|
|
553
|
+
lines.push("");
|
|
554
|
+
}
|
|
555
|
+
if (result.libraries.length > 0) {
|
|
556
|
+
const libSupported = result.libraries.filter((i) => i.status === "supported").length;
|
|
557
|
+
lines.push(` \x1b[1mLibraries\x1b[0m: ${libSupported}/${result.libraries.length} compatible`);
|
|
558
|
+
for (const item of result.libraries) {
|
|
559
|
+
const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
|
|
560
|
+
lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
|
|
561
|
+
}
|
|
562
|
+
lines.push("");
|
|
563
|
+
}
|
|
564
|
+
if (result.conventions.length > 0) {
|
|
565
|
+
lines.push(` \x1b[1mProject structure\x1b[0m:`);
|
|
566
|
+
for (const item of result.conventions) {
|
|
567
|
+
const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
|
|
568
|
+
lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
|
|
569
|
+
}
|
|
570
|
+
lines.push("");
|
|
571
|
+
}
|
|
572
|
+
const { score, supported, partial, unsupported } = result.summary;
|
|
573
|
+
const scoreColor = score >= 90 ? "\x1B[32m" : score >= 70 ? "\x1B[33m" : "\x1B[31m";
|
|
574
|
+
lines.push(" " + "-".repeat(40));
|
|
575
|
+
lines.push(` \x1b[1mOverall\x1b[0m: ${scoreColor}${score}% compatible\x1b[0m (${supported} supported, ${partial} partial, ${unsupported} issues)`);
|
|
576
|
+
if (unsupported > 0) {
|
|
577
|
+
lines.push("");
|
|
578
|
+
lines.push(" \x1B[1mIssues to address:\x1B[0m");
|
|
579
|
+
const allItems = [
|
|
580
|
+
...result.imports,
|
|
581
|
+
...result.config,
|
|
582
|
+
...result.libraries,
|
|
583
|
+
...result.conventions
|
|
584
|
+
];
|
|
585
|
+
for (const item of allItems) if (item.status === "unsupported") lines.push(` \x1b[31m✗\x1b[0m ${item.name}${item.detail ? ` — ${item.detail}` : ""}`);
|
|
586
|
+
}
|
|
587
|
+
if (result.summary.partial > 0) {
|
|
588
|
+
lines.push("");
|
|
589
|
+
lines.push(" \x1B[1mPartial support (may need attention):\x1B[0m");
|
|
590
|
+
const allItems = [
|
|
591
|
+
...result.imports,
|
|
592
|
+
...result.config,
|
|
593
|
+
...result.libraries,
|
|
594
|
+
...result.conventions
|
|
595
|
+
];
|
|
596
|
+
for (const item of allItems) if (item.status === "partial") lines.push(` \x1b[33m~\x1b[0m ${item.name}${item.detail ? ` — ${item.detail}` : ""}`);
|
|
597
|
+
}
|
|
598
|
+
if (!opts?.calledFromInit) {
|
|
599
|
+
lines.push("");
|
|
600
|
+
lines.push(" \x1B[1mRecommended next steps:\x1B[0m");
|
|
601
|
+
lines.push(` Run \x1b[36mvinext init\x1b[0m to set up your project automatically`);
|
|
602
|
+
lines.push("");
|
|
603
|
+
lines.push(" Or manually:");
|
|
604
|
+
lines.push(` 1. Add \x1b[36m"type": "module"\x1b[0m to package.json`);
|
|
605
|
+
lines.push(` 2. Install: \x1b[36m${detectPackageManager(process.cwd())} vinext vite @vitejs/plugin-react${hasAppRouter ? " @vitejs/plugin-rsc react-server-dom-webpack" : ""}\x1b[0m`);
|
|
606
|
+
lines.push(` 3. Create vite.config.ts (see docs)`);
|
|
607
|
+
lines.push(` 4. Run: \x1b[36mnpx vite dev\x1b[0m`);
|
|
608
|
+
}
|
|
609
|
+
lines.push("");
|
|
610
|
+
return lines.join("\n");
|
|
594
611
|
}
|
|
612
|
+
//#endregion
|
|
613
|
+
export { analyzeConfig, checkConventions, checkLibraries, formatReport, runCheck, scanImports };
|
|
614
|
+
|
|
595
615
|
//# sourceMappingURL=check.js.map
|