From 6e8c48a362f140d842117e2c9c239c8670b72d3f Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Mon, 13 Nov 2023 21:43:38 +0900 Subject: [PATCH] fix: install PR 7990 + sideEffect true --- .yalc/@remix-run/dev/CHANGELOG.md | 1060 +++++++++++++++++ .yalc/@remix-run/dev/LICENSE.md | 22 + .yalc/@remix-run/dev/README.md | 13 + .../_virtual/_rollupPluginBabelHelpers.js | 64 + .yalc/@remix-run/dev/dist/cache.d.ts | 2 + .yalc/@remix-run/dev/dist/cache.js | 21 + .yalc/@remix-run/dev/dist/channel.d.ts | 7 + .yalc/@remix-run/dev/dist/channel.js | 35 + .yalc/@remix-run/dev/dist/cli.d.ts | 1 + .yalc/@remix-run/dev/dist/cli.js | 21 + .yalc/@remix-run/dev/dist/cli/commands.d.ts | 24 + .yalc/@remix-run/dev/dist/cli/commands.js | 306 +++++ .yalc/@remix-run/dev/dist/cli/create.js | 662 ++++++++++ .../dev/dist/cli/detectPackageManager.d.ts | 10 + .../dev/dist/cli/detectPackageManager.js | 39 + .yalc/@remix-run/dev/dist/cli/error.js | 18 + .../dist/cli/getPreferredPackageManager.js | 24 + .yalc/@remix-run/dev/dist/cli/index.d.ts | 1 + .yalc/@remix-run/dev/dist/cli/index.js | 19 + .yalc/@remix-run/dev/dist/cli/run.d.ts | 5 + .yalc/@remix-run/dev/dist/cli/run.js | 200 ++++ .yalc/@remix-run/dev/dist/cli/setup.js | 112 ++ .../dev/dist/cli/useJavascript.d.ts | 4 + .../@remix-run/dev/dist/cli/useJavascript.js | 67 ++ .yalc/@remix-run/dev/dist/codemod/index.js | 73 ++ .../replace-remix-magic-imports/index.js | 165 +++ .../replace-remix-magic-imports/transform.js | 198 +++ .../utils/dependencies.js | 27 + .../utils/detect.js | 73 ++ .../utils/export.js | 96 ++ .../utils/postinstall.js | 37 + .../utils/remix.js | 29 + .../dev/dist/codemod/utils/error.js | 26 + .../@remix-run/dev/dist/codemod/utils/git.js | 39 + .../@remix-run/dev/dist/codemod/utils/log.js | 19 + .../@remix-run/dev/dist/codemod/utils/task.js | 41 + .yalc/@remix-run/dev/dist/colors.d.ts | 17 + .yalc/@remix-run/dev/dist/colors.js | 54 + .../dev/dist/compiler/analysis.d.ts | 3 + .../@remix-run/dev/dist/compiler/analysis.js | 28 + .yalc/@remix-run/dev/dist/compiler/assets.js | 131 ++ .yalc/@remix-run/dev/dist/compiler/build.d.ts | 2 + .yalc/@remix-run/dev/dist/compiler/build.js | 22 + .../@remix-run/dev/dist/compiler/cancel.d.ts | 4 + .yalc/@remix-run/dev/dist/compiler/cancel.js | 23 + .../dev/dist/compiler/compileBrowser.js | 301 +++++ .../dev/dist/compiler/compiler.d.ts | 11 + .../@remix-run/dev/dist/compiler/compiler.js | 156 +++ .../dev/dist/compiler/compilerServer.js | 192 +++ .../@remix-run/dev/dist/compiler/context.d.ts | 10 + .../dev/dist/compiler/css/bundle.d.ts | 4 + .../dev/dist/compiler/css/bundle.js | 78 ++ .../dev/dist/compiler/css/compiler.d.ts | 10 + .../dev/dist/compiler/css/compiler.js | 126 ++ .../dev/dist/compiler/css/index.d.ts | 2 + .../compiler/css/plugins/bundleEntry.d.ts | 8 + .../dist/compiler/css/plugins/bundleEntry.js | 63 + .../dev/dist/compiler/dependencies.js | 77 ++ .../dev/dist/compiler/fileWatchCache.d.ts | 22 + .../dev/dist/compiler/fileWatchCache.js | 176 +++ .yalc/@remix-run/dev/dist/compiler/index.d.ts | 4 + .../dev/dist/compiler/js/compiler.d.ts | 17 + .../dev/dist/compiler/js/compiler.js | 166 +++ .../dev/dist/compiler/js/index.d.ts | 2 + .../plugins/browserNodeBuiltinsPolyfill.d.ts | 2 + .../js/plugins/browserNodeBuiltinsPolyfill.js | 42 + .../dev/dist/compiler/js/plugins/hmr.d.ts | 5 + .../dev/dist/compiler/js/plugins/hmr.js | 240 ++++ .../dev/dist/compiler/js/plugins/routes.d.ts | 7 + .../dev/dist/compiler/js/plugins/routes.js | 117 ++ .../dev/dist/compiler/js/write.d.ts | 3 + .../@remix-run/dev/dist/compiler/js/write.js | 49 + .../dev/dist/compiler/lazyValue.d.ts | 11 + .../@remix-run/dev/dist/compiler/lazyValue.js | 54 + .yalc/@remix-run/dev/dist/compiler/loaders.js | 90 ++ .../dev/dist/compiler/manifest.d.ts | 11 + .../@remix-run/dev/dist/compiler/manifest.js | 156 +++ .../dev/dist/compiler/onCompileFailure.js | 59 + .../@remix-run/dev/dist/compiler/options.d.ts | 7 + .yalc/@remix-run/dev/dist/compiler/options.js | 26 + .../plugins/absoluteCssUrlsPlugin.d.ts | 6 + .../compiler/plugins/absoluteCssUrlsPlugin.js | 47 + .../plugins/browserRouteModulesPlugin.js | 82 ++ .../plugins/browserRouteModulesPlugin_v2.js | 162 +++ .../plugins/cssBundleEntryModulePlugin.js | 61 + .../compiler/plugins/cssBundlePlugin.d.ts | 10 + .../dist/compiler/plugins/cssBundlePlugin.js | 49 + .../compiler/plugins/cssBundleUpdatePlugin.js | 78 ++ .../dist/compiler/plugins/cssFilePlugin.js | 184 +++ .../dev/dist/compiler/plugins/cssImports.d.ts | 7 + .../dev/dist/compiler/plugins/cssImports.js | 215 ++++ .../compiler/plugins/cssModuleImports.d.ts | 5 + .../dist/compiler/plugins/cssModuleImports.js | 170 +++ .../dist/compiler/plugins/cssModulesPlugin.js | 128 ++ .../plugins/cssSideEffectImports.d.ts | 17 + .../compiler/plugins/cssSideEffectImports.js | 187 +++ .../plugins/cssSideEffectImportsPlugin.js | 182 +++ .../plugins/deprecatedRemixPackage.js | 48 + .../plugins/deprecatedRemixPackagePlugin.js | 46 + .../dist/compiler/plugins/emptyModules.d.ts | 9 + .../dev/dist/compiler/plugins/emptyModules.js | 79 ++ .../compiler/plugins/emptyModulesPlugin.js | 76 ++ .../dev/dist/compiler/plugins/external.d.ts | 4 + .../dev/dist/compiler/plugins/external.js | 31 + .../dev/dist/compiler/plugins/hmrPlugin.js | 233 ++++ .../dev/dist/compiler/plugins/mdx.d.ts | 18 + .../dev/dist/compiler/plugins/mdx.js | 144 +++ .../plugins/serverAssetsManifestPlugin.js | 57 + .../plugins/serverBareModulesPlugin.js | 188 +++ .../plugins/serverEntryModulePlugin.js | 79 ++ .../plugins/serverRouteModulesPlugin.js | 86 ++ .../dist/compiler/plugins/urlImportsPlugin.js | 43 + .../dist/compiler/plugins/vanillaExtract.d.ts | 5 + .../dist/compiler/plugins/vanillaExtract.js | 159 +++ .../compiler/plugins/vanillaExtractPlugin.js | 34 + .../plugins/vanillaExtractPluginCached.js | 125 ++ .../plugins/vanillaExtractPluginUncached.js | 194 +++ .../vanillaExtractSideEffectsPlugin.js | 49 + .../dev/dist/compiler/remixCompiler.js | 56 + .../dev/dist/compiler/routeExports.js | 92 ++ .../dev/dist/compiler/server/compiler.d.ts | 15 + .../dev/dist/compiler/server/compiler.js | 140 +++ .../dev/dist/compiler/server/index.d.ts | 2 + .../compiler/server/plugins/bareImports.d.ts | 8 + .../compiler/server/plugins/bareImports.js | 108 ++ .../dist/compiler/server/plugins/entry.d.ts | 9 + .../dev/dist/compiler/server/plugins/entry.js | 80 ++ .../compiler/server/plugins/manifest.d.ts | 11 + .../dist/compiler/server/plugins/manifest.js | 59 + .../dist/compiler/server/plugins/routes.d.ts | 7 + .../dist/compiler/server/plugins/routes.js | 90 ++ .../plugins/serverNodeBuiltinsPolyfill.d.ts | 2 + .../plugins/serverNodeBuiltinsPolyfill.js | 33 + .../dist/compiler/server/virtualModules.d.ts | 7 + .../dist/compiler/server/virtualModules.js | 25 + .../dev/dist/compiler/server/write.d.ts | 3 + .../dev/dist/compiler/server/write.js | 76 ++ .../dev/dist/compiler/utils/crypto.d.ts | 4 + .../dev/dist/compiler/utils/crypto.js | 51 + .../@remix-run/dev/dist/compiler/utils/fs.js | 46 + .../dev/dist/compiler/utils/loaders.d.ts | 5 + .../dev/dist/compiler/utils/loaders.js | 90 ++ .../dev/dist/compiler/utils/log.d.ts | 1 + .../@remix-run/dev/dist/compiler/utils/log.js | 58 + .../dev/dist/compiler/utils/postcss.d.ts | 29 + .../dev/dist/compiler/utils/postcss.js | 228 ++++ .../dev/dist/compiler/utils/routeExports.d.ts | 2 + .../dev/dist/compiler/utils/routeExports.js | 94 ++ .../dev/dist/compiler/utils/tsconfig.d.ts | 2 + .../dev/dist/compiler/utils/tsconfig.js | 40 + .../dev/dist/compiler/utils/tsconfig/index.js | 40 + .../utils/tsconfig/write-config-defaults.js | 149 +++ .../@remix-run/dev/dist/compiler/utils/url.js | 41 + .../dev/dist/compiler/virtualModules.js | 25 + .../@remix-run/dev/dist/compiler/warnings.js | 23 + .yalc/@remix-run/dev/dist/compiler/watch.d.ts | 13 + .yalc/@remix-run/dev/dist/compiler/watch.js | 154 +++ .yalc/@remix-run/dev/dist/config.d.ts | 287 +++++ .yalc/@remix-run/dev/dist/config.js | 276 +++++ .../cloudflare/entry.server.react-stream.tsx | 34 + .../cloudflare/entry.server.react-string.tsx | 22 + .../deno/entry.server.react-stream.tsx | 34 + .../deno/entry.server.react-string.tsx | 22 + .../defaults/entry.client.react-stream.tsx | 12 + .../defaults/entry.client.react-string.tsx | 4 + .../dev/dist/config/defaults/entry.client.tsx | 12 + .../dev/dist/config/defaults/entry.dev.d.ts | 2 + .../dev/dist/config/defaults/entry.dev.ts | 13 + .../defaults/entry.server.cloudflare.tsx | 34 + .../config/defaults/entry.server.deno.tsx | 34 + .../config/defaults/entry.server.node.tsx | 131 ++ .../node/entry.server.react-stream.tsx | 129 ++ .../node/entry.server.react-string.tsx | 22 + .../dev/dist/config/flat-routes.d.ts | 14 + .../@remix-run/dev/dist/config/flat-routes.js | 428 +++++++ .yalc/@remix-run/dev/dist/config/format.d.ts | 9 + .yalc/@remix-run/dev/dist/config/format.js | 78 ++ .yalc/@remix-run/dev/dist/config/routes.d.ts | 98 ++ .yalc/@remix-run/dev/dist/config/routes.js | 113 ++ .../dev/dist/config/routesConvention.js | 291 +++++ .../dev/dist/config/serverModes.d.ts | 9 + .../@remix-run/dev/dist/config/serverModes.js | 29 + .yalc/@remix-run/dev/dist/dependencies.d.ts | 7 + .yalc/@remix-run/dev/dist/dependencies.js | 94 ++ .../@remix-run/dev/dist/devServer/index.d.ts | 1 + .../dev/dist/devServer/liveReload.d.ts | 5 + .../dev/dist/devServer/liveReload.js | 129 ++ .yalc/@remix-run/dev/dist/devServer/serve.js | 81 ++ .yalc/@remix-run/dev/dist/devServer2.js | 181 +++ .../dev/dist/devServer_unstable/env.d.ts | 1 + .../dev/dist/devServer_unstable/env.js | 51 + .../dev/dist/devServer_unstable/hdr.d.ts | 2 + .../dev/dist/devServer_unstable/hdr.js | 153 +++ .../dev/dist/devServer_unstable/hmr.d.ts | 10 + .../dev/dist/devServer_unstable/hmr.js | 76 ++ .../dev/dist/devServer_unstable/index.d.ts | 9 + .../dev/dist/devServer_unstable/index.js | 300 +++++ .../dev/dist/devServer_unstable/proc.d.ts | 2 + .../dev/dist/devServer_unstable/proc.js | 70 ++ .../dev/dist/devServer_unstable/socket.d.ts | 9 + .../dev/dist/devServer_unstable/socket.js | 64 + .yalc/@remix-run/dev/dist/env.js | 56 + .yalc/@remix-run/dev/dist/hmr.js | 77 ++ .yalc/@remix-run/dev/dist/index.d.ts | 6 + .yalc/@remix-run/dev/dist/index.js | 25 + .yalc/@remix-run/dev/dist/invariant.d.ts | 2 + .yalc/@remix-run/dev/dist/invariant.js | 22 + .yalc/@remix-run/dev/dist/liveReload.js | 58 + .yalc/@remix-run/dev/dist/logging.js | 19 + .yalc/@remix-run/dev/dist/manifest.d.ts | 26 + .yalc/@remix-run/dev/dist/modules.d.ts | 152 +++ .yalc/@remix-run/dev/dist/package.json | 128 ++ .yalc/@remix-run/dev/dist/result.d.ts | 12 + .yalc/@remix-run/dev/dist/result.js | 25 + .yalc/@remix-run/dev/dist/server-build.d.ts | 8 + .yalc/@remix-run/dev/dist/server-build.js | 32 + .yalc/@remix-run/dev/dist/transform/create.js | 43 + .../dev/dist/transform/plugins/recast.js | 63 + .../@remix-run/dev/dist/tsconfig.tsbuildinfo | 1 + .yalc/@remix-run/dev/dist/tux/format.d.ts | 7 + .yalc/@remix-run/dev/dist/tux/format.js | 36 + .yalc/@remix-run/dev/dist/tux/index.d.ts | 1 + .yalc/@remix-run/dev/dist/tux/logger.d.ts | 12 + .yalc/@remix-run/dev/dist/tux/logger.js | 66 + .yalc/@remix-run/dev/dist/vite/babel.d.ts | 8 + .yalc/@remix-run/dev/dist/vite/index.d.ts | 5 + .yalc/@remix-run/dev/dist/vite/index.js | 39 + .../dev/dist/vite/legacy-css-imports.d.ts | 4 + .../dev/dist/vite/legacy-css-imports.js | 68 ++ .../dev/dist/vite/node/adapter.d.ts | 6 + .../@remix-run/dev/dist/vite/node/adapter.js | 198 +++ .yalc/@remix-run/dev/dist/vite/plugin.d.ts | 10 + .yalc/@remix-run/dev/dist/vite/plugin.js | 798 +++++++++++++ .../dev/dist/vite/remove-exports-test.d.ts | 1 + .../dev/dist/vite/remove-exports.d.ts | 1 + .../dev/dist/vite/remove-exports.js | 288 +++++ .../dist/vite/replace-import-specifier.d.ts | 8 + .../dev/dist/vite/replace-import-specifier.js | 48 + .../dev/dist/vite/static/refresh-utils.cjs | 174 +++ .yalc/@remix-run/dev/dist/vite/styles.d.ts | 5 + .yalc/@remix-run/dev/dist/vite/styles.js | 148 +++ .yalc/@remix-run/dev/dist/vite/vmod.d.ts | 3 + .yalc/@remix-run/dev/dist/vite/vmod.js | 21 + .yalc/@remix-run/dev/package.json | 107 ++ .yalc/@remix-run/dev/server-build.d.ts | 8 + .yalc/@remix-run/dev/server-build.js | 32 + .yalc/@remix-run/dev/yalc.sig | 1 + package.json | 3 +- pnpm-lock.yaml | 192 +-- vite.config.ts | 5 + yalc.lock | 10 + 251 files changed, 17718 insertions(+), 95 deletions(-) create mode 100644 .yalc/@remix-run/dev/CHANGELOG.md create mode 100644 .yalc/@remix-run/dev/LICENSE.md create mode 100644 .yalc/@remix-run/dev/README.md create mode 100644 .yalc/@remix-run/dev/dist/_virtual/_rollupPluginBabelHelpers.js create mode 100644 .yalc/@remix-run/dev/dist/cache.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cache.js create mode 100644 .yalc/@remix-run/dev/dist/channel.d.ts create mode 100644 .yalc/@remix-run/dev/dist/channel.js create mode 100644 .yalc/@remix-run/dev/dist/cli.d.ts create mode 100755 .yalc/@remix-run/dev/dist/cli.js create mode 100644 .yalc/@remix-run/dev/dist/cli/commands.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cli/commands.js create mode 100644 .yalc/@remix-run/dev/dist/cli/create.js create mode 100644 .yalc/@remix-run/dev/dist/cli/detectPackageManager.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cli/detectPackageManager.js create mode 100644 .yalc/@remix-run/dev/dist/cli/error.js create mode 100644 .yalc/@remix-run/dev/dist/cli/getPreferredPackageManager.js create mode 100644 .yalc/@remix-run/dev/dist/cli/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cli/index.js create mode 100644 .yalc/@remix-run/dev/dist/cli/run.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cli/run.js create mode 100644 .yalc/@remix-run/dev/dist/cli/setup.js create mode 100644 .yalc/@remix-run/dev/dist/cli/useJavascript.d.ts create mode 100644 .yalc/@remix-run/dev/dist/cli/useJavascript.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/index.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/index.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/transform.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/utils/dependencies.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/utils/detect.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/utils/export.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/utils/postinstall.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/replace-remix-magic-imports/utils/remix.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/utils/error.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/utils/git.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/utils/log.js create mode 100644 .yalc/@remix-run/dev/dist/codemod/utils/task.js create mode 100644 .yalc/@remix-run/dev/dist/colors.d.ts create mode 100644 .yalc/@remix-run/dev/dist/colors.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/analysis.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/analysis.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/assets.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/build.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/build.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/cancel.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/cancel.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/compileBrowser.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/compiler.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/compiler.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/compilerServer.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/context.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/bundle.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/bundle.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/compiler.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/compiler.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/plugins/bundleEntry.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/css/plugins/bundleEntry.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/dependencies.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/fileWatchCache.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/fileWatchCache.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/compiler.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/compiler.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/browserNodeBuiltinsPolyfill.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/browserNodeBuiltinsPolyfill.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/hmr.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/hmr.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/routes.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/plugins/routes.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/write.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/js/write.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/lazyValue.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/lazyValue.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/loaders.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/manifest.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/manifest.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/onCompileFailure.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/options.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/options.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/absoluteCssUrlsPlugin.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/absoluteCssUrlsPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/browserRouteModulesPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/browserRouteModulesPlugin_v2.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssBundleEntryModulePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssBundleUpdatePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssFilePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssImports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssImports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssModuleImports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssModuleImports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssModulesPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImportsPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/deprecatedRemixPackage.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/deprecatedRemixPackagePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/emptyModules.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/emptyModules.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/emptyModulesPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/external.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/external.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/hmrPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/mdx.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/mdx.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/serverAssetsManifestPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/serverBareModulesPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/serverEntryModulePlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/serverRouteModulesPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/urlImportsPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtract.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtractPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtractPluginCached.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtractPluginUncached.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtractSideEffectsPlugin.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/remixCompiler.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/routeExports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/compiler.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/compiler.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/bareImports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/bareImports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/entry.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/entry.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/manifest.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/manifest.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/routes.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/routes.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/serverNodeBuiltinsPolyfill.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/plugins/serverNodeBuiltinsPolyfill.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/virtualModules.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/virtualModules.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/write.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/server/write.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/crypto.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/crypto.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/fs.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/loaders.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/loaders.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/log.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/log.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/postcss.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/postcss.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/routeExports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/routeExports.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/tsconfig.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/tsconfig.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/tsconfig/index.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/tsconfig/write-config-defaults.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/utils/url.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/virtualModules.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/warnings.js create mode 100644 .yalc/@remix-run/dev/dist/compiler/watch.d.ts create mode 100644 .yalc/@remix-run/dev/dist/compiler/watch.js create mode 100644 .yalc/@remix-run/dev/dist/config.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config.js create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/cloudflare/entry.server.react-stream.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/cloudflare/entry.server.react-string.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/deno/entry.server.react-stream.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/deno/entry.server.react-string.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.client.react-stream.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.client.react-string.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.client.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.dev.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.dev.ts create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.server.cloudflare.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.server.deno.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/entry.server.node.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/node/entry.server.react-stream.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/defaults/node/entry.server.react-string.tsx create mode 100644 .yalc/@remix-run/dev/dist/config/flat-routes.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config/flat-routes.js create mode 100644 .yalc/@remix-run/dev/dist/config/format.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config/format.js create mode 100644 .yalc/@remix-run/dev/dist/config/routes.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config/routes.js create mode 100644 .yalc/@remix-run/dev/dist/config/routesConvention.js create mode 100644 .yalc/@remix-run/dev/dist/config/serverModes.d.ts create mode 100644 .yalc/@remix-run/dev/dist/config/serverModes.js create mode 100644 .yalc/@remix-run/dev/dist/dependencies.d.ts create mode 100644 .yalc/@remix-run/dev/dist/dependencies.js create mode 100644 .yalc/@remix-run/dev/dist/devServer/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer/liveReload.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer/liveReload.js create mode 100644 .yalc/@remix-run/dev/dist/devServer/serve.js create mode 100644 .yalc/@remix-run/dev/dist/devServer2.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/env.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/env.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/hdr.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/hdr.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/hmr.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/hmr.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/index.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/proc.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/proc.js create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/socket.d.ts create mode 100644 .yalc/@remix-run/dev/dist/devServer_unstable/socket.js create mode 100644 .yalc/@remix-run/dev/dist/env.js create mode 100644 .yalc/@remix-run/dev/dist/hmr.js create mode 100644 .yalc/@remix-run/dev/dist/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/index.js create mode 100644 .yalc/@remix-run/dev/dist/invariant.d.ts create mode 100644 .yalc/@remix-run/dev/dist/invariant.js create mode 100644 .yalc/@remix-run/dev/dist/liveReload.js create mode 100644 .yalc/@remix-run/dev/dist/logging.js create mode 100644 .yalc/@remix-run/dev/dist/manifest.d.ts create mode 100644 .yalc/@remix-run/dev/dist/modules.d.ts create mode 100644 .yalc/@remix-run/dev/dist/package.json create mode 100644 .yalc/@remix-run/dev/dist/result.d.ts create mode 100644 .yalc/@remix-run/dev/dist/result.js create mode 100644 .yalc/@remix-run/dev/dist/server-build.d.ts create mode 100644 .yalc/@remix-run/dev/dist/server-build.js create mode 100644 .yalc/@remix-run/dev/dist/transform/create.js create mode 100644 .yalc/@remix-run/dev/dist/transform/plugins/recast.js create mode 100644 .yalc/@remix-run/dev/dist/tsconfig.tsbuildinfo create mode 100644 .yalc/@remix-run/dev/dist/tux/format.d.ts create mode 100644 .yalc/@remix-run/dev/dist/tux/format.js create mode 100644 .yalc/@remix-run/dev/dist/tux/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/tux/logger.d.ts create mode 100644 .yalc/@remix-run/dev/dist/tux/logger.js create mode 100644 .yalc/@remix-run/dev/dist/vite/babel.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/index.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/index.js create mode 100644 .yalc/@remix-run/dev/dist/vite/legacy-css-imports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/legacy-css-imports.js create mode 100644 .yalc/@remix-run/dev/dist/vite/node/adapter.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/node/adapter.js create mode 100644 .yalc/@remix-run/dev/dist/vite/plugin.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/plugin.js create mode 100644 .yalc/@remix-run/dev/dist/vite/remove-exports-test.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/remove-exports.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/remove-exports.js create mode 100644 .yalc/@remix-run/dev/dist/vite/replace-import-specifier.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/replace-import-specifier.js create mode 100644 .yalc/@remix-run/dev/dist/vite/static/refresh-utils.cjs create mode 100644 .yalc/@remix-run/dev/dist/vite/styles.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/styles.js create mode 100644 .yalc/@remix-run/dev/dist/vite/vmod.d.ts create mode 100644 .yalc/@remix-run/dev/dist/vite/vmod.js create mode 100644 .yalc/@remix-run/dev/package.json create mode 100644 .yalc/@remix-run/dev/server-build.d.ts create mode 100644 .yalc/@remix-run/dev/server-build.js create mode 100644 .yalc/@remix-run/dev/yalc.sig create mode 100644 yalc.lock diff --git a/.yalc/@remix-run/dev/CHANGELOG.md b/.yalc/@remix-run/dev/CHANGELOG.md new file mode 100644 index 0000000..86e3a39 --- /dev/null +++ b/.yalc/@remix-run/dev/CHANGELOG.md @@ -0,0 +1,1060 @@ +# `@remix-run/dev` + +## 2.2.0 + +### Minor Changes + +- Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590)) + - `remix build` 👉 `vite build && vite build --ssr` + - `remix dev` 👉 `vite dev` + - Other runtimes (e.g. Deno, Cloudflare) not yet supported. + - See "Future > Vite" in the Remix Docs for details +- Add a new `future.v3_fetcherPersist` flag to change the persistence behavior of fetchers. Instead of being immediately cleaned up when unmounted in the UI, fetchers will persist until they return to an `idle` state ([RFC](https://github.com/remix-run/remix/discussions/7698)) ([#7704](https://github.com/remix-run/remix/pull/7704)) + - For more details, please refer to the [React Router 6.18.0](https://github.com/remix-run/react-router/releases/tag/react-router%406.18.0) release notes + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@2.2.0` + - `@remix-run/node@2.2.0` + +## 2.1.0 + +### Patch Changes + +- Sourcemap takes into account special chars in output file ([#7574](https://github.com/remix-run/remix/pull/7574)) +- Updated dependencies: + - `@remix-run/server-runtime@2.1.0` + +## 2.0.1 + +### Patch Changes + +- Fix types for MDX files when using pnpm ([#7491](https://github.com/remix-run/remix/pull/7491)) +- Update `getDependenciesToBundle` to handle ESM packages without main exports ([#7272](https://github.com/remix-run/remix/pull/7272)) + - Note that these packages must expose `package.json` in their `exports` field so that their path can be resolved +- Fix server builds where `serverBuildPath` extension is `.cjs` ([#7180](https://github.com/remix-run/remix/pull/7180)) +- Updated dependencies: + - `@remix-run/server-runtime@2.0.1` + +## 2.0.0 + +### Major Changes + +- The `create-remix` CLI has been rewritten to feature a cleaner interface, Git repo initialization and optional `remix.init` script execution. The interactive template prompt and official Remix stack/template shorthands have also been removed so that community/third-party templates are now on a more equal footing. ([#6887](https://github.com/remix-run/remix/pull/6887)) + - The code for `create-remix` has been moved out of the Remix CLI since it's not intended for use within an existing Remix application + - This means that the `remix create` command is no longer available. +- Enable built-in PostCSS and Tailwind support by default. ([#6909](https://github.com/remix-run/remix/pull/6909)) + - These tools are now automatically used within the Remix compiler if PostCSS and/or Tailwind configuration files are present in your project. + - If you have a custom PostCSS and/or Tailwind setup outside of Remix, you can disable these features in your `remix.config.js` via the `postcss:false` and/or `tailwind:false` flags +- Drop React 17 support ([#7121](https://github.com/remix-run/remix/pull/7121)) +- Require Node >=18.0.0 ([#6939](https://github.com/remix-run/remix/pull/6939)) +- Compile server build to Node 18 ([#7292](https://github.com/remix-run/remix/pull/7292)) + - This allows features like top-level `await` to be used within a Remix app +- Remove default Node.js polyfills - you must now opt-into polyfills via the [`serverNodeBuiltinsPolyfill`](https://remix.run/docs/en/2.0.0/start/v2#servernodebuiltinspolyfill) and [`browserNodeBuiltinsPolyfill`](https://remix.run/docs/en/2.0.0/start/v2#browsernodebuiltinspolyfill) configs ([#7269](https://github.com/remix-run/remix/pull/7269)) +- Remove `v2_errorBoundary` flag and `CatchBoundary` implementation ([#6906](https://github.com/remix-run/remix/pull/6906)) +- Remove `v2_normalizeFormMethod` future flag - all `formMethod` values will be normalized in v2 ([#6875](https://github.com/remix-run/remix/pull/6875)) +- Remove `v2_routeConvention` flag - the flat route file convention is now standard ([#6969](https://github.com/remix-run/remix/pull/6969)) +- Remove `v2_headers` flag - it is now the default behavior to use the deepest `headers` function in the route tree ([#6979](https://github.com/remix-run/remix/pull/6979)) +- The route `meta` API now defaults to the new "V2 Meta" API ([#6958](https://github.com/remix-run/remix/pull/6958)) + - Please refer to the ([docs](https://remix.run/docs/en/2.0.0/route/meta) and [Preparing for V2](https://remix.run/docs/en/2.0.0/start/v2#route-meta) guide for more information. +- Default to `serverModuleFormat: "esm"` and update `remix-serve` to use dynamic import to support ESM and CJS build outputs ([#6949](https://github.com/remix-run/remix/pull/6949)) +- Remove `serverBuildTarget` config option ([#6896](https://github.com/remix-run/remix/pull/6896)) +- Remove deprecated `REMIX_DEV_HTTP_ORIGIN` env var - use `REMIX_DEV_ORIGIN` instead ([#6963](https://github.com/remix-run/remix/pull/6963)) +- Remove `devServerBroadcastDelay` config option ([#7063](https://github.com/remix-run/remix/pull/7063)) +- Remove deprecated `devServerPort` option - use `--port` / `dev.port` instead ([#7078](https://github.com/remix-run/remix/pull/7078)) +- Remove deprecated `REMIX_DEV_SERVER_WS_PORT` env var - use `remix dev`'s '`--port` / `port` option instead ([#6965](https://github.com/remix-run/remix/pull/6965)) +- Stop passing `isTypeScript` to `remix.init` script ([#7099](https://github.com/remix-run/remix/pull/7099)) +- Remove `replace-remix-magic-imports` codemod ([#6899](https://github.com/remix-run/remix/pull/6899)) +- Remove deprecated `--no-restart`/`restart` cli args/flags - use `--manual`/`manual` instead ([#6962](https://github.com/remix-run/remix/pull/6962)) +- Remove deprecated `--scheme`/`scheme` and `--host`/`host` cli args/flags - use `REMIX_DEV_ORIGIN` instead ([#6962](https://github.com/remix-run/remix/pull/6962)) +- Promote the `future.v2_dev` flag in `remix.config.js` to a root level `dev` config ([#7002](https://github.com/remix-run/remix/pull/7002)) +- Remove `browserBuildDirectory` config option ([#6900](https://github.com/remix-run/remix/pull/6900)) +- Remove `serverBuildDirectory` config option (\[#6897]\( Remove `codemod` command ([#6918](https://github.com/remix-run/remix/pull/6918)) + 6897\)) +- Removed support for "magic exports" from the `remix` package. This package can be removed from your `package.json` and you should update all imports to use the source `@remix-run/*` packages: ([#6895](https://github.com/remix-run/remix/pull/6895)) + + ```diff + - import type { ActionArgs } from "remix"; + - import { json, useLoaderData } from "remix"; + + import type { ActionArgs } from "@remix-run/node"; + + import { json } from "@remix-run/node"; + + import { useLoaderData } from "@remix-run/react"; + ``` + +### Minor Changes + +- Warn users about obsolete future flags in `remix.config.js` ([#7048](https://github.com/remix-run/remix/pull/7048)) +- Detect built mode via `build.mode` ([#6964](https://github.com/remix-run/remix/pull/6964)) + - Prevents mode mismatch between built Remix server entry and user-land server + - Additionally, all runtimes (including non-Node runtimes) can use `build.mode` to determine if HMR should be performed +- Support `bun` package manager ([#7074](https://github.com/remix-run/remix/pull/7074)) +- The `serverNodeBuiltinsPolyfill` option (along with the newly added `browserNodeBuiltinsPolyfill`) now supports defining global polyfills in addition to module polyfills ([#7269](https://github.com/remix-run/remix/pull/7269)) + + - For example, to polyfill Node's `Buffer` global: + + ```js + module.exports = { + serverNodeBuiltinsPolyfill: { + globals: { + Buffer: true, + }, + // You'll probably need to polyfill the "buffer" module + // too since the global polyfill imports this: + modules: { + buffer: true, + }, + }, + }; + ``` + +### Patch Changes + +- Fix importing of PNGs, SVGs, and other assets from packages in `node_modules` ([#6813](https://github.com/remix-run/remix/pull/6813), [#7182](https://github.com/remix-run/remix/pull/7182)) + +- Decouple the `@remix-run/dev` package from the contents of the `@remix-run/css-bundle` package. ([#6982](https://github.com/remix-run/remix/pull/6982)) + + - The contents of the `@remix-run/css-bundle` package are now entirely managed by the Remix compiler + - Even though it's still recommended that your Remix dependencies all share the same version, this change ensures that there are no runtime errors when upgrading `@remix-run/dev` without upgrading `@remix-run/css-bundle` + +- Allow non-development modes for `remix watch` ([#7117](https://github.com/remix-run/remix/pull/7117)) + +- Stop `remix dev` when `esbuild` is not running ([#7158](https://github.com/remix-run/remix/pull/7158)) + +- Do not interpret JSX in `.ts` files ([#7306](https://github.com/remix-run/remix/pull/7306)) + + - While JSX is supported in `.js` files for compatibility with existing apps and libraries, + `.ts` files should not contain JSX. By not interpreting `.ts` files as JSX, `.ts` files + can contain single-argument type generics without needing a comma to disambiguate from JSX: + + ```ts + // this works in .ts files + const id = (x: T) => x; + // ^ single-argument type generic + ``` + + ```tsx + // this doesn't work in .tsx files + const id = (x: T) => x; + // ^ is this a JSX element? or a single-argument type generic? + ``` + + ```tsx + // this works in .tsx files + const id = (x: T) => x; + // ^ comma: this is a generic, not a JSX element + const component =

hello

; + // ^ no comma: this is a JSX element + ``` + +- Enhance obsolete flag warning for `future.v2_dev` if it was an object, and prompt users to lift it to the root `dev` config ([#7427](https://github.com/remix-run/remix/pull/7427)) + +- Allow decorators in app code ([#7176](https://github.com/remix-run/remix/pull/7176)) + +- Allow JSX in `.js` files during HMR ([#7112](https://github.com/remix-run/remix/pull/7112)) + +- Kill app server when remix dev terminates ([#7280](https://github.com/remix-run/remix/pull/7280)) + +- Support dependencies that import polyfill packages for Node built-ins via a trailing slash (e.g. importing the `buffer` package with `var Buffer = require('buffer/').Buffer` as recommended in their README) ([#7198](https://github.com/remix-run/remix/pull/7198)) + + - These imports were previously marked as external + - This meant that they were left as dynamic imports in the client bundle and would throw a runtime error in the browser (e.g. `Dynamic require of "buffer/" is not supported`) + +- Surface errors when PostCSS config is invalid ([#7391](https://github.com/remix-run/remix/pull/7391)) + +- Restart dev server when Remix config changes ([#7269](https://github.com/remix-run/remix/pull/7269)) + +- Remove outdated ESM import warnings ([#6916](https://github.com/remix-run/remix/pull/6916)) + + - Most of the time these warnings were false positives. + - Instead, we now rely on built-in Node warnings for ESM imports. + +- Do not trigger rebuilds when `.DS_Store` changes ([#7172](https://github.com/remix-run/remix/pull/7172)) + +- Remove warnings for stabilized flags: ([#6905](https://github.com/remix-run/remix/pull/6905)) + + - `unstable_cssSideEffectImports` + - `unstable_cssModules` + - `unstable_vanillaExtract` + +- Allow any mode (`NODE_ENV`) ([#7113](https://github.com/remix-run/remix/pull/7113)) + +- Replace the deprecated [`xdm`](https://github.com/wooorm/xdm) package with [`@mdx-js/mdx`](https://github.com/mdx-js/mdx) ([#4054](https://github.com/remix-run/remix/pull/4054)) + +- Write a `version.txt` sentinel file _after_ server build is completely written ([#7299](https://github.com/remix-run/remix/pull/7299)) + +- Updated dependencies: + - `@remix-run/server-runtime@2.0.0` + +## 1.19.3 + +### Patch Changes + +- Show deprecation warning when using `devServerBroadcastDelay` and `devServerPort` config options ([#7064](https://github.com/remix-run/remix/pull/7064)) +- Updated dependencies: + - `@remix-run/server-runtime@1.19.3` + +## 1.19.2 + +### Patch Changes + +- Update `proxy-agent` to resolve npm audit security vulnerability ([#7027](https://github.com/remix-run/remix/pull/7027)) +- Updated dependencies: + - `@remix-run/server-runtime@1.19.2` + +## 1.19.1 + +### Patch Changes + +- Add a heartbeat ping to prevent the WebSocket connection from being closed due to inactivity when using a proxy like Cloudflare ([#6904](https://github.com/remix-run/remix/pull/6904), [#6927](https://github.com/remix-run/remix/pull/6927)) +- Treeshake out HMR code from production builds ([#6894](https://github.com/remix-run/remix/pull/6894)) +- Updated dependencies: + - `@remix-run/server-runtime@1.19.1` + +## 1.19.0 + +### Minor Changes + +- improved networking options for `v2_dev` ([#6724](https://github.com/remix-run/remix/pull/6724)) + + deprecate the `--scheme` and `--host` options and replace them with the `REMIX_DEV_ORIGIN` environment variable + +- Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772)) + + Written to server build directory (`build/` by default): + + - `metafile.css.json` + - `metafile.js.json` (browser JS) + - `metafile.server.json` (server JS) + + Metafiles can be uploaded to for analysis. + +- Add `serverNodeBuiltinsPolyfill` config option. In `remix.config.js` you can now disable polyfills of Node.js built-in modules for non-Node.js server platforms, or opt into a subset of polyfills. ([#6814](https://github.com/remix-run/remix/pull/6814), [#6859](https://github.com/remix-run/remix/pull/6859), [#6877](https://github.com/remix-run/remix/pull/6877)) + + ```js + // Disable all polyfills + exports.serverNodeBuiltinsPolyfill = { modules: {} }; + + // Enable specific polyfills + exports.serverNodeBuiltinsPolyfill = { + modules: { + crypto: true, // Provide a JSPM polyfill + fs: "empty", // Provide an empty polyfill + }, + }; + ``` + +### Patch Changes + +- ignore missing react-dom/client for react 17 ([#6725](https://github.com/remix-run/remix/pull/6725)) + +- Warn if not using `v2_dev` ([#6818](https://github.com/remix-run/remix/pull/6818)) + + Also, rename `--no-restart` to `--manual` to match intention and documentation. + `--no-restart` remains an alias for `--manual` in v1 for backwards compatibility. + +- ignore errors when killing already dead processes ([#6773](https://github.com/remix-run/remix/pull/6773)) + +- Always rewrite css-derived assets during builds ([#6837](https://github.com/remix-run/remix/pull/6837)) + +- fix sourcemaps for `v2_dev` ([#6762](https://github.com/remix-run/remix/pull/6762)) + +- Do not clear screen when dev server starts ([#6719](https://github.com/remix-run/remix/pull/6719)) + + On some terminal emulators, "clearing" only scrolls the next line to the + top. on others, it erases the scrollback. + + Instead, let users call `clear` themselves (`clear && remix dev`) if + they want to clear. + +- Updated dependencies: + - `@remix-run/server-runtime@1.19.0` + +## 1.18.1 + +### Patch Changes + +- Ignore missing `react-dom/client` for React 17 ([#6725](https://github.com/remix-run/remix/pull/6725)) +- Updated dependencies: + - `@remix-run/server-runtime@1.18.1` + +## 1.18.0 + +### Minor Changes + +- stabilize v2 dev server ([#6615](https://github.com/remix-run/remix/pull/6615)) +- improved logging for `remix build` and `remix dev` ([#6596](https://github.com/remix-run/remix/pull/6596)) + +### Patch Changes + +- fix docs links for msw and mkcert ([#6672](https://github.com/remix-run/remix/pull/6672)) +- fix `remix dev -c`: kill all descendant processes of specified command when restarting ([#6663](https://github.com/remix-run/remix/pull/6663)) +- Add caching to regular stylesheet compilation ([#6638](https://github.com/remix-run/remix/pull/6638)) +- Rename `Architect (AWS Lambda)` -> `Architect` in the `create-remix` CLI to avoid confusion for other methods of deploying to AWS (i.e., SST) ([#6484](https://github.com/remix-run/remix/pull/6484)) +- Improve CSS bundle build performance by skipping unused Node polyfills ([#6639](https://github.com/remix-run/remix/pull/6639)) +- Improve performance of CSS bundle build by skipping compilation of Remix/React packages that are known not to contain CSS imports ([#6654](https://github.com/remix-run/remix/pull/6654)) +- Cache CSS side-effect imports transform when using HMR ([#6622](https://github.com/remix-run/remix/pull/6622)) +- Fix bug with pathless layout routes beneath nested path segments ([#6649](https://github.com/remix-run/remix/pull/6649)) +- Add caching to PostCSS for CSS Modules ([#6604](https://github.com/remix-run/remix/pull/6604)) +- Add caching to PostCSS for side-effect imports ([#6554](https://github.com/remix-run/remix/pull/6554)) +- cache getRouteModuleExports calls to significantly speed up build and HMR rebuild times ([#6629](https://github.com/remix-run/remix/pull/6629)) +- group rebuild logs with surrounding whitespace ([#6607](https://github.com/remix-run/remix/pull/6607)) +- instructions for integrating with msw ([#6669](https://github.com/remix-run/remix/pull/6669)) +- Update minimum version of `esbuild-plugins-node-modules-polyfill` to 1.0.16 to ensure that the plugin is cached ([#6652](https://github.com/remix-run/remix/pull/6652)) +- Updated dependencies: + - `@remix-run/server-runtime@1.18.0` + +## 1.17.1 + +### Patch Changes + +- Replace `esbuild-plugin-polyfill-node` with `esbuild-plugins-node-modules-polyfill` ([#6562](https://github.com/remix-run/remix/pull/6562)) +- Lazily generate CSS bundle when import of `@remix-run/css-bundle` is detected ([#6535](https://github.com/remix-run/remix/pull/6535)) +- Updated dependencies: + - `@remix-run/server-runtime@1.17.1` + +## 1.17.0 + +### Minor Changes + +- built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483)) + + New options: + + - `--tls-key` / `tlsKey`: TLS key + - `--tls-cert` / `tlsCert`: TLS Certificate + + If both TLS options are set, `scheme` defaults to `https` + + ## Example + + Install [mkcert](https://github.com/FiloSottile/mkcert) and create a local CA: + + ```sh + brew install mkcert + mkcert -install + ``` + + Then make sure you inform `node` about your CA certs: + + ```sh + export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" + ``` + + 👆 You'll probably want to put that env var in your scripts or `.bashrc`/`.zshrc` + + Now create `key.pem` and `cert.pem`: + + ```sh + mkcert -key-file key.pem -cert-file cert.pem localhost + ``` + + See `mkcert` docs for more details. + + Finally, pass in the paths to the key and cert via flags: + + ```sh + remix dev --tls-key=key.pem --tls-cert=cert.pem + ``` + + or via config: + + ```js + module.exports = { + future: { + unstable_dev: { + tlsKey: "key.pem", + tlsCert: "cert.pem", + }, + }, + }; + ``` + + That's all that's needed to set up the Remix Dev Server with TLS. + + 🚨 Make sure to update your app server for TLS as well. + + For example, with `express`: + + ```ts + import fs from "node:fs"; + import https from "node:https"; + + import express from "express"; + + const app = express(); + + // ...code setting up your express app... + + const appServer = https.createServer( + { + key: fs.readFileSync("key.pem"), + cert: fs.readFileSync("cert.pem"), + }, + app + ); + + appServer.listen(3000, () => { + console.log("Ready on https://localhost:3000"); + }); + ``` + + ## Known limitations + + `remix-serve` does not yet support TLS. + That means this only works for custom app server using the `-c` flag for now. + +- Reuse dev server port for WebSocket (Live Reload,HMR,HDR) ([#6476](https://github.com/remix-run/remix/pull/6476)) + + As a result the `webSocketPort`/`--websocket-port` option has been obsoleted. + Additionally, scheme/host/port options for the dev server have been renamed. + + Available options are: + + | Option | flag | config | default | + | ---------- | ------------------ | ---------------- | --------------------------------- | + | Command | `-c` / `--command` | `command` | `remix-serve ` | + | Scheme | `--scheme` | `scheme` | `http` | + | Host | `--host` | `host` | `localhost` | + | Port | `--port` | `port` | Dynamically chosen open port | + | No restart | `--no-restart` | `restart: false` | `restart: true` | + + Note that scheme/host/port options are for the _dev server_, not your app server. + You probably don't need to use scheme/host/port option if you aren't configuring networking (e.g. for Docker or SSL). + +### Patch Changes + +- Add caching to PostCSS for regular stylesheets ([#6505](https://github.com/remix-run/remix/pull/6505)) + +- Fix warnings when importing CSS files with `future.unstable_dev` enabled ([#6506](https://github.com/remix-run/remix/pull/6506)) + +- Fix Tailwind performance issue when `postcss.config.js` contains `plugins: { tailwindcss: {} }` and `remix.config.js` contains both `tailwind: true` and `postcss: true`. ([#6468](https://github.com/remix-run/remix/pull/6468)) + + Note that this was _not_ an issue when the plugin function had been explicitly called, i.e. `plugins: [tailwindcss()]`. Remix avoids adding the Tailwind plugin to PostCSS if it's already present but we were failing to detect when the plugin function hadn't been called — either because the plugin function itself had been passed, i.e. `plugins: [require('tailwindcss')]`, or the plugin config object syntax had been used, i.e. `plugins: { tailwindcss: {} }`. + +- Faster server export removal for routes when `unstable_dev` is enabled. ([#6455](https://github.com/remix-run/remix/pull/6455)) + + Also, only render modulepreloads on SSR. + Do not render modulepreloads when hydrated. + +- Add `HeadersArgs` type to be consistent with loaders/actions/meta and allows for using a `function` declaration in addition to an arrow function expression ([#6247](https://github.com/remix-run/remix/pull/6247)) + + ```tsx + import type { HeadersArgs } from "@remix-run/node"; // or cloudflare/deno + + export function headers({ loaderHeaders }: HeadersArgs) { + return { + "x-my-custom-thing": loaderHeaders.get("x-my-custom-thing") || "fallback", + }; + } + ``` + +- better error message when `remix-serve` is not found ([#6477](https://github.com/remix-run/remix/pull/6477)) + +- restore color for app server output ([#6485](https://github.com/remix-run/remix/pull/6485)) + +- Fix route ranking bug with pathless layout route next to a sibling index route ([#4421](https://github.com/remix-run/remix/pull/4421)) + + - Under the hood this is done by removing the trailing slash from all generated `path` values since the number of slash-delimited segments counts towards route ranking so the trailing slash incorrectly increases the score for routes + +- Support sibling pathless layout routes by removing pathless layout routes from the unique route path checks in conventional route generation since they inherently trigger duplicate paths ([#4421](https://github.com/remix-run/remix/pull/4421)) + +- fix dev server crashes caused by ungraceful hdr error handling ([#6467](https://github.com/remix-run/remix/pull/6467)) + +- Updated dependencies: + - `@remix-run/server-runtime@1.17.0` + +## 1.16.1 + +### Patch Changes + +- Cross-module `loader` change detection for HDR ([#6299](https://github.com/remix-run/remix/pull/6299)) +- Normalize path for dev server `PATH` envvar so that it works cross-platform (e.g. Windows) ([#6310](https://github.com/remix-run/remix/pull/6310)) +- Fix CSS imports in JS files that use JSX ([#6309](https://github.com/remix-run/remix/pull/6309)) +- Kill app server when dev server exits ([#6395](https://github.com/remix-run/remix/pull/6395)) +- Wait until app server is killed before starting a new app server ([#6289](https://github.com/remix-run/remix/pull/6289)) +- Ensure CSS bundle changes result in a new manifest hash ([#6374](https://github.com/remix-run/remix/pull/6374)) +- Normalize file paths before testing if a changed file is a route entry ([#6293](https://github.com/remix-run/remix/pull/6293)) +- Fix race where app server responds with updated manifest version _before_ dev server is listening for it ([#6294](https://github.com/remix-run/remix/pull/6294)) + - dev server now listens for updated versions _before_ writing the server changes, guaranteeing that it is listening before the app server gets a chance to send its 'ready' message +- Only process `.css.ts`/`.css.js` files with Vanilla Extract if `@vanilla-extract/css` is installed ([#6345](https://github.com/remix-run/remix/pull/6345)) +- Stop modifying a user's `tsconfig.json` when running using `getConfig` (`remix dev`, `remix routes`, `remix build`, etc) ([#6156](https://github.com/remix-run/remix/pull/6156)) +- Cancel previous build when rebuild is kicked off to prevent rebuilds from hanging ([#6295](https://github.com/remix-run/remix/pull/6295)) +- Update minimum version of Babel dependencies to avoid errors parsing decorators ([#6390](https://github.com/remix-run/remix/pull/6390)) +- Support asset imports when detecting loader changes for HDR ([#6396](https://github.com/remix-run/remix/pull/6396)) +- Updated dependencies: + - `@remix-run/server-runtime@1.16.1` + +## 1.16.0 + +### Minor Changes + +- Enable support for [CSS Modules](https://github.com/css-modules/css-modules), [Vanilla Extract](http://vanilla-extract.style) and CSS side-effect imports ([#6046](https://github.com/remix-run/remix/pull/6046)) + + These CSS bundling features were previously only available via `future.unstable_cssModules`, `future.unstable_vanillaExtract` and `future.unstable_cssSideEffectImports` options in `remix.config.js`, but they have now been stabilized. + + In order to use these features, check out our guide to [CSS bundling](https://remix.run/docs/en/1.16.0/guides/styling#css-bundling) in your project. + +- Stabilize built-in PostCSS support via the new `postcss` option in `remix.config.js`. As a result, the `future.unstable_postcss` option has also been deprecated. ([#5960](https://github.com/remix-run/remix/pull/5960)) + + The `postcss` option is `false` by default, but when set to `true` will enable processing of all CSS files using PostCSS if `postcss.config.js` is present. + + If you followed the original PostCSS setup guide for Remix, you may have a folder structure that looks like this, separating your source files from its processed output: + + . + ├── app + │ └── styles (processed files) + │ ├── app.css + │ └── routes + │ └── index.css + └── styles (source files) + ├── app.css + └── routes + └── index.css + + After you've enabled the new `postcss` option, you can delete the processed files from `app/styles` folder and move your source files from `styles` to `app/styles`: + + . + ├── app + │ └── styles (source files) + │ ├── app.css + │ └── routes + │ └── index.css + + You should then remove `app/styles` from your `.gitignore` file since it now contains source files rather than processed output. + + You can then update your `package.json` scripts to remove any usage of `postcss` since Remix handles this automatically. For example, if you had followed the original setup guide: + + ```diff + { + "scripts": { + - "dev:css": "postcss styles --base styles --dir app/styles -w", + - "build:css": "postcss styles --base styles --dir app/styles --env production", + - "dev": "concurrently \"npm run dev:css\" \"remix dev\"" + + "dev": "remix dev" + } + } + ``` + +- Stabilize built-in Tailwind support via the new `tailwind` option in `remix.config.js`. As a result, the `future.unstable_tailwind` option has also been deprecated. ([#5960](https://github.com/remix-run/remix/pull/5960)) + + The `tailwind` option is `false` by default, but when set to `true` will enable built-in support for Tailwind functions and directives in your CSS files if `tailwindcss` is installed. + + If you followed the original Tailwind setup guide for Remix and want to make use of this feature, you should first delete the generated `app/tailwind.css`. + + Then, if you have a `styles/tailwind.css` file, you should move it to `app/tailwind.css`. + + ```sh + rm app/tailwind.css + mv styles/tailwind.css app/tailwind.css + ``` + + Otherwise, if you don't already have an `app/tailwind.css` file, you should create one with the following contents: + + ```css + @tailwind base; + @tailwind components; + @tailwind utilities; + ``` + + You should then remove `/app/tailwind.css` from your `.gitignore` file since it now contains source code rather than processed output. + + You can then update your `package.json` scripts to remove any usage of `tailwindcss` since Remix handles this automatically. For example, if you had followed the original setup guide: + + ```diff + { + // ... + "scripts": { + - "build": "run-s \"build:*\"", + + "build": "remix build", + - "build:css": "npm run generate:css -- --minify", + - "build:remix": "remix build", + - "dev": "run-p \"dev:*\"", + + "dev": "remix dev", + - "dev:css": "npm run generate:css -- --watch", + - "dev:remix": "remix dev", + - "generate:css": "npx tailwindcss -o ./app/tailwind.css", + "start": "remix-serve build" + } + // ... + } + ``` + +- The Remix dev server spins up your app server as a managed subprocess. ([#6133](https://github.com/remix-run/remix/pull/6133)) + This keeps your development environment as close to production as possible. + It also means that the Remix dev server is compatible with _any_ app server. + + By default, the dev server will use the Remix App Server, but you opt to use your own app server by specifying the command to run it via the `-c`/`--command` flag: + + ```sh + remix dev # uses `remix-serve ` as the app server + remix dev -c "node ./server.js" # uses your custom app server at `./server.js` + ``` + + The dev server will: + + - force `NODE_ENV=development` and warn you if it was previously set to something else + - rebuild your app whenever your Remix app code changes + - restart your app server whenever rebuilds succeed + - handle live reload and HMR + Hot Data Revalidation + + ### App server coordination + + In order to manage your app server, the dev server needs to be told what server build is currently being used by your app server. + This works by having the app server send a "I'm ready!" message with the Remix server build hash as the payload. + + This is handled automatically in Remix App Server and is set up for you via calls to `broadcastDevReady` or `logDevReady` in the official Remix templates. + + If you are not using Remix App Server and your server doesn't call `broadcastDevReady`, you'll need to call it in your app server _after_ it is up and running. + For example, in an Express server: + + ```js + // server.js + // + import { broadcastDevReady } from "@remix-run/node"; + + // Path to Remix's server build directory ('build/' by default) + const BUILD_DIR = path.join(process.cwd(), "build"); + + // + + app.listen(3000, () => { + const build = require(BUILD_DIR); + console.log("Ready: http://localhost:" + port); + + // in development, call `broadcastDevReady` _after_ your server is up and running + if (process.env.NODE_ENV === "development") { + broadcastDevReady(build); + } + }); + ``` + + ### Options + + Options priority order is: 1. flags, 2. config, 3. defaults. + + | Option | flag | config | default | + | -------------- | ------------------ | ---------------- | --------------------------------- | + | Command | `-c` / `--command` | `command` | `remix-serve ` | + | HTTP(S) scheme | `--http-scheme` | `httpScheme` | `http` | + | HTTP(S) host | `--http-host` | `httpHost` | `localhost` | + | HTTP(S) port | `--http-port` | `httpPort` | Dynamically chosen open port | + | Websocket port | `--websocket-port` | `websocketPort` | Dynamically chosen open port | + | No restart | `--no-restart` | `restart: false` | `restart: true` | + + 🚨 The `--http-*` flags are only used for internal dev server <-> app server communication. + Your app will run on your app server's normal URL. + + To set `unstable_dev` configuration, replace `unstable_dev: true` with `unstable_dev: { }`. + For example, to set the HTTP(S) port statically: + + ```js + // remix.config.js + module.exports = { + future: { + unstable_dev: { + httpPort: 8001, + }, + }, + }; + ``` + + #### SSL and custom hosts + + You should only need to use the `--http-*` flags and `--websocket-port` flag if you need fine-grain control of what scheme/host/port for the dev server. + If you are setting up SSL or Docker networking, these are the flags you'll want to use. + + 🚨 Remix **will not** set up SSL and custom host for you. + The `--http-scheme` and `--http-host` flag are for you to tell Remix how you've set things up. + It is your task to set up SSL certificates and host files if you want those features. + + #### `--no-restart` and `require` cache purging + + If you want to manage server changes yourself, you can use the `--no-restart` flag to tell the dev server to refrain from restarting your app server when builds succeed: + + ```sh + remix dev -c "node ./server.js" --no-restart + ``` + + For example, you could purge the `require` cache of your app server to keep it running while picking up server changes. + If you do so, you should watch the server build path (`build/` by default) for changes and only purge the `require` cache when changes are detected. + + 🚨 If you use `--no-restart`, it is your responsibility to call `broadcastDevReady` when your app server has picked up server changes. + For example, with `chokidar`: + + ```js + // server.dev.js + const BUILD_PATH = path.resolve(__dirname, "build"); + + const watcher = chokidar.watch(BUILD_PATH); + + watcher.on("change", () => { + // 1. purge require cache + purgeRequireCache(); + // 2. load updated server build + const build = require(BUILD_PATH); + // 3. tell dev server that this app server is now ready + broadcastDevReady(build); + }); + ``` + +### Patch Changes + +- Fix absolute paths in CSS `url()` rules when using CSS Modules, Vanilla Extract and CSS side-effect imports ([#5788](https://github.com/remix-run/remix/pull/5788)) +- look for @remix-run/serve in `devDependencies` when running remix dev ([#6228](https://github.com/remix-run/remix/pull/6228)) +- add warning for v2 "cjs"->"esm" `serverModuleFormat` default change ([#6154](https://github.com/remix-run/remix/pull/6154)) +- write mjs server output files ([#6225](https://github.com/remix-run/remix/pull/6225)) +- fix(react,dev): dev chunking and refresh race condition ([#6201](https://github.com/remix-run/remix/pull/6201)) +- Use correct require context in `bareImports` plugin. ([#6181](https://github.com/remix-run/remix/pull/6181)) +- use minimatch for regex instead of glob-to-regexp ([#6017](https://github.com/remix-run/remix/pull/6017)) +- add `logDevReady` as replacement for platforms that can't initialize async I/O outside of the request response lifecycle. ([#6204](https://github.com/remix-run/remix/pull/6204)) +- Use the "automatic" JSX runtime when processing MDX files. ([#6098](https://github.com/remix-run/remix/pull/6098)) +- forcibly kill app server during dev ([#6197](https://github.com/remix-run/remix/pull/6197)) +- show first compilation error instead of cancelation errors ([#6202](https://github.com/remix-run/remix/pull/6202)) +- Resolve imports from route modules across the graph back to the virtual module created by the v2 routes plugin. This fixes issues where we would duplicate portions of route modules that were imported. ([#6098](https://github.com/remix-run/remix/pull/6098)) +- Updated dependencies: + - `@remix-run/server-runtime@1.16.0` + +## 1.15.0 + +### Minor Changes + +- Added deprecation warning for `v2_normalizeFormMethod` ([#5863](https://github.com/remix-run/remix/pull/5863)) + +- Added a new `future.v2_normalizeFormMethod` flag to normalize the exposed `useNavigation().formMethod` as an uppercase HTTP method to align with the previous `useTransition` behavior as well as the `fetch()` behavior of normalizing to uppercase HTTP methods. ([#5815](https://github.com/remix-run/remix/pull/5815)) + + - When `future.v2_normalizeFormMethod === false`, + - `useNavigation().formMethod` is lowercase + - `useFetcher().formMethod` is uppercase + - When `future.v2_normalizeFormMethod === true`: + - `useNavigation().formMethod` is uppercase + - `useFetcher().formMethod` is uppercase + +- Added deprecation warning for `browserBuildDirectory` in `remix.config` ([#5702](https://github.com/remix-run/remix/pull/5702)) + +- Added deprecation warning for `CatchBoundary` in favor of `future.v2_errorBoundary` ([#5718](https://github.com/remix-run/remix/pull/5718)) + +- Added experimental support for Vanilla Extract caching, which can be enabled by setting `future.unstable_vanillaExtract: { cache: true }` in `remix.config`. This is considered experimental due to the use of a brand new Vanilla Extract compiler under the hood. In order to use this feature, you must be using at least `v1.10.0` of `@vanilla-extract/css`. ([#5735](https://github.com/remix-run/remix/pull/5735)) + +- Added deprecation warning for `serverBuildDirectory` in `remix.config` ([#5704](https://github.com/remix-run/remix/pull/5704)) + +### Patch Changes + +- Fixed issue to ensure changes to CSS inserted via `@remix-run/css-bundle` are picked up during HMR ([#5823](https://github.com/remix-run/remix/pull/5823)) +- We now use `path.resolve` when re-exporting `entry.client` ([#5707](https://github.com/remix-run/remix/pull/5707)) +- Added support for `.mjs` and `.cjs` extensions when detecting CSS side-effect imports ([#5564](https://github.com/remix-run/remix/pull/5564)) +- Fixed resolution issues for pnpm users installing `react-refresh` ([#5637](https://github.com/remix-run/remix/pull/5637)) +- Added deprecation warning for `future.v2_meta` ([#5878](https://github.com/remix-run/remix/pull/5878)) +- Added optional entry file support for React 17 ([#5681](https://github.com/remix-run/remix/pull/5681)) +- Updated dependencies: + - `@remix-run/server-runtime@1.15.0` + +## 1.14.3 + +### Patch Changes + +- dev server is resilient to build failures ([#5795](https://github.com/remix-run/remix/pull/5795)) +- Updated dependencies: + - `@remix-run/server-runtime@1.14.3` + +## 1.14.2 + +### Patch Changes + +- remove premature deprecation warnings ([#5790](https://github.com/remix-run/remix/pull/5790)) +- Updated dependencies: + - `@remix-run/server-runtime@1.14.2` + +## 1.14.1 + +### Patch Changes + +- Add types for importing `*.ico` files ([#5430](https://github.com/remix-run/remix/pull/5430)) +- Allow `moduleResolution: "bundler"` in tsconfig.json ([#5576](https://github.com/remix-run/remix/pull/5576)) +- Fix issue with x-route imports creating multiple entries in the module graph ([#5721](https://github.com/remix-run/remix/pull/5721)) +- Add `serverBuildTarget` deprecation warning ([#5624](https://github.com/remix-run/remix/pull/5624)) +- Updated dependencies: + - `@remix-run/server-runtime@1.14.1` + +## 1.14.0 + +### Minor Changes + +- Hot Module Replacement and Hot Data Revalidation ([#5259](https://github.com/remix-run/remix/pull/5259)) + - Requires `unstable_dev` future flag to be enabled + - HMR provided through React Refresh + - Features: + - HMR for component and style changes + - HDR when loaders for current route change + - Known limitations for MVP: + - Only implemented for React via React Refresh + - No `import.meta.hot` API exposed yet + - Revalidates _all_ loaders on route when loader changes are detected + - Loader changes do not account for imported dependencies changing +- Make `entry.client` and `entry.server` files optional ([#4600](https://github.com/remix-run/remix/pull/4600)) + - we'll use a bundled version of each unless you provide your own + +### Patch Changes + +- Fixes flat route inconsistencies where `route.{ext}` wasn't always being treated like `index.{ext}` when used in a folder ([#5459](https://github.com/remix-run/remix/pull/5459)) + + - Route conflict no longer throw errors and instead display a helpful warning that we're using the first one we found. + + ```log + ⚠️ Route Path Collision: "/dashboard" + + The following routes all define the same URL, only the first one will be used + + 🟢️️ routes/dashboard/route.tsx + ⭕️️ routes/dashboard.tsx + ``` + + ```log + ⚠️ Route Path Collision: "/" + + The following routes all define the same URL, only the first one will be used + + 🟢️️ routes/_landing._index.tsx + ⭕️️ routes/_dashboard._index.tsx + ⭕️ routes/_index.tsx + ``` + +- Log errors thrown during initial build in development. ([#5441](https://github.com/remix-run/remix/pull/5441)) + +- Sync `FutureConfig` interface between packages ([#5398](https://github.com/remix-run/remix/pull/5398)) + +- Add file loader for importing `.csv` files ([#3920](https://github.com/remix-run/remix/pull/3920)) + +- Updated dependencies: + - `@remix-run/server-runtime@1.14.0` + +## 1.13.0 + +### Minor Changes + +- We are deprecating `serverBuildTarget` in `remix.config`. See the [release notes for v1.13.0](https://github.com/remix-run/remix/releases/tag/remix%401.13.0) for more information. ([#5354](https://github.com/remix-run/remix/pull/5354)) +- Add built-in support for PostCSS via the `future.unstable_postcss` feature flag ([#5229](https://github.com/remix-run/remix/pull/5229)) +- Add built-in support for Tailwind via the `future.unstable_tailwind` feature flag ([#5229](https://github.com/remix-run/remix/pull/5229)) + +### Patch Changes + +- Mark Vanilla Extract files as side effects to ensure that files only containing global styles aren't tree-shaken ([#5246](https://github.com/remix-run/remix/pull/5246)) +- Support decorators in files using CSS side-effect imports ([#5305](https://github.com/remix-run/remix/pull/5305)) +- We made several Flat route fixes and enhancements. See the [release notes for v1.13.0](https://github.com/remix-run/remix/releases/tag/remix%401.13.0) for more information. ([#5228](https://github.com/remix-run/remix/pull/5228)) +- Updated dependencies: + - `@remix-run/server-runtime@1.13.0` + +## 1.12.0 + +### Minor Changes + +- Added a new development server available in the Remix config under the `unstable_dev` flag. [See the release notes](https://github.com/remix-run/remix/releases/tag/remix%401.12.0) for a full description. ([#5133](https://github.com/remix-run/remix/pull/5133)) + +### Patch Changes + +- Fixed issues with `v2_routeConvention` on Windows so that new and renamed files are properly included ([#5266](https://github.com/remix-run/remix/pull/5266)) +- Server build should not be removed in `remix watch` and `remix dev` ([#5228](https://github.com/remix-run/remix/pull/5228)) +- The dev server will now clean up build directories whenever a rebuild starts ([#5223](https://github.com/remix-run/remix/pull/5223)) +- Updated dependencies: + - `@remix-run/server-runtime@1.12.0` + +## 1.11.1 + +### Patch Changes + +- Fixed a bug with `v2_routeConvention` that prevented `index` modules from being recognized for route paths ([`195291a3d`](https://github.com/remix-run/remix/commit/195291a3d8c0e098931199bcc26277a45cee0eb9)) +- Updated dependencies: + - `@remix-run/server-runtime@1.11.1` + +## 1.11.0 + +### Minor Changes + +- Specify file loader for `.fbx`, `.glb`, `.gltf`, `.hdr`, and `.mov` files ([#5030](https://github.com/remix-run/remix/pull/5030)) +- Added support for [Vanilla Extract](https://vanilla-extract.style) via the `unstable_vanillaExtract` future flag. **IMPORTANT:** Features marked with `unstable` are … unstable. While we're confident in the use cases they solve, the API and implementation may change without a major version bump. ([#5040](https://github.com/remix-run/remix/pull/5040)) +- Add support for CSS side-effect imports via the `unstable_cssSideEffectImports` future flag. **IMPORTANT:** Features marked with `unstable` are … unstable. While we're confident in the use cases they solve, the API and implementation may change without a major version bump. ([#4919](https://github.com/remix-run/remix/pull/4919)) +- Add support for CSS Modules via the `unstable_cssModules` future flag. **IMPORTANT:** Features marked with `unstable` are … unstable. While we're confident in the use cases they solve, the API and implementation may change without a major version bump. ([#4852](https://github.com/remix-run/remix/pull/4852)) + +### Patch Changes + +- Add new "flat" routing conventions. This convention will be the default in v2 but is available now under the `v2_routeConvention` future flag. ([#4880](https://github.com/remix-run/remix/pull/4880)) +- Added support for `handle` in MDX frontmatter ([#4865](https://github.com/remix-run/remix/pull/4865)) +- Updated dependencies: + - `@remix-run/server-runtime@1.11.0` + +## 1.10.1 + +### Patch Changes + +- Update babel config to transpile down to node 14 ([#5047](https://github.com/remix-run/remix/pull/5047)) +- Updated dependencies: + - `@remix-run/server-runtime@1.10.1` + +## 1.10.0 + +### Patch Changes + +- Fixed several issues with TypeScript to JavaScript conversion when running `create-remix` ([#4891](https://github.com/remix-run/remix/pull/4891)) +- Resolve asset entry full path to support monorepo import of styles ([#4855](https://github.com/remix-run/remix/pull/4855)) +- Updated dependencies: + - `@remix-run/server-runtime@1.10.0` + +## 1.9.0 + +### Minor Changes + +- Allow defining multiple routes for the same route module file ([#3970](https://github.com/remix-run/remix/pull/3970)) +- Added support and conventions for optional route segments ([#4706](https://github.com/remix-run/remix/pull/4706)) + +### Patch Changes + +- The Remix compiler now supports new Typescript 4.9 syntax (like the `satisfies` keyword) ([#4754](https://github.com/remix-run/remix/pull/4754)) +- Optimize `parentRouteId` lookup in `defineConventionalRoutes`. ([#4800](https://github.com/remix-run/remix/pull/4800)) +- Fixed a bug in `.ts` -> `.js` conversion on Windows by using a relative unix-style path ([#4718](https://github.com/remix-run/remix/pull/4718)) +- Updated dependencies: + - `@remix-run/server-runtime@1.9.0` + +## 1.8.2 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@1.8.2` + - `@remix-run/serve@1.8.2` + +## 1.8.1 + +### Patch Changes + +- Added a missing type definition for the Remix config `future` option to the `@remix-run/dev/server-build` virtual module ([#4771](https://github.com/remix-run/remix/pull/4771)) +- Updated dependencies: + - `@remix-run/serve@1.8.1` + - `@remix-run/server-runtime@1.8.1` + +## 1.8.0 + +### Minor Changes + +- Added support for a new route `meta` API to handle arrays of tags instead of an object. For details, check out the [RFC](https://github.com/remix-run/remix/discussions/4462). ([#4610](https://github.com/remix-run/remix/pull/4610)) + +### Patch Changes + +- Importing functions and types from the `remix` package is deprecated, and all exported modules will be removed in the next major release. For more details,[see the release notes for 1.4.0](https://github.com/remix-run/remix/releases/tag/v1.4.0) where these changes were first announced. ([#4661](https://github.com/remix-run/remix/pull/4661)) +- Updated dependencies: + - `@remix-run/server-runtime@1.8.0` + - `@remix-run/serve@1.8.0` + +## 1.7.6 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/serve@1.7.6` + - `@remix-run/server-runtime@1.7.6` + +### Patch Changes + +- Updated dependencies: + - `@remix-run/serve@1.7.6-pre.0` + - `@remix-run/server-runtime@1.7.6-pre.0` + +## 1.7.5 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/serve@1.7.5` + - `@remix-run/server-runtime@1.7.5` + +## 1.7.4 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@1.7.4` + - `@remix-run/serve@1.7.4` + +## 1.7.3 + +### Patch Changes + +- Update `create-remix` to use the new examples repository when using `--template example/` ([#4208](https://github.com/remix-run/remix/pull/4208)) +- Add support for setting `moduleResolution` to `node`, `node16` or `nodenext` in `tsconfig.json`. ([#4034](https://github.com/remix-run/remix/pull/4034)) +- Add resources imported only by resource routes to `assetsBuildDirectory` ([#3841](https://github.com/remix-run/remix/pull/3841)) +- Ensure that any assets referenced in CSS files are hashed and copied to the `assetsBuildDirectory`. ([#4130](https://github.com/remix-run/remix/pull/4130)) +- Updated dependencies: + - `@remix-run/serve@1.7.3` + - `@remix-run/server-runtime@1.7.3` + +## 1.7.2 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@1.7.2` + - `@remix-run/serve@1.7.2` + +## 1.7.1 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@1.7.1` + - `@remix-run/serve@1.7.1` + +## 1.7.0 + +### Minor Changes + +- Added support for importing `.gql` and `.graphql` files as plain text ([#3923](https://github.com/remix-run/remix/pull/3923)) +- Added support for importing `.zip` and `.avif` files as resource URLs ([#3985](https://github.com/remix-run/remix/pull/3985)) + +### Patch Changes + +- Removed our compiler's React shim in favor of esbuild's new automatic JSX transform ([#3860](https://github.com/remix-run/remix/pull/3860)) +- Updated dependencies: + - `@remix-run/server-runtime@1.7.0` + - `@remix-run/serve@1.7.0` + +## 1.6.8 + +### Patch Changes + +- Added support for `.mjs` and `.cjs` file extensions for `remix.config` ([#3675](https://github.com/remix-run/remix/pull/3675)) +- Added support for importing `.sql` files as text content ([#3190](https://github.com/remix-run/remix/pull/3190)) +- Updated the compiler to make MDX builds deterministic (and a little faster!) ([#3966](https://github.com/remix-run/remix/pull/3966)) +- Updated dependencies: + - `@remix-run/server-runtime@1.6.8` + - `@remix-run/serve@1.6.8` + +## 1.6.7 + +### Patch Changes + +- Remove logical nullish assignment, which is incompatible with Node v14. ([#3880](https://github.com/remix-run/remix/pull/3880)) +- Don't show ESM warnings when consumed via dynamic import. ([#3872](https://github.com/remix-run/remix/pull/3872)) +- Updated dependencies: + - `@remix-run/serve@1.6.7` + - `@remix-run/server-runtime@1.6.7` + +## 1.6.6 + +### Patch Changes + +- Write server build output files so that only assets imported from resource routes are written to disk ([#3817](https://github.com/remix-run/remix/pull/3817)) +- Add support for exporting links in `.mdx` files ([#3801](https://github.com/remix-run/remix/pull/3801)) +- Ensure that build hashing is deterministic ([#2027](https://github.com/remix-run/remix/pull/2027)) +- Fix types for `@remix-run/dev/server-build` virtual module ([#3743](https://github.com/remix-run/remix/pull/3743)) +- Updated dependencies: + - `@remix-run/serve@1.6.6` + - `@remix-run/server-runtime@1.6.6` + +## 1.6.5 + +### Patch Changes + +- Update `serverBareModulesPlugin` warning to use full import path ([#3656](https://github.com/remix-run/remix/pull/3656)) +- Fix broken `--port` flag in `create-remix` ([#3694](https://github.com/remix-run/remix/pull/3694)) +- Updated dependencies + - `@remix-run/server-runtime` + - `@remix-run/serve` diff --git a/.yalc/@remix-run/dev/LICENSE.md b/.yalc/@remix-run/dev/LICENSE.md new file mode 100644 index 0000000..b14cd6c --- /dev/null +++ b/.yalc/@remix-run/dev/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) Remix Software Inc. 2020-2021 +Copyright (c) Shopify Inc. 2022-2023 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.yalc/@remix-run/dev/README.md b/.yalc/@remix-run/dev/README.md new file mode 100644 index 0000000..40685a7 --- /dev/null +++ b/.yalc/@remix-run/dev/README.md @@ -0,0 +1,13 @@ +# Welcome to Remix! + +[Remix](https://remix.run) is a web framework that helps you build better websites with React. + +To get started, open a new shell and run: + +```sh +npx create-remix@latest +``` + +Then follow the prompts you see in your terminal. + +For more information about Remix, [visit remix.run](https://remix.run)! diff --git a/.yalc/@remix-run/dev/dist/_virtual/_rollupPluginBabelHelpers.js b/.yalc/@remix-run/dev/dist/_virtual/_rollupPluginBabelHelpers.js new file mode 100644 index 0000000..dd7ccfa --- /dev/null +++ b/.yalc/@remix-run/dev/dist/_virtual/_rollupPluginBabelHelpers.js @@ -0,0 +1,64 @@ +/** + * @remix-run/dev v1.18.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} +function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} +function _classPrivateMethodGet(receiver, privateSet, fn) { + if (!privateSet.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return fn; +} +function _checkPrivateRedeclaration(obj, privateCollection) { + if (privateCollection.has(obj)) { + throw new TypeError("Cannot initialize the same private elements twice on an object"); + } +} +function _classPrivateMethodInitSpec(obj, privateSet) { + _checkPrivateRedeclaration(obj, privateSet); + privateSet.add(obj); +} + +exports.checkPrivateRedeclaration = _checkPrivateRedeclaration; +exports.classPrivateMethodGet = _classPrivateMethodGet; +exports.classPrivateMethodInitSpec = _classPrivateMethodInitSpec; +exports.defineProperty = _defineProperty; +exports.toPrimitive = _toPrimitive; +exports.toPropertyKey = _toPropertyKey; diff --git a/.yalc/@remix-run/dev/dist/cache.d.ts b/.yalc/@remix-run/dev/dist/cache.d.ts new file mode 100644 index 0000000..6115c6b --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cache.d.ts @@ -0,0 +1,2 @@ +export declare const putJson: (cachePath: string, key: string, data: any) => Promise; +export declare const getJson: (cachePath: string, key: string) => Promise; diff --git a/.yalc/@remix-run/dev/dist/cache.js b/.yalc/@remix-run/dev/dist/cache.js new file mode 100644 index 0000000..27db315 --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cache.js @@ -0,0 +1,21 @@ +/** + * @remix-run/dev v2.2.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var cacache = require('cacache'); + +const putJson = async (cachePath, key, data) => cacache.put(cachePath, key, JSON.stringify(data)); +const getJson = async (cachePath, key) => cacache.get(cachePath, key).then(obj => JSON.parse(obj.data.toString("utf-8"))); + +exports.getJson = getJson; +exports.putJson = putJson; diff --git a/.yalc/@remix-run/dev/dist/channel.d.ts b/.yalc/@remix-run/dev/dist/channel.d.ts new file mode 100644 index 0000000..9bf8d11 --- /dev/null +++ b/.yalc/@remix-run/dev/dist/channel.d.ts @@ -0,0 +1,7 @@ +import type { Result } from "./result"; +export type Type = { + ok: (value: V) => void; + err: (reason?: any) => void; + result: Promise>; +}; +export declare const create: () => Type; diff --git a/.yalc/@remix-run/dev/dist/channel.js b/.yalc/@remix-run/dev/dist/channel.js new file mode 100644 index 0000000..9417704 --- /dev/null +++ b/.yalc/@remix-run/dev/dist/channel.js @@ -0,0 +1,35 @@ +/** + * @remix-run/dev v2.2.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const create = () => { + let _resolve; + let _reject; + let promise = new Promise((resolve, reject) => { + _resolve = resolve; + _reject = reject; + }).catch(error => ({ + ok: false, + error + })); + return { + ok: value => _resolve({ + ok: true, + value + }), + err: _reject, + result: promise + }; +}; + +exports.create = create; diff --git a/.yalc/@remix-run/dev/dist/cli.d.ts b/.yalc/@remix-run/dev/dist/cli.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cli.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/.yalc/@remix-run/dev/dist/cli.js b/.yalc/@remix-run/dev/dist/cli.js new file mode 100755 index 0000000..af74ced --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cli.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +/** + * @remix-run/dev v2.2.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +var index = require('./index'); + +index.cli.run().then(() => { + process.exit(0); +}, error => { + if (error) console.error(error); + process.exit(1); +}); diff --git a/.yalc/@remix-run/dev/dist/cli/commands.d.ts b/.yalc/@remix-run/dev/dist/cli/commands.d.ts new file mode 100644 index 0000000..2290754 --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cli/commands.d.ts @@ -0,0 +1,24 @@ +import type { RemixConfig } from "../config"; +type InitFlags = { + deleteScript?: boolean; +}; +export declare function init(projectDir: string, { deleteScript }?: InitFlags): Promise; +/** + * Keep the function around in v2 so that users with `remix setup` in a script + * or postinstall hook can still run a build, but inform them that it's no + * longer necessary, and we can remove it in v3. + * @deprecated + */ +export declare function setup(): void; +export declare function routes(remixRoot?: string, formatArg?: string): Promise; +export declare function build(remixRoot: string, mode?: string, sourcemap?: boolean): Promise; +export declare function watch(remixRootOrConfig: string | RemixConfig, mode?: string): Promise; +export declare function dev(remixRoot: string, flags?: { + command?: string; + manual?: boolean; + port?: number; + tlsKey?: string; + tlsCert?: string; +}): Promise; +export declare function generateEntry(entry: string, remixRoot: string, useTypeScript?: boolean): Promise; +export {}; diff --git a/.yalc/@remix-run/dev/dist/cli/commands.js b/.yalc/@remix-run/dev/dist/cli/commands.js new file mode 100644 index 0000000..d3cb859 --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cli/commands.js @@ -0,0 +1,306 @@ +/** + * @remix-run/dev v2.2.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var path = require('node:path'); +var node_child_process = require('node:child_process'); +var fse = require('fs-extra'); +var getPort = require('get-port'); +var prettyMs = require('pretty-ms'); +var PackageJson = require('@npmcli/package-json'); +var pc = require('picocolors'); +var colors = require('../colors.js'); +var build$1 = require('../compiler/build.js'); +require('chokidar'); +require('lodash.debounce'); +var config = require('../config.js'); +require('node:fs'); +require('node:module'); +require('esbuild'); +require('node:url'); +require('postcss-load-config'); +require('postcss'); +require('remark-mdx-frontmatter'); +require('tsconfig-paths'); +require('postcss-modules'); +require('@babel/parser'); +require('@babel/traverse'); +require('@babel/generator'); +require('../compiler/plugins/vanillaExtract.js'); +require('postcss-discard-duplicates'); +require('cacache'); +require('node:crypto'); +require('esbuild-plugins-node-modules-polyfill'); +require('jsesc'); +var log = require('../compiler/utils/log.js'); +var liveReload = require('../devServer/liveReload.js'); +var index = require('../devServer_unstable/index.js'); +var format = require('../config/format.js'); +var detectPackageManager = require('./detectPackageManager.js'); +var useJavascript = require('./useJavascript.js'); +var fileWatchCache = require('../compiler/fileWatchCache.js'); +var logger = require('../tux/logger.js'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var path__namespace = /*#__PURE__*/_interopNamespace(path); +var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); +var getPort__default = /*#__PURE__*/_interopDefaultLegacy(getPort); +var prettyMs__default = /*#__PURE__*/_interopDefaultLegacy(prettyMs); +var PackageJson__default = /*#__PURE__*/_interopDefaultLegacy(PackageJson); +var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc); + +async function init(projectDir, { + deleteScript = true +} = {}) { + let initScriptDir = path__namespace.join(projectDir, "remix.init"); + let initScript = path__namespace.resolve(initScriptDir, "index.js"); + if (!(await fse__default["default"].pathExists(initScript))) { + return; + } + let initPackageJson = path__namespace.resolve(initScriptDir, "package.json"); + let packageManager = detectPackageManager.detectPackageManager() ?? "npm"; + if (await fse__default["default"].pathExists(initPackageJson)) { + node_child_process.execSync(`${packageManager} install`, { + cwd: initScriptDir, + stdio: "ignore" + }); + } + let initFn = require(initScript); + if (typeof initFn !== "function" && initFn.default) { + initFn = initFn.default; + } + try { + await initFn({ + packageManager, + rootDirectory: projectDir + }); + if (deleteScript) { + await fse__default["default"].remove(initScriptDir); + } + } catch (error) { + if (error instanceof Error) { + error.message = `${colors.error("🚨 Oops, remix.init failed")}\n\n${error.message}`; + } + throw error; + } +} + +/** + * Keep the function around in v2 so that users with `remix setup` in a script + * or postinstall hook can still run a build, but inform them that it's no + * longer necessary, and we can remove it in v3. + * @deprecated + */ +function setup() { + console.warn("WARNING: The setup command is no longer necessary as of v2. This is a no-op. Please remove this from your dev and CI scripts, as it will be removed in v3."); +} +async function routes(remixRoot, formatArg) { + let config$1 = await config.readConfig(remixRoot); + let format$1 = format.isRoutesFormat(formatArg) ? formatArg : format.RoutesFormat.jsx; + console.log(format.formatRoutes(config$1.routes, format$1)); +} +async function build(remixRoot, mode, sourcemap = false) { + mode = mode ?? "production"; + logger.logger.info(`building...` + pc__default["default"].gray(` (NODE_ENV=${mode})`)); + if (mode === "production" && sourcemap) { + logger.logger.warn("🚨 source maps enabled in production", { + details: ["You are using `--sourcemap` to enable source maps in production,", "making your server-side code publicly visible in the browser.", "This is highly discouraged!", "If you insist, ensure that you are using environment variables for secrets", "and are not hard-coding them in your source."] + }); + } + let start = Date.now(); + let config$1 = await config.readConfig(remixRoot); + let options = { + mode, + sourcemap + }; + if (mode === "development") { + let resolved = await resolveDev(config$1); + options.REMIX_DEV_ORIGIN = resolved.REMIX_DEV_ORIGIN; + } + let fileWatchCache$1 = fileWatchCache.createFileWatchCache(); + fse__default["default"].emptyDirSync(config$1.assetsBuildDirectory); + await build$1.build({ + config: config$1, + options, + fileWatchCache: fileWatchCache$1, + logger: logger.logger + }).catch(thrown => { + log.logThrown(thrown); + process.exit(1); + }); + logger.logger.info("built" + pc__default["default"].gray(` (${prettyMs__default["default"](Date.now() - start)})`)); +} +async function watch(remixRootOrConfig, mode) { + mode = mode ?? "development"; + console.log(`Watching Remix app in ${mode} mode...`); + let config$1 = typeof remixRootOrConfig === "object" ? remixRootOrConfig : await config.readConfig(remixRootOrConfig); + let resolved = await resolveDev(config$1); + void liveReload.liveReload(config$1, { + ...resolved, + mode + }); + return await new Promise(() => {}); +} +async function dev(remixRoot, flags = {}) { + console.log(`\n 💿 remix dev\n`); + if (process.env.NODE_ENV && process.env.NODE_ENV !== "development") { + logger.logger.warn(`overriding NODE_ENV=${process.env.NODE_ENV} to development`); + } + process.env.NODE_ENV = "development"; + let config$1 = await config.readConfig(remixRoot); + let resolved = await resolveDevServe(config$1, flags); + index.serve(config$1, resolved); + + // keep `remix dev` alive by waiting indefinitely + await new Promise(() => {}); +} +let clientEntries = ["entry.client.tsx", "entry.client.js", "entry.client.jsx"]; +let serverEntries = ["entry.server.tsx", "entry.server.js", "entry.server.jsx"]; +let entries = ["entry.client", "entry.server"]; +let conjunctionListFormat = new Intl.ListFormat("en", { + style: "long", + type: "conjunction" +}); +let disjunctionListFormat = new Intl.ListFormat("en", { + style: "long", + type: "disjunction" +}); +async function generateEntry(entry, remixRoot, useTypeScript = true) { + let config$1 = await config.readConfig(remixRoot); + + // if no entry passed, attempt to create both + if (!entry) { + await generateEntry("entry.client", remixRoot, useTypeScript); + await generateEntry("entry.server", remixRoot, useTypeScript); + return; + } + if (!entries.includes(entry)) { + let entriesArray = Array.from(entries); + let list = conjunctionListFormat.format(entriesArray); + console.error(colors.error(`Invalid entry file. Valid entry files are ${list}`)); + return; + } + let pkgJson = await PackageJson__default["default"].load(config$1.rootDirectory); + let deps = pkgJson.content.dependencies ?? {}; + let serverRuntime = deps["@remix-run/deno"] ? "deno" : deps["@remix-run/cloudflare"] ? "cloudflare" : deps["@remix-run/node"] ? "node" : undefined; + if (!serverRuntime) { + let serverRuntimes = ["@remix-run/deno", "@remix-run/cloudflare", "@remix-run/node"]; + let formattedList = disjunctionListFormat.format(serverRuntimes); + console.error(colors.error(`Could not determine server runtime. Please install one of the following: ${formattedList}`)); + return; + } + let defaultsDirectory = path__namespace.resolve(__dirname, "..", "config", "defaults"); + let defaultEntryClient = path__namespace.resolve(defaultsDirectory, "entry.client.tsx"); + let defaultEntryServer = path__namespace.resolve(defaultsDirectory, `entry.server.${serverRuntime}.tsx`); + let isServerEntry = entry === "entry.server"; + let contents = isServerEntry ? await createServerEntry(config$1.rootDirectory, config$1.appDirectory, defaultEntryServer) : await createClientEntry(config$1.rootDirectory, config$1.appDirectory, defaultEntryClient); + let outputExtension = useTypeScript ? "tsx" : "jsx"; + let outputEntry = `${entry}.${outputExtension}`; + let outputFile = path__namespace.resolve(config$1.appDirectory, outputEntry); + if (!useTypeScript) { + let javascript = useJavascript.transpile(contents, { + cwd: config$1.rootDirectory, + filename: isServerEntry ? defaultEntryServer : defaultEntryClient + }); + await fse__default["default"].writeFile(outputFile, javascript, "utf-8"); + } else { + await fse__default["default"].writeFile(outputFile, contents, "utf-8"); + } + console.log(colors.blue(`Entry file ${entry} created at ${path__namespace.relative(config$1.rootDirectory, outputFile)}.`)); +} +async function checkForEntry(rootDirectory, appDirectory, entries) { + for (let entry of entries) { + let entryPath = path__namespace.resolve(appDirectory, entry); + let exists = await fse__default["default"].pathExists(entryPath); + if (exists) { + let relative = path__namespace.relative(rootDirectory, entryPath); + console.error(colors.error(`Entry file ${relative} already exists.`)); + return process.exit(1); + } + } +} +async function createServerEntry(rootDirectory, appDirectory, inputFile) { + await checkForEntry(rootDirectory, appDirectory, serverEntries); + let contents = await fse__default["default"].readFile(inputFile, "utf-8"); + return contents; +} +async function createClientEntry(rootDirectory, appDirectory, inputFile) { + await checkForEntry(rootDirectory, appDirectory, clientEntries); + let contents = await fse__default["default"].readFile(inputFile, "utf-8"); + return contents; +} +let findPort = async () => getPort__default["default"]({ + port: getPort.makeRange(3001, 3100) +}); +let resolveDev = async (config, flags = {}) => { + let { + dev + } = config; + let port = flags.port ?? dev.port ?? (await findPort()); + let tlsKey = flags.tlsKey ?? dev.tlsKey; + if (tlsKey) tlsKey = path__namespace.resolve(tlsKey); + let tlsCert = flags.tlsCert ?? dev.tlsCert; + if (tlsCert) tlsCert = path__namespace.resolve(tlsCert); + let isTLS = tlsKey && tlsCert; + let REMIX_DEV_ORIGIN = process.env.REMIX_DEV_ORIGIN; + if (REMIX_DEV_ORIGIN === undefined) { + let scheme = isTLS ? "https" : "http"; + REMIX_DEV_ORIGIN = `${scheme}://localhost:${port}`; + } + return { + port, + tlsKey, + tlsCert, + REMIX_DEV_ORIGIN: new URL(REMIX_DEV_ORIGIN) + }; +}; +let resolveDevServe = async (config, flags = {}) => { + let { + dev + } = config; + let resolved = await resolveDev(config, flags); + let command = flags.command ?? dev.command; + let manual = flags.manual ?? dev.manual ?? false; + return { + ...resolved, + command, + manual + }; +}; + +exports.build = build; +exports.dev = dev; +exports.generateEntry = generateEntry; +exports.init = init; +exports.routes = routes; +exports.setup = setup; +exports.watch = watch; diff --git a/.yalc/@remix-run/dev/dist/cli/create.js b/.yalc/@remix-run/dev/dist/cli/create.js new file mode 100644 index 0000000..b781aef --- /dev/null +++ b/.yalc/@remix-run/dev/dist/cli/create.js @@ -0,0 +1,662 @@ +/** + * @remix-run/dev v1.18.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var child_process = require('child_process'); +var path = require('path'); +var stream = require('stream'); +var url = require('url'); +var util = require('util'); +var fse = require('fs-extra'); +var gunzip = require('gunzip-maybe'); +var fetch = require('node-fetch'); +var ora = require('ora'); +var ProxyAgent = require('proxy-agent'); +var semver = require('semver'); +var sortPackageJSON = require('sort-package-json'); +var tar = require('tar-fs'); +var colors = require('../colors.js'); +var invariant = require('../invariant.js'); +var packageJson = require('../package.json'); +var detectPackageManager = require('./detectPackageManager.js'); +var useJavascript = require('./useJavascript.js'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var stream__default = /*#__PURE__*/_interopDefaultLegacy(stream); +var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); +var gunzip__default = /*#__PURE__*/_interopDefaultLegacy(gunzip); +var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch); +var ora__default = /*#__PURE__*/_interopDefaultLegacy(ora); +var ProxyAgent__default = /*#__PURE__*/_interopDefaultLegacy(ProxyAgent); +var semver__namespace = /*#__PURE__*/_interopNamespace(semver); +var sortPackageJSON__default = /*#__PURE__*/_interopDefaultLegacy(sortPackageJSON); +var tar__default = /*#__PURE__*/_interopDefaultLegacy(tar); +var packageJson__default = /*#__PURE__*/_interopDefaultLegacy(packageJson); + +const remixDevPackageVersion = packageJson__default["default"].version; +const defaultAgent = new ProxyAgent__default["default"](); +const httpsAgent = new ProxyAgent__default["default"](); +httpsAgent.protocol = "https:"; +function agent(url) { + return new URL(url).protocol === "https:" ? httpsAgent : defaultAgent; +} +async function createApp({ + appTemplate, + projectDir, + remixVersion = remixDevPackageVersion, + installDeps, + useTypeScript = true, + githubToken, + debug +}) { + /** + * Grab the template + * First we'll need to determine if the template we got is + * - file on disk + * - directory on disk + * - tarball URL (github or otherwise) + * - github owner/repo + * - example in remix-run org + * - template in remix-run org + */ + + let templateType = detectTemplateType(appTemplate); + let options = { + useTypeScript, + token: githubToken + }; + switch (templateType) { + case "local": + { + if (debug) { + console.log(colors.warning(` 🔍 Using local template: ${appTemplate}`)); + } + let filepath = appTemplate.startsWith("file://") ? url.fileURLToPath(appTemplate) : appTemplate; + if (fse__default["default"].statSync(filepath).isDirectory()) { + await fse__default["default"].copy(filepath, projectDir); + break; + } + if (appTemplate.endsWith(".tar.gz")) { + await extractLocalTarball(projectDir, filepath); + break; + } + } + case "remoteTarball": + { + if (debug) { + console.log(colors.warning(` 🔍 Using template from remote tarball: ${appTemplate}`)); + } + await downloadAndExtractTarball(projectDir, appTemplate, options); + break; + } + case "repoTemplate": + { + let owner = "remix-run"; + let name = appTemplate.split("/").slice(-1)[0]; + if (debug) { + console.log(colors.warning(` 🔍 Using template from the ${`${owner}/${name}`} repo`)); + } + await downloadAndExtractRepoTarball(projectDir, getRepoInfo(`${owner}/${name}`), options); + break; + } + case "example": + { + let name = appTemplate.split("/").slice(-1)[0]; + if (debug) { + console.log(colors.warning(` 🔍 Using the ${name} example template from the remix-run/examples repo`)); + } + await downloadAndExtractRepoTarball(projectDir, getRepoInfo(`https://github.com/remix-run/examples/tree/main/${name}`), options); + break; + } + case "template": + { + if (debug) { + console.log(colors.warning(` 🔍 Using the ${appTemplate} template from the remix-run/remix repo`)); + } + await downloadAndExtractRepoTarball(projectDir, getRepoInfo(`https://github.com/remix-run/remix/tree/main/templates/${appTemplate}`), options); + break; + } + case "repo": + { + let repoInfo = getRepoInfo(appTemplate); + if (debug) { + console.log(colors.warning(` 🔍 Using the ${`${repoInfo.owner}/${repoInfo.name}`} repo as a template.`)); + } + await downloadAndExtractRepoTarball(projectDir, repoInfo, options); + break; + } + case null: + { + console.error(`🚨 Could not find a template for "${appTemplate}". Please open an issue at https://github.com/remix-run/remix/issues to report the bug.`); + if (debug) { + throw Error(`Invalid template "${appTemplate}"`); + } else { + process.exit(1); + } + } + } + + // Update remix deps + let pkgJsonPath = path__default["default"].join(projectDir, "package.json"); + let appPkg; + try { + appPkg = require(pkgJsonPath); + } catch { + throw Error("🚨 The provided template must be a Remix project with a `package.json` " + `file, but that file does not exist in ${pkgJsonPath}.`); + } + ["dependencies", "devDependencies"].forEach(pkgKey => { + for (let dependency in appPkg[pkgKey]) { + let version = appPkg[pkgKey][dependency]; + if (version === "*") { + appPkg[pkgKey][dependency] = semver__namespace.prerelease(remixVersion) ? + // Templates created from prereleases should pin to a specific version + remixVersion : "^" + remixVersion; + } + } + }); + appPkg = sortPackageJSON__default["default"](appPkg); + await fse__default["default"].writeJSON(pkgJsonPath, appPkg, { + spaces: 2 + }); + if (!useTypeScript && fse__default["default"].existsSync(path__default["default"].join(projectDir, "tsconfig.json"))) { + let spinner = ora__default["default"]("Converting template to JavaScript…").start(); + await useJavascript.convert(projectDir); + spinner.stop(); + spinner.clear(); + } + if (installDeps) { + let packageManager = detectPackageManager.detectPackageManager() ?? "npm"; + let npmConfig = child_process.execSync(`${packageManager} config get @remix-run:registry`, { + encoding: "utf8" + }); + if (npmConfig !== null && npmConfig !== void 0 && npmConfig.startsWith("https://npm.remix.run")) { + throw Error("🚨 Oops! You still have the private Remix registry configured. Please " + `run \`${packageManager} config delete @remix-run:registry\` or edit your .npmrc file ` + "to remove it."); + } + child_process.execSync(`${packageManager} install`, { + cwd: projectDir, + stdio: "inherit" + }); + } +} + +// this is natively a promise in node 15+ stream/promises +const pipeline = util.promisify(stream__default["default"].pipeline); +async function extractLocalTarball(projectDir, filePath) { + try { + await pipeline(fse__default["default"].createReadStream(filePath), gunzip__default["default"](), tar__default["default"].extract(projectDir, { + strip: 1 + })); + } catch (error) { + throw Error("🚨 There was a problem extracting the file from the provided template.\n\n" + ` Template filepath: \`${filePath}\`\n` + ` Destination directory: \`${projectDir}\`\n` + ` ${error}`); + } +} +async function downloadAndExtractRepoTarball(projectDir, repo, options) { + // If we have a direct file path we will also have the branch. We can skip the + // redirect and get the tarball URL directly. + if (repo.branch && repo.filePath) { + let { + filePath, + tarballURL + } = getTarballUrl(repo); + return await downloadAndExtractTarball(projectDir, tarballURL, { + ...options, + filePath + }); + } + + // If we don't know the branch, the GitHub API will figure out the default and + // redirect the request to the tarball. + // https://docs.github.com/en/rest/reference/repos#download-a-repository-archive-tar + let url = `https://api.github.com/repos/${repo.owner}/${repo.name}/tarball`; + if (repo.branch) { + url += `/${repo.branch}`; + } + return await downloadAndExtractTarball(projectDir, url, { + ...options, + filePath: null + }); +} +async function downloadAndExtractTarball(projectDir, url, { + token, + filePath +}) { + let resourceUrl = url; + let headers = {}; + if (token && new URL(url).host.endsWith("github.com")) { + headers.Authorization = `token ${token}`; + } + if (isGithubReleaseAssetUrl(url)) { + var _body$assets, _body$assets$find, _body$assets2, _body$assets2$find; + // We can download the asset via the github api, but first we need to look up the + // asset id + let info = getGithubReleaseAssetInfo(url); + headers.Accept = "application/vnd.github.v3+json"; + let releaseUrl = info.tag === "latest" ? `https://api.github.com/repos/${info.owner}/${info.name}/releases/latest` : `https://api.github.com/repos/${info.owner}/${info.name}/releases/tags/${info.tag}`; + let response = await fetch__default["default"](releaseUrl, { + agent: agent("https://api.github.com"), + headers + }); + if (response.status !== 200) { + throw Error("🚨 There was a problem fetching the file from GitHub. The request " + `responded with a ${response.status} status. Please try again later.`); + } + let body = await response.json(); + // If the release is "latest", the url won't match the download url, so we grab the id from the response + let assetId = info.tag === "latest" ? body === null || body === void 0 ? void 0 : (_body$assets = body.assets) === null || _body$assets === void 0 ? void 0 : (_body$assets$find = _body$assets.find(a => { + var _a$browser_download_u; + return a === null || a === void 0 ? void 0 : (_a$browser_download_u = a.browser_download_url) === null || _a$browser_download_u === void 0 ? void 0 : _a$browser_download_u.includes(info.asset); + })) === null || _body$assets$find === void 0 ? void 0 : _body$assets$find.id : body === null || body === void 0 ? void 0 : (_body$assets2 = body.assets) === null || _body$assets2 === void 0 ? void 0 : (_body$assets2$find = _body$assets2.find(a => (a === null || a === void 0 ? void 0 : a.browser_download_url) === url)) === null || _body$assets2$find === void 0 ? void 0 : _body$assets2$find.id; + if (!assetId) { + throw Error("🚨 There was a problem fetching the file from GitHub. No asset was " + "found at that url. Please try again later."); + } + resourceUrl = `https://api.github.com/repos/${info.owner}/${info.name}/releases/assets/${assetId}`; + headers.Accept = "application/octet-stream"; + } + let response = await fetch__default["default"](resourceUrl, { + agent: agent(resourceUrl), + headers + }); + if (response.status !== 200) { + if (token) { + throw Error("🚨 There was a problem fetching the file from GitHub. The request " + `responded with a ${response.status} status. Perhaps your \`--token\`` + "is expired or invalid."); + } + throw Error("🚨 There was a problem fetching the file from GitHub. The request " + `responded with a ${response.status} status. Please try again later.`); + } + + // file paths returned from github are always unix style + if (filePath) { + filePath = filePath.split(path__default["default"].sep).join(path__default["default"].posix.sep); + } + try { + await pipeline(response.body.pipe(gunzip__default["default"]()), tar__default["default"].extract(projectDir, { + map(header) { + let originalDirName = header.name.split("/")[0]; + header.name = header.name.replace(`${originalDirName}/`, ""); + if (filePath) { + if (header.name.startsWith(filePath)) { + header.name = header.name.replace(filePath, ""); + } else { + header.name = "__IGNORE__"; + } + } + return header; + }, + ignore(_filename, header) { + if (!header) { + throw new Error(`Header is undefined`); + } + return header.name === "__IGNORE__"; + } + })); + } catch (_) { + throw Error("🚨 There was a problem extracting the file from the provided template.\n\n" + ` Template URL: \`${url}\`\n` + ` Destination directory: \`${projectDir}\``); + } +} +function getTarballUrl(repoInfo) { + return { + tarballURL: `https://codeload.github.com/${repoInfo.owner}/${repoInfo.name}/tar.gz/${repoInfo.branch}`, + filePath: repoInfo.filePath || "/" + }; +} +function isGithubRepoShorthand(value) { + return /^[\w-]+\/[\w-]+$/.test(value); +} +function getGithubUrl(info) { + let url = `https://github.com/${info.owner}/${info.name}`; + if (info.branch) { + url += `/${info.branch}`; + if (info.filePath && info.filePath !== "/") { + url += `/${info.filePath}`; + } + } + return url; +} +function isGithubReleaseAssetUrl(url) { + /** + * Accounts for the following formats: + * https://github.com/owner/repository/releases/download/v0.0.1/stack.tar.gz + * ~or~ + * https://github.com/owner/repository/releases/latest/download/stack.tar.gz + */ + return url.startsWith("https://github.com") && (url.includes("/releases/download/") || url.includes("/releases/latest/download/")); +} +function getGithubReleaseAssetInfo(browserUrl) { + /** + * https://github.com/owner/repository/releases/download/v0.0.1/stack.tar.gz + * ~or~ + * https://github.com/owner/repository/releases/latest/download/stack.tar.gz + */ + + let url = new URL(browserUrl); + let [, owner, name,, downloadOrLatest, tag, asset] = url.pathname.split("/"); + if (downloadOrLatest === "latest" && tag === "download") { + // handle the Github URL quirk for latest releases + tag = "latest"; + } + return { + browserUrl, + owner, + name, + asset, + tag + }; +} +function getRepoInfo(validatedGithubUrl) { + if (isGithubRepoShorthand(validatedGithubUrl)) { + let [owner, name] = validatedGithubUrl.split("/"); + return { + url: getGithubUrl({ + owner, + name, + branch: null, + filePath: null + }), + owner, + name, + branch: null, + filePath: null + }; + } + let url = new URL(validatedGithubUrl); + let [, owner, name, tree, branch, ...file] = url.pathname.split("/"); + let filePath = file.join("/"); + if (tree === undefined) { + return { + url: validatedGithubUrl, + owner, + name, + branch: null, + filePath: null + }; + } + return { + url: validatedGithubUrl, + owner, + name, + // If we've validated the GitHub URL and there is a tree, there will also be + // a branch + branch: branch, + filePath: filePath === "" || filePath === "/" ? null : filePath + }; +} +async function validateNewProjectPath(input) { + let cwd = process.cwd(); + let projectDir = path__default["default"].resolve(cwd, input); + if ((await fse__default["default"].pathExists(projectDir)) && (await fse__default["default"].stat(projectDir)).isDirectory()) { + if ((await fse__default["default"].readdir(projectDir)).length > 0) { + throw Error("🚨 The project directory must be empty to create a new project. Please " + "clear the contents of the directory or choose a different path."); + } + } +} +function isRemixStack(input) { + return ["remix-run/blues-stack", "remix-run/indie-stack", "remix-run/grunge-stack", "blues-stack", "indie-stack", "grunge-stack"].includes(input); +} +function isRemixTemplate(input) { + return ["arc", "cloudflare-pages", "cloudflare-workers", "deno", "express", "fly", "netlify", "remix", "vercel"].includes(input); +} +async function validateTemplate(input, options) { + // If a template string matches one of the choices in our interactive prompt, + // we can skip all fetching and manual validation. + if (isRemixStack(input)) { + return; + } + if (isRemixTemplate(input)) { + return; + } + let templateType = detectTemplateType(input); + switch (templateType) { + case "local": + { + if (input.startsWith("file://")) { + input = url.fileURLToPath(input); + } + if (!(await fse__default["default"].pathExists(input))) { + throw Error(`🚨 Oops, the file \`${input}\` does not exist.`); + } + return; + } + case "remoteTarball": + { + let spinner = ora__default["default"]("Validating the template file…").start(); + let apiUrl = input; + let method = "HEAD"; + let headers = {}; + if (isGithubReleaseAssetUrl(input)) { + let info = getGithubReleaseAssetInfo(input); + apiUrl = info.tag === "latest" ? `https://api.github.com/repos/${info.owner}/${info.name}/releases/latest` : `https://api.github.com/repos/${info.owner}/${info.name}/releases/tags/${info.tag}`; + headers = { + Authorization: `token ${options === null || options === void 0 ? void 0 : options.githubToken}`, + Accept: "application/vnd.github.v3+json" + }; + method = "GET"; + } + let response; + try { + response = await fetch__default["default"](apiUrl, { + agent: agent(apiUrl), + method, + headers + }); + } catch (_) { + throw Error("🚨 There was a problem verifying the template file. Please ensure " + "you are connected to the internet and try again later."); + } finally { + spinner.stop(); + } + switch (response.status) { + case 200: + if (isGithubReleaseAssetUrl(input)) { + var _body$assets3, _body$assets4; + let info = getGithubReleaseAssetInfo(input); + let body = await response.json(); + if ( + // if a tag is specified, make sure it exists. + !(body !== null && body !== void 0 && (_body$assets3 = body.assets) !== null && _body$assets3 !== void 0 && _body$assets3.some(a => (a === null || a === void 0 ? void 0 : a.browser_download_url) === input)) && + // if the latest is specified, make sure there is an asset + !(body !== null && body !== void 0 && (_body$assets4 = body.assets) !== null && _body$assets4 !== void 0 && _body$assets4.some(a => a === null || a === void 0 ? void 0 : a.browser_download_url.includes(info.asset)))) { + throw Error("🚨 The template file could not be verified. Please double check " + "the URL and try again."); + } + } + return; + case 404: + throw Error("🚨 The template file could not be verified. Please double check " + "the URL and try again."); + default: + throw Error("🚨 The template file could not be verified. The server returned " + `a response with a ${response.status} status. Please double ` + "check the URL and try again."); + } + } + case "repo": + { + let spinner = ora__default["default"]("Validating the template repo…").start(); + let { + branch, + filePath, + owner, + name + } = getRepoInfo(input); + let response; + let apiUrl = `https://api.github.com/repos/${owner}/${name}`; + let method = "HEAD"; + if (branch) { + apiUrl += `/git/trees/${branch}?recursive=1`; + } + if (filePath) { + // When filePath is present, we need to examine the response json to see + // if that path exists in the repo. + invariant["default"](branch, "Expecting branch to be present when specifying a path."); + method = "GET"; + } + try { + let headers = {}; + if (options !== null && options !== void 0 && options.githubToken) { + headers = { + Authorization: `token ${options.githubToken}` + }; + } + response = await fetch__default["default"](apiUrl, { + agent: agent(apiUrl), + method, + headers + }); + } catch (_) { + throw Error("🚨 There was a problem fetching the template. Please ensure you " + "are connected to the internet and try again later."); + } finally { + spinner.stop(); + } + switch (response.status) { + case 200: + if (filePath && filePath !== "/") { + var _filesWithinRepo$tree; + // if a filePath is included there must also be a branch, because of how github structures + // their URLs. That means the api results list all files and directories + let filesWithinRepo = await response.json(); + if (!(filesWithinRepo !== null && filesWithinRepo !== void 0 && (_filesWithinRepo$tree = filesWithinRepo.tree) !== null && _filesWithinRepo$tree !== void 0 && _filesWithinRepo$tree.some(file => (file === null || file === void 0 ? void 0 : file.path) === filePath && (file === null || file === void 0 ? void 0 : file.type) === "tree"))) { + throw Error("🚨 The template could not be verified. The GitHub repository was found, but did " + "not seem to contain anything at that path. " + "Please double check that the filepath points to a directory in the repo " + "and try again."); + } + } + return; + case 401: + throw Error("🚨 The template could not be verified because you are not " + "authorized to access that repository. Please double check the " + "access rights of the repo or consider passing a `--token`"); + case 403: + throw Error("🚨 The template could not be verified because you do not have " + "access to the repository. Please double check the access " + "rights of this repo and try again."); + case 404: + throw Error("🚨 The template could not be verified. Please double check that " + "the template is a valid GitHub repository" + (filePath && filePath !== "/" ? " and that the filepath points to a directory in the repo" : "") + " and try again."); + default: + throw Error("🚨 The template could not be verified. The server returned a " + `response with a ${response.status} status. Please double check ` + "that the template is a valid GitHub repository and try again."); + } + } + case "example": + case "template": + { + let spinner = ora__default["default"]("Validating the template…").start(); + let isExample = templateType === "example"; + let name = input; + if (isExample) { + name = name.split("/")[1]; + } + let repoBaseUrl = isExample ? "https://github.com/remix-run/examples/tree/main" : "https://github.com/remix-run/remix/tree/main/templates"; + let templateUrl = `${repoBaseUrl}/${name}`; + let response; + try { + response = await fetch__default["default"](templateUrl, { + agent: agent(templateUrl), + method: "HEAD" + }); + } catch (_) { + throw Error("🚨 There was a problem verifying the template. Please ensure you are " + "connected to the internet and try again later."); + } finally { + spinner.stop(); + } + switch (response.status) { + case 200: + return; + case 404: + throw Error("🚨 The template could not be verified. Please double check that " + "the template is a valid project directory in " + `${repoBaseUrl} and ` + "try again."); + default: + throw Error("🚨 The template could not be verified. The server returned a " + `response with a ${response.status} status. Please double ` + "check that the template is a valid project directory in " + `${repoBaseUrl} and ` + "try again."); + } + } + } + throw Error("🚨 Invalid template selected. Please try again."); +} +function detectTemplateType(template) { + // 1. Prioritize Remix templates and stacks first. This ensures that inputs + // like `--template remix` always pull from our templates, which is almost + // always the desired behavior. If users maintain a fork either locally or + // in another repo they can pass the repo shorthand, URL or path instead. + // This also ensures that our interactive CLI always works as expected even + // if the user has another directory with the same name. + // https://github.com/remix-run/remix/issues/2491 + if (isRemixTemplate(template)) { + return "template"; + } + if (isRemixStack(template)) { + return "repoTemplate"; + } + + // 2. Check if the user passed a local file. If they hand us an explicit file + // URL, we'll validate it first. Otherwise we just ping the filesystem to + // see if the string references a filepath and, if not, move on. + if (template.startsWith("file://")) { + return "local"; + } + + // 3. Check if it's a path to a local directory. + try { + if (fse__default["default"].existsSync(path__default["default"].isAbsolute(template) ? template : path__default["default"].resolve(process.cwd(), template))) { + return "local"; + } + } catch (_) { + // ignore FS errors and move on + } + + // 4. examples/