From f518683b97e1521de1fe074f4bf6e56d428dd78f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jan 2024 13:39:48 +0100 Subject: [PATCH] cli: switch experimental /auth entry to index-public-experimental at /public instead Signed-off-by: Patrik Oldsberg --- ...auth.tsx => index-public-experimental.tsx} | 0 packages/cli/src/lib/bundler/bundle.ts | 20 +++++++++---------- packages/cli/src/lib/bundler/server.ts | 16 +++++++-------- packages/cli/src/lib/bundler/types.ts | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) rename packages/app/src/{auth.tsx => index-public-experimental.tsx} (100%) diff --git a/packages/app/src/auth.tsx b/packages/app/src/index-public-experimental.tsx similarity index 100% rename from packages/app/src/auth.tsx rename to packages/app/src/index-public-experimental.tsx diff --git a/packages/cli/src/lib/bundler/bundle.ts b/packages/cli/src/lib/bundler/bundle.ts index 2c3311cb39..d0624c93ff 100644 --- a/packages/cli/src/lib/bundler/bundle.ts +++ b/packages/cli/src/lib/bundler/bundle.ts @@ -61,20 +61,20 @@ export async function buildBundle(options: BuildOptions) { }), ]; - const authPaths = await resolveOptionalBundlingPaths({ - entry: 'src/auth', - dist: 'dist/auth', + const publicPaths = await resolveOptionalBundlingPaths({ + entry: 'src/index-public-experimental', + dist: 'dist/public', }); - if (authPaths) { + if (publicPaths) { console.log( chalk.yellow( `⚠️ WARNING: The app /auth entry point is an experimental feature that may receive immediate breaking changes.`, ), ); configs.push( - await createConfig(authPaths, { + await createConfig(publicPaths, { ...commonConfigOptions, - publicSubPath: '/auth', + publicSubPath: '/public', }), ); } @@ -82,8 +82,8 @@ export async function buildBundle(options: BuildOptions) { const isCi = yn(process.env.CI, { default: false }); const previousFileSizes = await measureFileSizesBeforeBuild(paths.targetDist); - const previousAuthSizes = authPaths - ? await measureFileSizesBeforeBuild(authPaths.targetDist) + const previousAuthSizes = publicPaths + ? await measureFileSizesBeforeBuild(publicPaths.targetDist) : undefined; await fs.emptyDir(paths.targetDist); @@ -124,11 +124,11 @@ export async function buildBundle(options: BuildOptions) { WARN_AFTER_BUNDLE_GZIP_SIZE, WARN_AFTER_CHUNK_GZIP_SIZE, ); - if (authPaths && previousAuthSizes) { + if (publicPaths && previousAuthSizes) { printFileSizesAfterBuild( authStats, previousAuthSizes, - authPaths.targetDist, + publicPaths.targetDist, WARN_AFTER_BUNDLE_GZIP_SIZE, WARN_AFTER_CHUNK_GZIP_SIZE, ); diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 5b3bd22720..f1eb2e923d 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -203,23 +203,23 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be root: paths.targetPath, }); } else { - const authPaths = await resolveOptionalBundlingPaths({ - entry: 'src/auth', - dist: 'dist/auth', + const publicPaths = await resolveOptionalBundlingPaths({ + entry: 'src/index-public-experimental', + dist: 'dist/public', }); - if (authPaths) { + if (publicPaths) { console.log( chalk.yellow( - `⚠️ WARNING: The app /auth entry point is an experimental feature that may receive immediate breaking changes.`, + `⚠️ WARNING: The app /public entry point is an experimental feature that may receive immediate breaking changes.`, ), ); } - const compiler = authPaths + const compiler = publicPaths ? webpack([ config, - await createConfig(authPaths, { + await createConfig(publicPaths, { ...commonConfigOptions, - publicSubPath: '/auth', + publicSubPath: '/public', }), ]) : webpack(config); diff --git a/packages/cli/src/lib/bundler/types.ts b/packages/cli/src/lib/bundler/types.ts index c836fd7a29..4a9424dedb 100644 --- a/packages/cli/src/lib/bundler/types.ts +++ b/packages/cli/src/lib/bundler/types.ts @@ -26,7 +26,7 @@ export type BundlingOptions = { baseUrl: URL; parallelism?: number; additionalEntryPoints?: string[]; - // Path to append to the detected public path, e.g. '/auth' + // Path to append to the detected public path, e.g. '/public' publicSubPath?: string; };