diff --git a/.yalc/@remix-run/dev/CHANGELOG.md b/.yalc/@remix-run/dev/CHANGELOG.md deleted file mode 100644 index 86e3a39..0000000 --- a/.yalc/@remix-run/dev/CHANGELOG.md +++ /dev/null @@ -1,1060 +0,0 @@ -# `@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 deleted file mode 100644 index b14cd6c..0000000 --- a/.yalc/@remix-run/dev/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index 40685a7..0000000 --- a/.yalc/@remix-run/dev/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/cache.js b/.yalc/@remix-run/dev/dist/cache.js deleted file mode 100644 index 27db315..0000000 --- a/.yalc/@remix-run/dev/dist/cache.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @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.js b/.yalc/@remix-run/dev/dist/channel.js deleted file mode 100644 index 9417704..0000000 --- a/.yalc/@remix-run/dev/dist/channel.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @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.js b/.yalc/@remix-run/dev/dist/cli.js deleted file mode 100644 index af74ced..0000000 --- a/.yalc/@remix-run/dev/dist/cli.js +++ /dev/null @@ -1,21 +0,0 @@ -#!/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.js b/.yalc/@remix-run/dev/dist/cli/commands.js deleted file mode 100644 index d3cb859..0000000 --- a/.yalc/@remix-run/dev/dist/cli/commands.js +++ /dev/null @@ -1,306 +0,0 @@ -/** - * @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/detectPackageManager.js b/.yalc/@remix-run/dev/dist/cli/detectPackageManager.js deleted file mode 100644 index 45c3dab..0000000 --- a/.yalc/@remix-run/dev/dist/cli/detectPackageManager.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @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 }); - -/** - * Determine which package manager the user prefers. - * - * npm, pnpm and Yarn set the user agent environment variable - * that can be used to determine which package manager ran - * the command. - */ -const detectPackageManager = () => { - let { - npm_config_user_agent - } = process.env; - if (!npm_config_user_agent) return undefined; - try { - let pkgManager = npm_config_user_agent.split("/")[0]; - if (pkgManager === "npm") return "npm"; - if (pkgManager === "pnpm") return "pnpm"; - if (pkgManager === "yarn") return "yarn"; - if (pkgManager === "bun") return "bun"; - return undefined; - } catch { - return undefined; - } -}; - -exports.detectPackageManager = detectPackageManager; diff --git a/.yalc/@remix-run/dev/dist/cli/index.js b/.yalc/@remix-run/dev/dist/cli/index.js deleted file mode 100644 index 37f0f82..0000000 --- a/.yalc/@remix-run/dev/dist/cli/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @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 run = require('./run.js'); - - - -exports.run = run.run; diff --git a/.yalc/@remix-run/dev/dist/cli/run.js b/.yalc/@remix-run/dev/dist/cli/run.js deleted file mode 100644 index 8f2fcf8..0000000 --- a/.yalc/@remix-run/dev/dist/cli/run.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @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 arg = require('arg'); -var semver = require('semver'); -var colors = require('../colors.js'); -var commands = require('./commands.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var arg__default = /*#__PURE__*/_interopDefaultLegacy(arg); -var semver__default = /*#__PURE__*/_interopDefaultLegacy(semver); - -const helpText = ` -${colors.logoBlue("R")} ${colors.logoGreen("E")} ${colors.logoYellow("M")} ${colors.logoPink("I")} ${colors.logoRed("X")} - - ${colors.heading("Usage")}: - $ remix init [${colors.arg("projectDir")}] - $ remix build [${colors.arg("projectDir")}] - $ remix dev [${colors.arg("projectDir")}] - $ remix routes [${colors.arg("projectDir")}] - $ remix watch [${colors.arg("projectDir")}] - - ${colors.heading("Options")}: - --help, -h Print this help message and exit - --version, -v Print the CLI version and exit - --no-color Disable ANSI colors in console output - \`build\` Options: - --sourcemap Generate source maps for production - \`dev\` Options: - --command, -c Command used to run your app server - --manual Enable manual mode - --port Port for the dev server. Default: any open port - --tls-key Path to TLS key (key.pem) - --tls-cert Path to TLS certificate (cert.pem) - \`init\` Options: - --no-delete Skip deleting the \`remix.init\` script - \`routes\` Options: - --json Print the routes as JSON - - ${colors.heading("Values")}: - - ${colors.arg("projectDir")} The Remix project directory - - ${colors.arg("remixPlatform")} \`node\` or \`cloudflare\` - - ${colors.heading("Initialize a project:")}: - - Remix project templates may contain a \`remix.init\` directory - with a script that initializes the project. This script automatically - runs during \`remix create\`, but if you ever need to run it manually - (e.g. to test it out) you can: - - $ remix init - - ${colors.heading("Build your project")}: - - $ remix build - $ remix build --sourcemap - $ remix build my-app - - ${colors.heading("Run your project locally in development")}: - - $ remix dev - $ remix dev -c "node ./server.js" - - ${colors.heading("Start your server separately and watch for changes")}: - - # custom server start command, for example: - $ remix watch - - # in a separate tab: - $ node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js - - ${colors.heading("Show all routes in your app")}: - - $ remix routes - $ remix routes my-app - $ remix routes --json - - ${colors.heading("Reveal the used entry point")}: - - $ remix reveal entry.client - $ remix reveal entry.server - $ remix reveal entry.client --no-typescript - $ remix reveal entry.server --no-typescript -`; - -/** - * Programmatic interface for running the Remix CLI with the given command line - * arguments. - */ -async function run(argv = process.argv.slice(2)) { - // Check the node version - let versions = process.versions; - if (versions && versions.node && semver__default["default"].major(versions.node) < 18) { - throw new Error(`️🚨 Oops, Node v${versions.node} detected. Remix requires a Node version greater than 18.`); - } - let args = arg__default["default"]({ - "--no-delete": Boolean, - "--dry": Boolean, - "--force": Boolean, - "--help": Boolean, - "-h": "--help", - "--json": Boolean, - "--sourcemap": Boolean, - "--token": String, - "--typescript": Boolean, - "--no-typescript": Boolean, - "--version": Boolean, - "-v": "--version", - // dev server - "--command": String, - "-c": "--command", - "--manual": Boolean, - "--port": Number, - "-p": "--port", - "--tls-key": String, - "--tls-cert": String - }, { - argv - }); - let input = args._; - let flags = Object.entries(args).reduce((acc, [key, value]) => { - key = key.replace(/^--/, ""); - acc[key] = value; - return acc; - }, {}); - if (flags.help) { - console.log(helpText); - return; - } - if (flags.version) { - let version = require("../package.json").version; - console.log(version); - return; - } - if (flags["tls-key"]) { - flags.tlsKey = flags["tls-key"]; - delete flags["tls-key"]; - } - if (flags["tls-cert"]) { - flags.tlsCert = flags["tls-cert"]; - delete flags["tls-cert"]; - } - if (args["--no-delete"]) { - flags.delete = false; - } - flags.interactive = flags.interactive ?? require.main === module; - if (args["--no-typescript"]) { - flags.typescript = false; - } - let command = input[0]; - - // Note: Keep each case in this switch statement small. - switch (command) { - case "init": - await commands.init(input[1] || process.env.REMIX_ROOT || process.cwd(), { - deleteScript: flags.delete - }); - break; - case "routes": - await commands.routes(input[1], flags.json ? "json" : "jsx"); - break; - case "build": - if (!process.env.NODE_ENV) process.env.NODE_ENV = "production"; - await commands.build(input[1], process.env.NODE_ENV, flags.sourcemap); - break; - case "watch": - if (!process.env.NODE_ENV) process.env.NODE_ENV = "development"; - await commands.watch(input[1], process.env.NODE_ENV); - break; - case "setup": - commands.setup(); - break; - case "reveal": - { - // TODO: simplify getting started guide - await commands.generateEntry(input[1], input[2], flags.typescript); - break; - } - case "dev": - await commands.dev(input[1], flags); - break; - default: - // `remix ./my-project` is shorthand for `remix dev ./my-project` - await commands.dev(input[0], flags); - } -} - -exports.run = run; diff --git a/.yalc/@remix-run/dev/dist/cli/useJavascript.js b/.yalc/@remix-run/dev/dist/cli/useJavascript.js deleted file mode 100644 index d5ffec8..0000000 --- a/.yalc/@remix-run/dev/dist/cli/useJavascript.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @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 babel = require('@babel/core'); -var babelPluginSyntaxJSX = require('@babel/plugin-syntax-jsx'); -var babelPresetTypeScript = require('@babel/preset-typescript'); -var prettier = require('prettier'); - -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 babel__namespace = /*#__PURE__*/_interopNamespace(babel); -var babelPluginSyntaxJSX__default = /*#__PURE__*/_interopDefaultLegacy(babelPluginSyntaxJSX); -var babelPresetTypeScript__default = /*#__PURE__*/_interopDefaultLegacy(babelPresetTypeScript); -var prettier__default = /*#__PURE__*/_interopDefaultLegacy(prettier); - -function transpile(tsx, options = {}) { - let mjs = babel__namespace.transformSync(tsx, { - compact: false, - cwd: options.cwd, - filename: options.filename, - plugins: [babelPluginSyntaxJSX__default["default"]], - presets: [[babelPresetTypeScript__default["default"], { - jsx: "preserve" - }]], - retainLines: true - }); - if (!mjs || !mjs.code) throw new Error("Could not parse TypeScript"); - - /** - * Babel's `compact` and `retainLines` options are both bad at formatting code. - * Use Prettier for nicer formatting. - */ - return prettier__default["default"].format(mjs.code, { - parser: "babel" - }); -} - -exports.transpile = transpile; diff --git a/.yalc/@remix-run/dev/dist/colors.js b/.yalc/@remix-run/dev/dist/colors.js deleted file mode 100644 index 5bdbb13..0000000 --- a/.yalc/@remix-run/dev/dist/colors.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @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 chalk = require('chalk'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk); - -// https://no-color.org/ -const useColor = chalk__default["default"].supportsColor && !process.env.NO_COLOR; -const identity = x => x; -const safe = style => useColor ? style : identity; -const heading = safe(chalk__default["default"].underline); -const arg = safe(chalk__default["default"].yellowBright); -const error = safe(chalk__default["default"].red); -safe(chalk__default["default"].yellow); -safe(chalk__default["default"].blue); -const logoBlue = safe(chalk__default["default"].blueBright); -const logoGreen = safe(chalk__default["default"].greenBright); -const logoYellow = safe(chalk__default["default"].yellowBright); -const logoPink = safe(chalk__default["default"].magentaBright); -const logoRed = safe(chalk__default["default"].redBright); - -// raw styles -safe(chalk__default["default"].bold); - -// raw colors -const blue = safe(chalk__default["default"].blue); -safe(chalk__default["default"].cyan); -safe(chalk__default["default"].gray); -safe(chalk__default["default"].red); -safe(chalk__default["default"].yellow); - -exports.arg = arg; -exports.blue = blue; -exports.error = error; -exports.heading = heading; -exports.logoBlue = logoBlue; -exports.logoGreen = logoGreen; -exports.logoPink = logoPink; -exports.logoRed = logoRed; -exports.logoYellow = logoYellow; diff --git a/.yalc/@remix-run/dev/dist/compiler/analysis.js b/.yalc/@remix-run/dev/dist/compiler/analysis.js deleted file mode 100644 index 2262748..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/analysis.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var path = require('node:path'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -let writeMetafile = (ctx, filename, metafile) => { - let buildDir = path__default["default"].dirname(ctx.config.serverBuildPath); - fse__default["default"].outputFileSync(path__default["default"].join(buildDir, filename), JSON.stringify(metafile)); -}; - -exports.writeMetafile = writeMetafile; diff --git a/.yalc/@remix-run/dev/dist/compiler/build.js b/.yalc/@remix-run/dev/dist/compiler/build.js deleted file mode 100644 index 379e51f..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/build.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @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 compiler = require('./compiler.js'); - -async function build(ctx) { - let compiler$1 = await compiler.create(ctx); - await compiler$1.compile(); -} - -exports.build = build; diff --git a/.yalc/@remix-run/dev/dist/compiler/cancel.js b/.yalc/@remix-run/dev/dist/compiler/cancel.js deleted file mode 100644 index e16532b..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/cancel.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @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 CANCEL_PREFIX = "remix-compile-cancel"; -class Cancel extends Error { - constructor(message) { - super(`${CANCEL_PREFIX}: ${message}`); - } -} - -exports.CANCEL_PREFIX = CANCEL_PREFIX; -exports.Cancel = Cancel; diff --git a/.yalc/@remix-run/dev/dist/compiler/compiler.js b/.yalc/@remix-run/dev/dist/compiler/compiler.js deleted file mode 100644 index 3ed1f24..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/compiler.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var path = require('node:path'); -var compiler = require('./css/compiler.js'); -var bundle = require('./css/bundle.js'); -var compiler$1 = require('./js/compiler.js'); -var write = require('./js/write.js'); -var compiler$2 = require('./server/compiler.js'); -var write$1 = require('./server/write.js'); -var channel = require('../channel.js'); -var manifest = require('./manifest.js'); -var lazyValue = require('./lazyValue.js'); -var result = require('../result.js'); -var cancel = require('./cancel.js'); - -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 fs__namespace = /*#__PURE__*/_interopNamespace(fs); -var path__namespace = /*#__PURE__*/_interopNamespace(path); - -let create = async ctx => { - // these variables _should_ be scoped to a build, not a compiler - // but esbuild doesn't have an API for passing build-specific arguments for rebuilds - // so instead use a mutable reference (`refs`) that is compiler-scoped - // and gets reset on each build - let refs = { - lazyCssBundleHref: undefined, - manifestChannel: undefined - }; - let subcompiler = { - css: await compiler.create(ctx), - js: await compiler$1.create(ctx, refs), - server: await compiler$2.create(ctx, refs) - }; - let cancel$1 = async () => { - // resolve channels with error so that downstream tasks don't hang waiting for results from upstream tasks - refs.lazyCssBundleHref.cancel(); - refs.manifestChannel.err(); - - // optimization: cancel tasks - await Promise.all([subcompiler.css.cancel(), subcompiler.js.cancel(), subcompiler.server.cancel()]); - }; - let compile = async (options = {}) => { - var _options$onManifest; - let error = undefined; - let errCancel = thrown => { - if (error === undefined) { - error = thrown; - } - void cancel$1(); - return result.err(thrown); - }; - - // keep track of manually written artifacts - let writes = {}; - - // reset refs for this compilation - refs.manifestChannel = channel.create(); - refs.lazyCssBundleHref = lazyValue.createLazyValue({ - async get() { - let { - bundleOutputFile, - outputFiles - } = await subcompiler.css.compile(); - if (bundleOutputFile) { - writes.cssBundle = bundle.write(ctx, outputFiles); - } - return bundleOutputFile && ctx.config.publicPath + path__namespace.relative(ctx.config.assetsBuildDirectory, path__namespace.resolve(bundleOutputFile.path)); - }, - onCancel: ({ - reject - }) => { - reject(new cancel.Cancel("css-bundle")); - } - }); - - // kickoff compilations in parallel - let tasks = { - js: subcompiler.js.compile().then(result.ok, errCancel), - server: subcompiler.server.compile().then(result.ok, errCancel) - }; - - // js compilation (implicitly writes artifacts/js) - let js = await tasks.js; - if (!js.ok) throw error ?? js.error; - let { - metafile, - outputFiles, - hmr - } = js.value; - writes.js = write.write(ctx.config, outputFiles); - - // artifacts/manifest - let manifest$1 = await manifest.create({ - config: ctx.config, - metafile, - hmr, - fileWatchCache: ctx.fileWatchCache - }); - refs.manifestChannel.ok(manifest$1); - (_options$onManifest = options.onManifest) === null || _options$onManifest === void 0 ? void 0 : _options$onManifest.call(options, manifest$1); - writes.manifest = manifest.write(ctx.config, manifest$1); - - // server compilation - let server = await tasks.server; - if (!server.ok) throw error ?? server.error; - // artifacts/server - writes.server = write$1.write(ctx.config, server.value).then(() => { - // write the version to a sentinel file _after_ the server has been written - // this allows the app server to watch for changes to `version.txt` - // avoiding race conditions when the app server would attempt to reload a partially written server build - let versionTxt = path__namespace.join(path__namespace.dirname(ctx.config.serverBuildPath), "version.txt"); - fs__namespace.writeFileSync(versionTxt, manifest$1.version); - }); - await Promise.all(Object.values(writes)); - return manifest$1; - }; - return { - compile, - cancel: cancel$1, - dispose: async () => { - await Promise.all(Object.values(subcompiler).map(sub => sub.dispose())); - } - }; -}; - -exports.create = create; diff --git a/.yalc/@remix-run/dev/dist/compiler/css/bundle.js b/.yalc/@remix-run/dev/dist/compiler/css/bundle.js deleted file mode 100644 index 8aab53e..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/css/bundle.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var postcss = require('postcss'); -var postcssDiscardDuplicates = require('postcss-discard-duplicates'); - -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 postcss__default = /*#__PURE__*/_interopDefaultLegacy(postcss); -var postcssDiscardDuplicates__default = /*#__PURE__*/_interopDefaultLegacy(postcssDiscardDuplicates); - -let write = async (ctx, outputFiles) => { - var _outputFiles$find; - let cssBundleFile = outputFiles.find(outputFile => isBundle(ctx, outputFile, ".css")); - if (!cssBundleFile) return; - let cssBundlePath = cssBundleFile.path; - let { - css, - map - } = await postcss__default["default"]([ - // We need to discard duplicate rules since "composes" - // in CSS Modules can result in duplicate styles - postcssDiscardDuplicates__default["default"]()]).process(cssBundleFile.text, { - from: cssBundlePath, - to: cssBundlePath, - map: ctx.options.sourcemap && { - prev: (_outputFiles$find = outputFiles.find(outputFile => isBundle(ctx, outputFile, ".css.map"))) === null || _outputFiles$find === void 0 ? void 0 : _outputFiles$find.text, - inline: false, - annotation: false, - sourcesContent: true - } - }); - await fse__default["default"].ensureDir(path__namespace.dirname(cssBundlePath)); - await Promise.all([fse__default["default"].writeFile(cssBundlePath, css), ctx.options.mode !== "production" && map ? fse__default["default"].writeFile(`${cssBundlePath}.map`, map.toString()) // Write our updated source map rather than esbuild's - : null, ...outputFiles.filter(outputFile => !/\.(css|js|map)$/.test(outputFile.path)).map(async asset => { - await fse__default["default"].ensureDir(path__namespace.dirname(asset.path)); - await fse__default["default"].writeFile(asset.path, asset.contents); - })]); -}; -let isBundle = (ctx, outputFile, extension) => { - return path__namespace.dirname(outputFile.path) === ctx.config.assetsBuildDirectory && path__namespace.basename(outputFile.path).startsWith("css-bundle") && outputFile.path.endsWith(extension); -}; - -exports.isBundle = isBundle; -exports.write = write; diff --git a/.yalc/@remix-run/dev/dist/compiler/css/compiler.js b/.yalc/@remix-run/dev/dist/compiler/css/compiler.js deleted file mode 100644 index 8719015..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/css/compiler.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @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 node_module = require('node:module'); -var esbuild = require('esbuild'); -var loaders = require('../utils/loaders.js'); -var cssImports = require('../plugins/cssImports.js'); -var absoluteCssUrlsPlugin = require('../plugins/absoluteCssUrlsPlugin.js'); -var emptyModules = require('../plugins/emptyModules.js'); -var mdx = require('../plugins/mdx.js'); -var external = require('../plugins/external.js'); -var cssModuleImports = require('../plugins/cssModuleImports.js'); -var cssSideEffectImports = require('../plugins/cssSideEffectImports.js'); -var vanillaExtract = require('../plugins/vanillaExtract.js'); -var bundleEntry = require('./plugins/bundleEntry.js'); -var bundle = require('./bundle.js'); -var analysis = require('../analysis.js'); - -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 esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild); - -const createEsbuildConfig = ctx => { - return { - entryPoints: { - "css-bundle": bundleEntry.cssBundleEntryModuleId - }, - outdir: ctx.config.assetsBuildDirectory, - platform: "browser", - format: "esm", - // Node built-ins (and any polyfills) are guaranteed to never contain CSS, - // and the JS from this build will never be executed, so we can safely skip - // bundling them and leave any imports of them as-is in the generated JS. - // Any issues with Node built-ins will be caught by the browser JS build. - external: node_module.builtinModules, - loader: loaders.loaders, - bundle: true, - logLevel: "silent", - sourcemap: ctx.options.sourcemap, - // As pointed out by https://github.com/evanw/esbuild/issues/2440, when tsconfig is set to - // `undefined`, esbuild will keep looking for a tsconfig.json recursively up. This unwanted - // behavior can only be avoided by creating an empty tsconfig file in the root directory. - tsconfig: ctx.config.tsconfigPath, - mainFields: ["browser", "module", "main"], - treeShaking: true, - minify: ctx.options.mode === "production", - entryNames: "[dir]/[name]-[hash]", - chunkNames: "_shared/[name]-[hash]", - assetNames: "_assets/[name]-[hash]", - publicPath: ctx.config.publicPath, - define: { - "process.env.NODE_ENV": JSON.stringify(ctx.options.mode) - }, - jsx: "automatic", - jsxDev: ctx.options.mode !== "production", - plugins: [bundleEntry.cssBundleEntryModulePlugin(ctx), cssModuleImports.cssModulesPlugin(ctx, { - outputCss: true - }), vanillaExtract.vanillaExtractPlugin(ctx, { - outputCss: true - }), cssSideEffectImports.cssSideEffectImportsPlugin(ctx), cssImports.cssFilePlugin(ctx), absoluteCssUrlsPlugin.absoluteCssUrlsPlugin(), external.externalPlugin(/^https?:\/\//, { - sideEffects: false - }), mdx.mdxPlugin(ctx), - // Skip compilation of common packages/scopes known not to include CSS imports - emptyModules.emptyModulesPlugin(ctx, /^(@remix-run|react|react-dom)(\/.*)?$/, { - includeNodeModules: true - }), emptyModules.emptyModulesPlugin(ctx, /\.server(\.[jt]sx?)?$/), external.externalPlugin(/^node:.*/, { - sideEffects: false - })], - supported: { - "import-meta": true - } - }; -}; -let create = async ctx => { - let compiler = await esbuild__namespace.context({ - ...createEsbuildConfig(ctx), - write: false, - metafile: true - }); - let compile = async () => { - let { - outputFiles, - metafile - } = await compiler.rebuild(); - analysis.writeMetafile(ctx, "metafile.css.json", metafile); - let bundleOutputFile = outputFiles.find(outputFile => bundle.isBundle(ctx, outputFile, ".css")); - return { - bundleOutputFile, - outputFiles - }; - }; - return { - compile, - cancel: compiler.cancel, - dispose: compiler.dispose - }; -}; - -exports.create = create; diff --git a/.yalc/@remix-run/dev/dist/compiler/css/plugins/bundleEntry.js b/.yalc/@remix-run/dev/dist/compiler/css/plugins/bundleEntry.js deleted file mode 100644 index 7709eb9..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/css/plugins/bundleEntry.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @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'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -const cssBundleEntryModuleId = "__remix_cssBundleEntryModule__"; -const filter = new RegExp(`^${cssBundleEntryModuleId}$`); - -/** - * Creates a virtual module that imports all browser build entry points so that - * all reachable CSS can be included in a single file at the end of the build. - */ -function cssBundleEntryModulePlugin({ - config -}) { - return { - name: "css-bundle-entry-module", - setup(build) { - build.onResolve({ - filter - }, ({ - path - }) => { - return { - path, - namespace: "css-bundle-entry-module" - }; - }); - build.onLoad({ - filter - }, async () => { - return { - resolveDir: config.appDirectory, - loader: "js", - contents: [ - // These need to be exports to avoid tree shaking - `export * as entryClient from ${JSON.stringify(path__default["default"].resolve(config.rootDirectory, config.entryClientFilePath))};`, ...Object.keys(config.routes).map((key, index) => { - let route = config.routes[key]; - return `export * as route${index} from ${JSON.stringify(`./${route.file}`)};`; - })].join("\n") - }; - }); - } - }; -} - -exports.cssBundleEntryModuleId = cssBundleEntryModuleId; -exports.cssBundleEntryModulePlugin = cssBundleEntryModulePlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/fileWatchCache.js b/.yalc/@remix-run/dev/dist/compiler/fileWatchCache.js deleted file mode 100644 index 3f34bd6..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/fileWatchCache.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @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 picomatch = require('picomatch'); -var path = require('node:path'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var picomatch__default = /*#__PURE__*/_interopDefaultLegacy(picomatch); -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -const globMatchers = new Map(); -function getGlobMatcher(glob) { - let matcher = globMatchers.get(glob); - if (!matcher) { - matcher = picomatch__default["default"](normalizeSlashes(glob)); - globMatchers.set(glob, matcher); - } - return matcher; -} -function createFileWatchCache() { - let promiseForCacheKey = new Map(); - let fileDepsForCacheKey = new Map(); - let cacheKeysForFileDep = new Map(); - - // Glob dependencies are primarily here to support Tailwind. - // Tailwind directives like `@tailwind utilities` output a bunch of - // CSS that changes based on the usage of class names in any file matching - // the globs specified in the `content` array in the Tailwind config, so - // those globs become a dependency of any CSS file using these directives. - let globDepsForCacheKey = new Map(); - let cacheKeysForGlobDep = new Map(); - function invalidateCacheKey(invalidatedCacheKey) { - // If it's not a cache key (or doesn't have a cache entry), bail out - if (!promiseForCacheKey.has(invalidatedCacheKey)) { - return; - } - promiseForCacheKey.delete(invalidatedCacheKey); - - // Since we keep track of the mapping between cache key and file - // dependencies, we clear all references to the invalidated cache key. - // These will be repopulated when "set" or "getOrSet" are called. - let fileDeps = fileDepsForCacheKey.get(invalidatedCacheKey); - if (fileDeps) { - for (let fileDep of fileDeps) { - var _cacheKeysForFileDep$; - (_cacheKeysForFileDep$ = cacheKeysForFileDep.get(fileDep)) === null || _cacheKeysForFileDep$ === void 0 ? void 0 : _cacheKeysForFileDep$.delete(invalidatedCacheKey); - } - fileDepsForCacheKey.delete(invalidatedCacheKey); - } - - // Since we keep track of the mapping between cache key and glob - // dependencies, we clear all references to the invalidated cache key. - // These will be repopulated when "set" or "getOrSet" are called. - let globDeps = globDepsForCacheKey.get(invalidatedCacheKey); - if (globDeps) { - for (let glob of globDeps) { - var _cacheKeysForGlobDep$; - (_cacheKeysForGlobDep$ = cacheKeysForGlobDep.get(glob)) === null || _cacheKeysForGlobDep$ === void 0 ? void 0 : _cacheKeysForGlobDep$.delete(invalidatedCacheKey); - } - globDepsForCacheKey.delete(invalidatedCacheKey); - } - } - function invalidateFile(invalidatedFile) { - // Invalidate all cache entries that depend on the file. - let cacheKeys = cacheKeysForFileDep.get(invalidatedFile); - if (cacheKeys) { - for (let cacheKey of cacheKeys) { - invalidateCacheKey(cacheKey); - } - } - - // Invalidate all cache entries that depend on a glob that matches the file. - // Any glob could match the file, so we have to check all globs. - for (let [glob, cacheKeys] of cacheKeysForGlobDep) { - let match = getGlobMatcher(glob); - if (match && match(normalizeSlashes(invalidatedFile))) { - for (let cacheKey of cacheKeys) { - invalidateCacheKey(cacheKey); - } - } - } - } - function get(key) { - return promiseForCacheKey.get(key); - } - function set(key, promise) { - promiseForCacheKey.set(key, promise); - void promise.catch(() => { - // Swallow errors to prevent the build from crashing and remove the - // rejected promise from the cache so consumers can retry - if (promiseForCacheKey.get(key) === promise) { - promiseForCacheKey.delete(key); - } - return null; - }).then(promiseValue => { - // If the promise was rejected, don't attempt to track dependencies - if (promiseValue === null) { - return; - } - if (promiseForCacheKey.get(key) !== promise) { - // This cache key was invalidated before the promise resolved - // so we don't want to track the dependencies. - return; - } - let { - fileDependencies, - globDependencies - } = promiseValue; - - // Track all file dependencies for this entry point so we can invalidate - // all cache entries that depend on a file that was invalidated. - if (fileDependencies) { - let fileDeps = fileDepsForCacheKey.get(key); - if (!fileDeps) { - fileDeps = new Set(); - fileDepsForCacheKey.set(key, fileDeps); - } - for (let fileDep of fileDependencies) { - fileDeps.add(fileDep); - let cacheKeys = cacheKeysForFileDep.get(fileDep); - if (!cacheKeys) { - cacheKeys = new Set(); - cacheKeysForFileDep.set(fileDep, cacheKeys); - } - cacheKeys.add(key); - } - } - - // Track all glob dependencies for this entry point so we can invalidate - // all cache entries that depend on a glob that matches the invalided file. - if (globDependencies) { - let globDeps = globDepsForCacheKey.get(key); - if (!globDeps) { - globDeps = new Set(); - globDepsForCacheKey.set(key, globDeps); - } - for (let glob of globDependencies) { - globDeps.add(glob); - let cacheKeys = cacheKeysForGlobDep.get(glob); - if (!cacheKeys) { - cacheKeys = new Set(); - cacheKeysForGlobDep.set(glob, cacheKeys); - } - cacheKeys.add(key); - } - } - }); - return promise; - } - function getOrSet(key, lazySetter) { - return promiseForCacheKey.get(key) || set(key, lazySetter()); - } - return { - get, - set, - getOrSet, - invalidateFile - }; -} -function normalizeSlashes(file) { - return file.split(path__default["default"].win32.sep).join("/"); -} - -exports.createFileWatchCache = createFileWatchCache; diff --git a/.yalc/@remix-run/dev/dist/compiler/js/compiler.js b/.yalc/@remix-run/dev/dist/compiler/js/compiler.js deleted file mode 100644 index 6ad87c7..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/js/compiler.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @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_module = require('node:module'); -var esbuild = require('esbuild'); -var dependencies = require('../../dependencies.js'); -var loaders = require('../utils/loaders.js'); -var routes = require('./plugins/routes.js'); -var cssImports = require('../plugins/cssImports.js'); -var absoluteCssUrlsPlugin = require('../plugins/absoluteCssUrlsPlugin.js'); -var emptyModules = require('../plugins/emptyModules.js'); -var mdx = require('../plugins/mdx.js'); -var external = require('../plugins/external.js'); -var browserNodeBuiltinsPolyfill = require('./plugins/browserNodeBuiltinsPolyfill.js'); -var cssBundlePlugin = require('../plugins/cssBundlePlugin.js'); -var cssModuleImports = require('../plugins/cssModuleImports.js'); -var cssSideEffectImports = require('../plugins/cssSideEffectImports.js'); -var vanillaExtract = require('../plugins/vanillaExtract.js'); -var invariant = require('../../invariant.js'); -var hmr = require('./plugins/hmr.js'); -var analysis = require('../analysis.js'); - -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 esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild); - -const getFakeBuiltins = remixConfig => { - let dependencies$1 = Object.keys(dependencies.getAppDependencies(remixConfig)); - let fakeBuiltins = node_module.builtinModules.filter(mod => dependencies$1.includes(mod)); - return fakeBuiltins; -}; -const createEsbuildConfig = (ctx, refs) => { - let entryPoints = { - "entry.client": ctx.config.entryClientFilePath - }; - for (let id of Object.keys(ctx.config.routes)) { - entryPoints[id] = ctx.config.routes[id].file; - // All route entry points are virtual modules that will be loaded by the - // browserEntryPointsPlugin. This allows us to tree-shake server-only code - // that we don't want to run in the browser (i.e. action & loader). - entryPoints[id] += "?browser"; - } - if (ctx.options.mode === "development") { - let defaultsDirectory = path__namespace.resolve(__dirname, "..", "..", "config", "defaults"); - entryPoints["__remix_entry_dev"] = path__namespace.join(defaultsDirectory, "entry.dev.ts"); - } - let fakeBuiltins = getFakeBuiltins(ctx.config); - if (fakeBuiltins.length > 0) { - throw new Error(`It appears you're using a module that is built in to Node, but you installed it as a dependency which could cause problems. Please remove ${fakeBuiltins.join(", ")} before continuing.`); - } - let plugins = [routes.browserRouteModulesPlugin(ctx, /\?browser$/), cssBundlePlugin.cssBundlePlugin(refs), cssModuleImports.cssModulesPlugin(ctx, { - outputCss: false - }), vanillaExtract.vanillaExtractPlugin(ctx, { - outputCss: false - }), cssSideEffectImports.cssSideEffectImportsPlugin(ctx, { - hmr: ctx.options.mode === "development" - }), cssImports.cssFilePlugin(ctx), absoluteCssUrlsPlugin.absoluteCssUrlsPlugin(), external.externalPlugin(/^https?:\/\//, { - sideEffects: false - }), mdx.mdxPlugin(ctx), emptyModules.emptyModulesPlugin(ctx, /\.server(\.[jt]sx?)?$/), emptyModules.emptyModulesPlugin(ctx, /^@remix-run\/(deno|cloudflare|node)(\/.*)?$/, { - includeNodeModules: true - }), browserNodeBuiltinsPolyfill.browserNodeBuiltinsPolyfillPlugin(ctx)]; - if (ctx.options.mode === "development") { - plugins.push(hmr.hmrPlugin(ctx)); - } - return { - entryPoints, - outdir: ctx.config.assetsBuildDirectory, - platform: "browser", - format: "esm", - loader: loaders.loaders, - bundle: true, - logLevel: "silent", - splitting: true, - sourcemap: ctx.options.sourcemap, - // As pointed out by https://github.com/evanw/esbuild/issues/2440, when tsconfig is set to - // `undefined`, esbuild will keep looking for a tsconfig.json recursively up. This unwanted - // behavior can only be avoided by creating an empty tsconfig file in the root directory. - tsconfig: ctx.config.tsconfigPath, - mainFields: ["browser", "module", "main"], - treeShaking: true, - minify: ctx.options.mode === "production", - entryNames: "[dir]/[name]-[hash]", - chunkNames: "_shared/[name]-[hash]", - assetNames: "_assets/[name]-[hash]", - publicPath: ctx.config.publicPath, - define: { - "process.env.NODE_ENV": JSON.stringify(ctx.options.mode), - "process.env.REMIX_DEV_ORIGIN": JSON.stringify(ctx.options.REMIX_DEV_ORIGIN ?? ""), - ...(ctx.options.mode === "production" ? { - "import.meta.hot": "undefined" - } : {}) - }, - jsx: "automatic", - jsxDev: ctx.options.mode !== "production", - plugins, - supported: { - "import-meta": true - } - }; -}; -const create = async (ctx, refs) => { - let compiler = await esbuild__namespace.context({ - ...createEsbuildConfig(ctx, refs), - write: false, - metafile: true - }); - let compile = async () => { - let { - metafile, - outputFiles - } = await compiler.rebuild(); - analysis.writeMetafile(ctx, "metafile.js.json", metafile); - let hmr = undefined; - if (ctx.options.mode === "development") { - var _Object$entries$find; - let hmrRuntimeOutput = (_Object$entries$find = Object.entries(metafile.outputs).find(([_, output]) => output.inputs["hmr-runtime:remix:hmr"])) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]; - invariant["default"](hmrRuntimeOutput, "Expected to find HMR runtime in outputs"); - let hmrRuntime = ctx.config.publicPath + path__namespace.relative(ctx.config.assetsBuildDirectory, path__namespace.resolve(hmrRuntimeOutput)); - hmr = { - runtime: hmrRuntime, - timestamp: Date.now() - }; - } - return { - metafile, - hmr, - outputFiles - }; - }; - return { - compile, - cancel: compiler.cancel, - dispose: compiler.dispose - }; -}; - -exports.create = create; diff --git a/.yalc/@remix-run/dev/dist/compiler/js/plugins/browserNodeBuiltinsPolyfill.js b/.yalc/@remix-run/dev/dist/compiler/js/plugins/browserNodeBuiltinsPolyfill.js deleted file mode 100644 index 60ac45c..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/js/plugins/browserNodeBuiltinsPolyfill.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @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 esbuildPluginsNodeModulesPolyfill = require('esbuild-plugins-node-modules-polyfill'); - -const browserNodeBuiltinsPolyfillPlugin = ctx => { - var _ctx$config$browserNo, _ctx$config$browserNo2; - return esbuildPluginsNodeModulesPolyfill.nodeModulesPolyfillPlugin({ - // Rename plugin to improve error message attribution - name: "browser-node-builtins-polyfill-plugin", - // Only pass through the "modules" and "globals" options to ensure we - // don't leak the full plugin API to Remix consumers. - modules: ((_ctx$config$browserNo = ctx.config.browserNodeBuiltinsPolyfill) === null || _ctx$config$browserNo === void 0 ? void 0 : _ctx$config$browserNo.modules) ?? {}, - globals: ((_ctx$config$browserNo2 = ctx.config.browserNodeBuiltinsPolyfill) === null || _ctx$config$browserNo2 === void 0 ? void 0 : _ctx$config$browserNo2.globals) ?? {}, - // Mark any unpolyfilled Node builtins in the build output as errors. - fallback: "error", - formatError({ - moduleName, - importer, - polyfillExists - }) { - let normalizedModuleName = moduleName.replace("node:", ""); - let modulesConfigKey = /^[a-z_]+$/.test(normalizedModuleName) ? normalizedModuleName : JSON.stringify(normalizedModuleName); - return { - text: (polyfillExists ? [`Node builtin "${moduleName}" (imported by "${importer}") must be polyfilled for the browser. `, `You can enable this polyfill in your Remix config, `, `e.g. \`browserNodeBuiltinsPolyfill: { modules: { ${modulesConfigKey}: true } }\``] : [`Node builtin "${moduleName}" (imported by "${importer}") doesn't have a browser polyfill available. `, `You can stub it out with an empty object in your Remix config `, `e.g. \`browserNodeBuiltinsPolyfill: { modules: { ${modulesConfigKey}: "empty" } }\` `, "but note that this may cause runtime errors if the module is used in your browser code."]).join("") - }; - } - }); -}; - -exports.browserNodeBuiltinsPolyfillPlugin = browserNodeBuiltinsPolyfillPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/js/plugins/hmr.js b/.yalc/@remix-run/dev/dist/compiler/js/plugins/hmr.js deleted file mode 100644 index e9371de..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/js/plugins/hmr.js +++ /dev/null @@ -1,240 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var path = require('node:path'); - -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 fs__namespace = /*#__PURE__*/_interopNamespace(fs); -var path__namespace = /*#__PURE__*/_interopNamespace(path); - -let hmrPlugin = ({ - config -}) => { - return { - name: "remix-hmr", - setup: async build => { - let cache = new Map(); - build.onResolve({ - filter: /^remix:hmr$/ - }, args => { - return { - namespace: "hmr-runtime", - path: args.path - }; - }); - build.onLoad({ - filter: /.*/, - namespace: "hmr-runtime" - }, () => { - let reactRefreshRuntime = require.resolve("react-refresh/runtime").replace(/\\/g, "/"); - let contents = ` -import RefreshRuntime from "${reactRefreshRuntime}"; - -declare global { - interface Window { - $RefreshReg$: any; - $RefreshSig$: any; - } -} - -var prevRefreshReg = window.$RefreshReg$; -var prevRefreshSig = window.$RefreshSig$; - -window.$RefreshReg$ = (type, id) => { - const fullId = id; - RefreshRuntime.register(type, fullId); -}; -window.$RefreshReg$ = prevRefreshReg; -window.$RefreshSig$ = prevRefreshSig; -window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; -window.$RefreshRuntime$ = RefreshRuntime; - -window.$RefreshRuntime$.injectIntoGlobalHook(window); -window.$RefreshReg$ = () => {}; -window.$RefreshSig$ = () => (type) => type; - -if (!window.__hmr__) { - window.__hmr__ = { - contexts: {}, - }; -} - -export function createHotContext(id: string): ImportMetaHot { - let callback: undefined | ((mod: ModuleNamespace) => void); - let disposed = false; - - let hot = { - accept: (dep, cb) => { - if (typeof dep !== "string") { - cb = dep; - dep = undefined; - } - if (dep) { - if (window.__hmr__.contexts[dep]) { - window.__hmr__.contexts[dep].dispose(); - } - window.__hmr__.contexts[dep] = createHotContext(dep); - window.__hmr__.contexts[dep].accept(cb); - return; - } - if (disposed) { - throw new Error("import.meta.hot.accept() called after dispose()"); - } - if (callback) { - throw new Error("import.meta.hot.accept() already called"); - } - callback = cb; - }, - dispose: () => { - disposed = true; - }, - emit(self: ModuleNamespace) { - if (callback) { - callback(self); - return true; - } - return false; - }, - }; - - if (window.__hmr__.contexts[id]) { - window.__hmr__.contexts[id].dispose(); - } - window.__hmr__.contexts[id] = hot; - - return hot; -} - -declare global { - interface Window { - __hmr__: any; - } -} - `; - return { - loader: "ts", - contents, - resolveDir: config.appDirectory - }; - }); - build.onLoad({ - filter: /.*/, - namespace: "file" - }, async args => { - if (!args.path.match(/@remix-run[/\\]react[/\\]dist[/\\]esm[/\\]browser.js$/) && !args.path.match(/react-router[-dom]?[/\\]$/) && (!args.path.match(/\.[tj]sx?$/) || !fs__namespace.existsSync(args.path) || !args.path.startsWith(config.appDirectory))) { - return undefined; - } - let sourceCode = fs__namespace.readFileSync(args.path, "utf8"); - let value = cache.get(args.path); - if (!value || value.sourceCode !== sourceCode) { - let resultCode = await applyHMR(sourceCode, args, config, !!build.initialOptions.sourcemap, args.path.startsWith(config.appDirectory) ? fs__namespace.statSync(args.path).mtimeMs : undefined); - value = { - sourceCode, - output: { - contents: resultCode, - loader: args.path.endsWith(".ts") ? "ts" : "tsx", - resolveDir: path__namespace.dirname(args.path) - } - }; - cache.set(args.path, value); - } - return value.output; - }); - } - }; -}; -async function applyHMR(sourceCode, args, remixConfig, sourcemap, lastModified) { - let babel = await import('@babel/core'); - // @ts-expect-error - let babelPresetTypescript = await import('@babel/preset-typescript'); - // @ts-expect-error - let babelJsx = await import('@babel/plugin-syntax-jsx'); - // @ts-expect-error - let reactRefresh = await import('react-refresh/babel'); - // @ts-expect-error - let babelDecorators = await import('@babel/plugin-syntax-decorators'); - let IS_FAST_REFRESH_ENABLED = /\$RefreshReg\$\(/; - - // add import.meta.hot to the module - let argsPath = args.path; - let hmrId = JSON.stringify(path__namespace.relative(remixConfig.rootDirectory, argsPath)); - let hmrPrefix = `import * as __hmr__ from "remix:hmr"; -if (import.meta) { -import.meta.hot = __hmr__.createHotContext( -//@ts-expect-error -$id$ -); -${lastModified ? `import.meta.hot.lastModified = "${lastModified}";` : ""} -} -// REMIX HMR END -\n`.replace(/\$id\$/g, hmrId); - let sourceCodeWithHMR = hmrPrefix + sourceCode; - - // run babel to add react-refresh - let transformResult = babel.transformSync(sourceCodeWithHMR, { - filename: argsPath, - ast: false, - compact: false, - sourceMaps: sourcemap, - configFile: false, - babelrc: false, - presets: [babelPresetTypescript.default], - plugins: [[babelDecorators.default, { - legacy: true - }], babelJsx.default, [reactRefresh.default, { - skipEnvCheck: true - }]] - }); - let jsWithReactRefresh = (transformResult === null || transformResult === void 0 ? void 0 : transformResult.code) ?? sourceCodeWithHMR; - - // auto opt-in to accepting fast refresh updates if the module - // has react components - if (!IS_FAST_REFRESH_ENABLED.test(jsWithReactRefresh)) { - return "// REMIX HMR BEGIN\n" + sourceCodeWithHMR; - } - return `// REMIX HMR BEGIN -if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) { - console.warn('remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.'); -} else { - var prevRefreshReg = window.$RefreshReg$; - var prevRefreshSig = window.$RefreshSig$; - window.$RefreshReg$ = (type, id) => { - window.$RefreshRuntime$.register(type, ${JSON.stringify(hmrId)} + id); - } - window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform; -}\n` + jsWithReactRefresh + `\n -window.$RefreshReg$ = prevRefreshReg; -window.$RefreshSig$ = prevRefreshSig;`; -} - -exports.applyHMR = applyHMR; -exports.hmrPlugin = hmrPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/js/plugins/routes.js b/.yalc/@remix-run/dev/dist/compiler/js/plugins/routes.js deleted file mode 100644 index 6e26d00..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/js/plugins/routes.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @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 routeExports = require('../../utils/routeExports.js'); -var invariant = require('../../../invariant.js'); - -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); - -// If you change this, make sure you update loadRouteModuleWithBlockingLinks in -// remix-react/routes.ts -const browserSafeRouteExports = { - ErrorBoundary: true, - default: true, - handle: true, - links: true, - meta: true, - shouldRevalidate: true -}; - -/** - * This plugin loads route modules for the browser build, using module shims - * that re-export only the route module exports that are safe for the browser. - */ -function browserRouteModulesPlugin({ - config, - fileWatchCache -}, suffixMatcher) { - return { - name: "browser-route-modules", - async setup(build) { - let routesByFile = Object.keys(config.routes).reduce((map, key) => { - let route = config.routes[key]; - map.set(route.file, route); - return map; - }, new Map()); - build.onResolve({ - filter: suffixMatcher - }, args => { - return { - path: args.path, - namespace: "browser-route-module" - }; - }); - build.onLoad({ - filter: suffixMatcher, - namespace: "browser-route-module" - }, async args => { - let theExports; - let file = args.path.replace(suffixMatcher, ""); - let route = routesByFile.get(file); - try { - invariant["default"](route, `Cannot get route by path: ${args.path}`); - let cacheKey = `module-exports:${route.id}`; - let { - cacheValue: sourceExports - } = await fileWatchCache.getOrSet(cacheKey, async () => { - let file = path__namespace.resolve(config.appDirectory, config.routes[route.id].file); - return { - cacheValue: await routeExports.getRouteModuleExports(config, route.id), - fileDependencies: new Set([file]) - }; - }); - theExports = sourceExports.filter(ex => !!browserSafeRouteExports[ex]); - } catch (error) { - return { - errors: [{ - text: error.message, - pluginName: "browser-route-module" - }] - }; - } - let contents = "module.exports = {};"; - if (theExports.length !== 0) { - let spec = `{ ${theExports.join(", ")} }`; - contents = `export ${spec} from ${JSON.stringify(`./${file}`)};`; - } - return { - contents, - resolveDir: config.appDirectory, - loader: "js" - }; - }); - } - }; -} - -exports.browserRouteModulesPlugin = browserRouteModulesPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/js/write.js b/.yalc/@remix-run/dev/dist/compiler/js/write.js deleted file mode 100644 index d037beb..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/js/write.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @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 fse = require('fs-extra'); - -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); - -async function write(config, outputFiles) { - await fse__default["default"].ensureDir(path__namespace.dirname(config.assetsBuildDirectory)); - for (let file of outputFiles) { - await fse__default["default"].ensureDir(path__namespace.dirname(file.path)); - await fse__default["default"].writeFile(file.path, file.contents); - } -} - -exports.write = write; diff --git a/.yalc/@remix-run/dev/dist/compiler/lazyValue.js b/.yalc/@remix-run/dev/dist/compiler/lazyValue.js deleted file mode 100644 index 5f68803..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/lazyValue.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @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 channel = require('../channel.js'); - -const createLazyValue = args => { - let channel$1; - return { - async get() { - // Create channel and request lazy value on first `get` call - if (!channel$1) { - channel$1 = channel.create(); - try { - channel$1.ok(await args.get()); - } catch (err) { - channel$1.err(err); - } - } - - // Share the same result with all callers - let result = await channel$1.result; - if (!result.ok) { - throw result.error; - } - return result.value; - }, - cancel() { - var _args$onCancel; - (_args$onCancel = args.onCancel) === null || _args$onCancel === void 0 ? void 0 : _args$onCancel.call(args, { - resolve: value => { - var _channel; - return (_channel = channel$1) === null || _channel === void 0 ? void 0 : _channel.ok(value); - }, - reject: error => { - var _channel2; - return (_channel2 = channel$1) === null || _channel2 === void 0 ? void 0 : _channel2.err(error); - } - }); - } - }; -}; - -exports.createLazyValue = createLazyValue; diff --git a/.yalc/@remix-run/dev/dist/compiler/manifest.js b/.yalc/@remix-run/dev/dist/compiler/manifest.js deleted file mode 100644 index ee772c7..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/manifest.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var invariant = require('../invariant.js'); -var routeExports = require('./utils/routeExports.js'); -var crypto = require('./utils/crypto.js'); - -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); - -async function create({ - config, - metafile, - hmr, - fileWatchCache -}) { - function resolveUrl(outputPath) { - return createUrl(config.publicPath, path__namespace.relative(config.assetsBuildDirectory, path__namespace.resolve(outputPath))); - } - function resolveImports(imports) { - return imports.filter(im => im.kind === "import-statement").map(im => resolveUrl(im.path)); - } - let routesByFile = Object.keys(config.routes).reduce((map, key) => { - let route = config.routes[key]; - map.set(route.file, map.has(route.file) ? [...map.get(route.file), route] : [route]); - return map; - }, new Map()); - let entry; - let routes = {}; - for (let key of Object.keys(metafile.outputs).sort()) { - let output = metafile.outputs[key]; - if (!output.entryPoint) continue; - if (path__namespace.resolve(output.entryPoint) === config.entryClientFilePath) { - entry = { - module: resolveUrl(key), - imports: resolveImports(output.imports) - }; - // Only parse routes otherwise dynamic imports can fall into here and fail the build - } else if (output.entryPoint.startsWith("browser-route-module:")) { - let entryPointFile = output.entryPoint.replace(/(^browser-route-module:|\?browser$)/g, ""); - let groupedRoute = routesByFile.get(entryPointFile); - invariant["default"](groupedRoute, `Cannot get route(s) for entry point ${output.entryPoint}`); - for (let route of groupedRoute) { - let cacheKey = `module-exports:${route.id}`; - let { - cacheValue: sourceExports - } = await fileWatchCache.getOrSet(cacheKey, async () => { - let file = path__namespace.resolve(config.appDirectory, config.routes[route.id].file); - return { - cacheValue: await routeExports.getRouteModuleExports(config, route.id), - fileDependencies: new Set([file]) - }; - }); - routes[route.id] = { - id: route.id, - parentId: route.parentId, - path: route.path, - index: route.index, - caseSensitive: route.caseSensitive, - module: resolveUrl(key), - imports: resolveImports(output.imports), - hasAction: sourceExports.includes("action"), - hasLoader: sourceExports.includes("loader"), - hasErrorBoundary: sourceExports.includes("ErrorBoundary") - }; - } - } - } - invariant["default"](entry, `Missing output for entry point`); - optimizeRoutes(routes, entry.imports); - let fingerprintedValues = { - entry, - routes - }; - let version = crypto.getHash(JSON.stringify(fingerprintedValues)).slice(0, 8); - let nonFingerprintedValues = { - version, - hmr - }; - return { - ...fingerprintedValues, - ...nonFingerprintedValues - }; -} -const write = async (config, assetsManifest) => { - let filename = `manifest-${assetsManifest.version.toUpperCase()}.js`; - assetsManifest.url = config.publicPath + filename; - await writeFileSafe(path__namespace.join(config.assetsBuildDirectory, filename), `window.__remixManifest=${JSON.stringify(assetsManifest)};`); -}; -async function writeFileSafe(file, contents) { - await fs.promises.mkdir(path__namespace.dirname(file), { - recursive: true - }); - await fs.promises.writeFile(file, contents); - return file; -} -function createUrl(publicPath, file) { - return publicPath + file.split(path__namespace.win32.sep).join("/"); -} -function optimizeRoutes(routes, entryImports) { - // This cache is an optimization that allows us to avoid pruning the same - // route's imports more than once. - let importsCache = Object.create(null); - for (let key in routes) { - optimizeRouteImports(key, routes, entryImports, importsCache); - } -} -function optimizeRouteImports(routeId, routes, parentImports, importsCache) { - if (importsCache[routeId]) return importsCache[routeId]; - let route = routes[routeId]; - if (route.parentId) { - parentImports = parentImports.concat(optimizeRouteImports(route.parentId, routes, parentImports, importsCache)); - } - let routeImports = (route.imports || []).filter(url => !parentImports.includes(url)); - - // Setting `route.imports = undefined` prevents `imports: []` from showing up - // in the manifest JSON when there are no imports. - route.imports = routeImports.length > 0 ? routeImports : undefined; - - // Cache so the next lookup for this route is faster. - importsCache[routeId] = routeImports; - return routeImports; -} - -exports.create = create; -exports.write = write; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/absoluteCssUrlsPlugin.js b/.yalc/@remix-run/dev/dist/compiler/plugins/absoluteCssUrlsPlugin.js deleted file mode 100644 index e88cc66..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/absoluteCssUrlsPlugin.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @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'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -/** - * This plugin treats absolute paths in 'url()' css rules as external to prevent - * breaking changes - */ -const absoluteCssUrlsPlugin = () => { - return { - name: "absolute-css-urls-plugin", - setup: async build => { - build.onResolve({ - filter: /.*/ - }, async args => { - let { - kind, - path: resolvePath - } = args; - if (kind === "url-token" && path__default["default"].isAbsolute(resolvePath)) { - return { - path: resolvePath, - external: true - }; - } - }); - } - }; -}; - -exports.absoluteCssUrlsPlugin = absoluteCssUrlsPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js b/.yalc/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js deleted file mode 100644 index 5e4fccf..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @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 pluginName = "css-bundle-plugin"; -const namespace = `${pluginName}-ns`; - -/** - * This plugin lazily requests the CSS bundle href and then injects it into the - * JS for `@remix-run/css-bundle`. This ensures we only run the CSS bundle build - * if necessary and that changes to the CSS bundle result in an HMR update. - */ -function cssBundlePlugin(refs) { - return { - name: pluginName, - async setup(build) { - build.onResolve({ - filter: /^@remix-run\/css-bundle$/ - }, async args => { - return { - path: args.path, - namespace - }; - }); - build.onLoad({ - filter: /.*/, - namespace - }, async () => { - let cssBundleHref = await refs.lazyCssBundleHref.get(); - return { - loader: "js", - contents: `export const cssBundleHref = ${cssBundleHref ? JSON.stringify(cssBundleHref) : "undefined"};` - }; - }); - } - }; -} - -exports.cssBundlePlugin = cssBundlePlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/cssImports.js b/.yalc/@remix-run/dev/dist/compiler/plugins/cssImports.js deleted file mode 100644 index 8d96a2b..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/cssImports.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var esbuild = require('esbuild'); -var invariant = require('../../invariant.js'); -var postcss = require('../utils/postcss.js'); -var absoluteCssUrlsPlugin = require('./absoluteCssUrlsPlugin.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 esbuild__default = /*#__PURE__*/_interopDefaultLegacy(esbuild); - -const isExtendedLengthPath = /^\\\\\?\\/; -function normalizePathSlashes(p) { - return isExtendedLengthPath.test(p) ? p : p.replace(/\\/g, "/"); -} - -/** - * This plugin loads css files with the "css" loader (bundles and moves assets to assets directory) - * and exports the url of the css file as its default export. - */ -function cssFilePlugin(ctx) { - return { - name: "css-file", - async setup(build) { - let { - absWorkingDir, - assetNames, - chunkNames, - conditions, - define, - external, - sourceRoot, - treeShaking, - tsconfig, - format, - loader, - mainFields, - nodePaths, - platform, - publicPath, - target - } = build.initialOptions; - build.onLoad({ - filter: /\.css$/ - }, async args => { - let cacheKey = `css-file:${args.path}`; - let { - cacheValue: { - contents, - watchFiles, - warnings, - outputFilesWithoutEntry - } - } = await ctx.fileWatchCache.getOrSet(cacheKey, async () => { - let fileDependencies = new Set([args.path]); - let globDependencies = new Set(); - - // eslint-disable-next-line prefer-let/prefer-let -- Avoid needing to repeatedly check for null since const can't be reassigned - const postcssProcessor = await postcss.getPostcssProcessor(ctx); - let { - metafile, - outputFiles, - warnings, - errors - } = await esbuild__default["default"].build({ - absWorkingDir, - assetNames, - chunkNames, - conditions, - define, - external, - format, - mainFields, - nodePaths, - platform, - publicPath, - sourceRoot, - target, - treeShaking, - tsconfig, - minify: ctx.options.mode === "production", - bundle: true, - minifySyntax: true, - metafile: true, - write: false, - sourcemap: Boolean(ctx.options.sourcemap && postcssProcessor), - // We only need source maps if we're processing the CSS with PostCSS - splitting: false, - outdir: ctx.config.assetsBuildDirectory, - entryNames: assetNames, - entryPoints: [args.path], - loader: { - ...loader, - ".css": "css" - }, - plugins: [absoluteCssUrlsPlugin.absoluteCssUrlsPlugin(), ...(postcssProcessor ? [{ - name: "postcss-plugin", - async setup(build) { - build.onLoad({ - filter: /\.css$/, - namespace: "file" - }, async args => { - let contents = await fse__default["default"].readFile(args.path, "utf-8"); - let { - css, - messages - } = await postcssProcessor.process(contents, { - from: args.path, - to: args.path, - map: ctx.options.sourcemap - }); - postcss.populateDependenciesFromMessages({ - messages, - fileDependencies, - globDependencies - }); - return { - contents: css, - loader: "css" - }; - }); - } - }] : [])] - }); - if (errors && errors.length) { - throw { - errors - }; - } - invariant["default"](metafile, "metafile is missing"); - let { - outputs - } = metafile; - let entry = Object.keys(outputs).find(out => outputs[out].entryPoint); - invariant["default"](entry, "entry point not found"); - let normalizedEntry = path__namespace.resolve(ctx.config.rootDirectory, normalizePathSlashes(entry)); - let entryFile = outputFiles.find(file => { - return path__namespace.resolve(ctx.config.rootDirectory, normalizePathSlashes(file.path)) === normalizedEntry; - }); - invariant["default"](entryFile, "entry file not found"); - let outputFilesWithoutEntry = outputFiles.filter(file => file !== entryFile); - - // add all css assets to dependencies - for (let { - inputs - } of Object.values(outputs)) { - for (let input of Object.keys(inputs)) { - let resolvedInput = path__namespace.resolve(input); - fileDependencies.add(resolvedInput); - } - } - return { - cacheValue: { - contents: entryFile.contents, - // add all dependencies to watchFiles - watchFiles: Array.from(fileDependencies), - warnings, - outputFilesWithoutEntry - }, - fileDependencies, - globDependencies - }; - }); - - // write all assets - await Promise.all(outputFilesWithoutEntry.map(({ - path: filepath, - contents - }) => fse__default["default"].outputFile(filepath, contents))); - return { - contents, - loader: "file", - watchFiles, - warnings - }; - }); - } - }; -} - -exports.cssFilePlugin = cssFilePlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/cssModuleImports.js b/.yalc/@remix-run/dev/dist/compiler/plugins/cssModuleImports.js deleted file mode 100644 index 0e0d1fb..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/cssModuleImports.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var postcss$1 = require('postcss'); -var postcssModules = require('postcss-modules'); -var postcss = require('../utils/postcss.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var postcss__default = /*#__PURE__*/_interopDefaultLegacy(postcss$1); -var postcssModules__default = /*#__PURE__*/_interopDefaultLegacy(postcssModules); - -const pluginName = "css-modules-plugin"; -const namespace = `${pluginName}-ns`; -const cssModulesFilter = /\.module\.css$/; -const compiledCssQuery = "?css-modules-plugin-compiled-css"; -const compiledCssFilter = /\?css-modules-plugin-compiled-css$/; -const cssModulesPlugin = ({ - config, - options, - fileWatchCache -}, { - outputCss -}) => { - return { - name: pluginName, - setup: async build => { - build.onResolve({ - filter: cssModulesFilter, - namespace: "file" - }, async args => { - let resolvedPath = (await build.resolve(args.path, { - resolveDir: args.resolveDir, - kind: args.kind - })).path; - return { - path: resolvedPath - }; - }); - build.onLoad({ - filter: cssModulesFilter - }, async args => { - let { - path: absolutePath - } = args; - let resolveDir = path__default["default"].dirname(absolutePath); - let cacheKey = `css-module:${absolutePath}?mode=${options.mode}`; - let { - cacheValue - } = await fileWatchCache.getOrSet(cacheKey, async () => { - let fileContents = await fse__default["default"].readFile(absolutePath, "utf8"); - let exports = {}; - let fileDependencies = new Set([absolutePath]); - let globDependencies = new Set(); - let postcssPlugins = await postcss.loadPostcssPlugins({ - config - }); - let { - css: compiledCss, - messages - } = await postcss__default["default"]([...postcssPlugins, postcssModules__default["default"]({ - generateScopedName: options.mode === "production" ? "[hash:base64:5]" : "[name]__[local]__[hash:base64:5]", - getJSON: function (_, json) { - exports = json; - }, - async resolve(id, importer) { - let resolvedPath = (await build.resolve(id, { - resolveDir: path__default["default"].dirname(importer), - kind: "require-resolve" - })).path; - - // Since postcss-modules doesn't add `dependency` messages the - // way other plugins do, we mark any files that are passed to - // the `resolve` callback as dependencies of this CSS Module - fileDependencies.add(resolvedPath); - return resolvedPath; - } - })]).process(fileContents, { - from: absolutePath, - to: absolutePath - }); - - // Since we're also running with arbitrary user-defined PostCSS - // plugins, we need to manage dependencies declared by other plugins - postcss.populateDependenciesFromMessages({ - messages, - fileDependencies, - globDependencies - }); - let compiledJsWithoutCssImport = `export default ${JSON.stringify(exports)};`; - - // Each .module.css file ultimately resolves as a JS file that imports - // a virtual CSS file containing the compiled CSS, and exports the - // object that maps local names to generated class names. The compiled - // CSS file contents are passed to the virtual CSS file via pluginData. - let compiledJsWithCssImport = [`import "./${path__default["default"].basename(absolutePath)}${compiledCssQuery}";`, compiledJsWithoutCssImport].join("\n"); - return { - cacheValue: { - // We need to cache both variants of the compiled JS since the - // cache is shared between different builds. This allows each - // build to ask for the JS variant it needs without needing to - // generate its own custom JS on every build. - compiledJsWithCssImport, - compiledJsWithoutCssImport, - compiledCss - }, - fileDependencies - }; - }); - let { - compiledJsWithCssImport, - compiledJsWithoutCssImport, - compiledCss - } = cacheValue; - let pluginData = { - resolveDir, - compiledCss - }; - return { - contents: outputCss ? compiledJsWithCssImport : compiledJsWithoutCssImport, - loader: "js", - pluginData - }; - }); - build.onResolve({ - filter: compiledCssFilter - }, async args => { - let pluginData = args.pluginData; - let absolutePath = path__default["default"].resolve(args.resolveDir, args.path); - return { - namespace, - path: path__default["default"].relative(config.rootDirectory, absolutePath), - pluginData - }; - }); - build.onLoad({ - filter: compiledCssFilter, - namespace - }, async args => { - let pluginData = args.pluginData; - let { - resolveDir, - compiledCss - } = pluginData; - return { - resolveDir, - contents: compiledCss, - loader: "css" - }; - }); - } - }; -}; - -exports.cssModulesPlugin = cssModulesPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImports.js b/.yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImports.js deleted file mode 100644 index 345ad26..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/cssSideEffectImports.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var parser = require('@babel/parser'); -var traverse = require('@babel/traverse'); -var generate = require('@babel/generator'); -var postcss = require('../utils/postcss.js'); -var hmr = require('../js/plugins/hmr.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var traverse__default = /*#__PURE__*/_interopDefaultLegacy(traverse); -var generate__default = /*#__PURE__*/_interopDefaultLegacy(generate); - -const pluginName = "css-side-effects-plugin"; -const namespace = `${pluginName}-ns`; -const cssSideEffectSuffix = "?__remix_sideEffect__"; -const cssSideEffectFilter = new RegExp(`\\.css${cssSideEffectSuffix.replace("?", "\\?")}$`); -function isCssSideEffectImportPath(path) { - return cssSideEffectFilter.test(path); -} -const extensions = ["js", "jsx", "ts", "tsx", "mjs", "cjs"]; -const allJsFilesFilter = new RegExp(`\\.(${extensions.join("|")})$`); -const loaderForExtension = { - ".js": "jsx", - // Remix supports JSX in JS files - ".jsx": "jsx", - ".ts": "ts", - ".tsx": "tsx", - ".mjs": "js", - ".cjs": "js" -}; - -/** - * This plugin detects side-effect imports of CSS files and adds a suffix - * to the import path, e.g. `import "./styles.css"` is transformed to - * `import "./styles.css?__remix_sideEffect__"`). This allows them to be - * differentiated from non-side-effect imports so that they can be added - * to the CSS bundle. This is primarily designed to support packages that - * import plain CSS files directly within JS files. - */ -const cssSideEffectImportsPlugin = (ctx, { - hmr: hmr$1 = false -} = {}) => { - return { - name: pluginName, - setup: async build => { - build.onLoad({ - filter: allJsFilesFilter, - namespace: "file" - }, async args => { - let cacheKey = `css-side-effect-imports-plugin:${args.path}&hmr=${hmr$1}`; - let { - cacheValue - } = await ctx.fileWatchCache.getOrSet(cacheKey, async () => { - let fileDependencies = new Set([args.path]); - let code = await fse__default["default"].readFile(args.path, "utf8"); - - // Don't process file if it doesn't contain any references to CSS files - if (!code.includes(".css")) { - return { - fileDependencies, - cacheValue: null - }; - } - let loader = loaderForExtension[path__default["default"].extname(args.path)]; - let contents = addSuffixToCssSideEffectImports(loader, code); - if (args.path.startsWith(ctx.config.appDirectory) && hmr$1) { - contents = await hmr.applyHMR(contents, args, ctx.config, !!build.initialOptions.sourcemap); - } - return { - fileDependencies, - cacheValue: { - contents, - loader - } - }; - }); - if (!cacheValue) { - return null; - } - return { - contents: cacheValue.contents, - loader: cacheValue.loader - }; - }); - build.onResolve({ - filter: cssSideEffectFilter, - namespace: "file" - }, async args => { - let resolvedPath = (await build.resolve(args.path, { - resolveDir: args.resolveDir, - kind: args.kind - })).path; - - // If the resolved path isn't a CSS file then we don't want - // to handle it. In our case this is specifically done to - // avoid matching Vanilla Extract's .css.ts/.js files. - if (!resolvedPath.split("?")[0].endsWith(".css")) { - return null; - } - return { - path: path__default["default"].relative(ctx.config.rootDirectory, resolvedPath), - namespace - }; - }); - build.onLoad({ - filter: /\.css$/, - namespace - }, async args => { - let absolutePath = path__default["default"].resolve(ctx.config.rootDirectory, args.path); - let postcssProcessor = await postcss.getCachedPostcssProcessor(ctx); - return { - contents: postcssProcessor ? await postcssProcessor({ - path: absolutePath - }) : await fse__default["default"].readFile(absolutePath, "utf8"), - resolveDir: path__default["default"].dirname(absolutePath), - loader: "css" - }; - }); - } - }; -}; -const additionalLanguageFeatures = ["decorators"]; -const babelPluginsForLoader = { - js: ["jsx", ...additionalLanguageFeatures], - // Remix supports JSX in JS files - jsx: ["jsx", ...additionalLanguageFeatures], - ts: ["typescript", ...additionalLanguageFeatures], - tsx: ["typescript", "jsx", ...additionalLanguageFeatures] -}; -function addSuffixToCssSideEffectImports(loader, code) { - let ast = parser.parse(code, { - sourceType: "module", - plugins: babelPluginsForLoader[loader] - }); - traverse__default["default"](ast, { - // Handle `import "./styles.css"` - ImportDeclaration(path) { - if (path.node.specifiers.length === 0 && - // i.e. nothing was imported - path.node.source.value.endsWith(".css")) { - path.node.source.value += cssSideEffectSuffix; - } - }, - // Handle `require("./styles.css")` - CallExpression(path) { - if (path.node.callee.type === "Identifier" && path.node.callee.name === "require" && ( - // Require call must be its own statement, - // not nested within another expression, - path.parent.type === "ExpressionStatement" || - // or, the statement must only consist of a - // ternary or logical expression, without - // assigning the result to a variable. - (path.parent.type === "ConditionalExpression" || path.parent.type === "LogicalExpression") && path.parentPath.parent.type === "ExpressionStatement")) { - let specifier = path.node.arguments[0]; - if (specifier && specifier.type === "StringLiteral" && specifier.value.endsWith(".css")) { - specifier.value += cssSideEffectSuffix; - } - } - } - }); - let result = generate__default["default"](ast, { - retainLines: true, - compact: false - }).code; - return result; -} - -exports.addSuffixToCssSideEffectImports = addSuffixToCssSideEffectImports; -exports.cssSideEffectImportsPlugin = cssSideEffectImportsPlugin; -exports.isCssSideEffectImportPath = isCssSideEffectImportPath; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/emptyModules.js b/.yalc/@remix-run/dev/dist/compiler/plugins/emptyModules.js deleted file mode 100644 index 1b57ae7..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/emptyModules.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @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'); - -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); - -/** - * This plugin substitutes an empty module for any modules in the `app` - * directory that match the given `filter`. - */ -function emptyModulesPlugin({ - config -}, filter, { - includeNodeModules = false -} = {}) { - return { - name: "empty-modules", - setup(build) { - build.onResolve({ - filter - }, args => { - if (includeNodeModules || - // Limit this behavior to modules found in only the `app` directory. - // This allows node_modules to use the `.server.js` and `.client.js` - // naming conventions with different semantics. - path__namespace.resolve(args.resolveDir, args.path).startsWith(config.appDirectory)) { - return { - path: args.path, - namespace: "empty-module" - }; - } - }); - build.onLoad({ - filter: /.*/, - namespace: "empty-module" - }, () => { - return { - // Use an empty CommonJS module here instead of ESM to avoid "No - // matching export" errors in esbuild for stuff that is imported - // from this file. - contents: "module.exports = {};", - loader: "js" - }; - }); - } - }; -} - -exports.emptyModulesPlugin = emptyModulesPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/external.js b/.yalc/@remix-run/dev/dist/compiler/plugins/external.js deleted file mode 100644 index 7c3b991..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/external.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @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 externalPlugin = (filter, options = {}) => { - return { - name: "external", - setup(build) { - build.onResolve({ - filter - }, () => { - return { - external: true, - sideEffects: options.sideEffects - }; - }); - } - }; -}; - -exports.externalPlugin = externalPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/mdx.js b/.yalc/@remix-run/dev/dist/compiler/plugins/mdx.js deleted file mode 100644 index e47621b..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/mdx.js +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var path = require('node:path'); -var remarkMdxFrontmatter = require('remark-mdx-frontmatter'); -var loaders = require('../utils/loaders.js'); -var tsconfig = require('../utils/tsconfig.js'); - -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); - -function mdxPlugin({ - config -}) { - return { - name: "remix-mdx", - async setup(build) { - let [mdx, { - default: remarkFrontmatter - }] = await Promise.all([import('@mdx-js/mdx'), import('remark-frontmatter')]); - build.onResolve({ - filter: /\.mdx?$/ - }, args => { - let matchPath = tsconfig.createMatchPath(config.tsconfigPath); - // Resolve paths according to tsconfig paths property - function resolvePath(id) { - if (!matchPath) { - return id; - } - return matchPath(id, undefined, undefined, [".ts", ".tsx", ".js", ".jsx", ".mdx", ".md"]) || id; - } - let resolvedPath = resolvePath(args.path); - let resolved = path__namespace.resolve(args.resolveDir, resolvedPath); - return { - path: path__namespace.relative(config.appDirectory, resolved), - namespace: "mdx" - }; - }); - build.onLoad({ - filter: /\.mdx?$/ - }, async args => { - let absolutePath = path__namespace.join(config.appDirectory, args.path); - return processMDX(mdx, remarkFrontmatter, config, args.path, absolutePath); - }); - } - }; -} -async function processMDX( -// eslint-disable-next-line @typescript-eslint/consistent-type-imports -mdx, -// eslint-disable-next-line @typescript-eslint/consistent-type-imports -remarkFrontmatter, config, argsPath, absolutePath) { - try { - let fileContents = await fs.promises.readFile(absolutePath, "utf-8"); - let rehypePlugins = []; - let remarkPlugins = [remarkFrontmatter, [remarkMdxFrontmatter.remarkMdxFrontmatter, { - name: "attributes" - }]]; - switch (typeof config.mdx) { - case "object": - rehypePlugins.push(...(config.mdx.rehypePlugins || [])); - remarkPlugins.push(...(config.mdx.remarkPlugins || [])); - break; - case "function": - let mdxConfig = await config.mdx(argsPath); - rehypePlugins.push(...((mdxConfig === null || mdxConfig === void 0 ? void 0 : mdxConfig.rehypePlugins) || [])); - remarkPlugins.push(...((mdxConfig === null || mdxConfig === void 0 ? void 0 : mdxConfig.remarkPlugins) || [])); - break; - } - let remixExports = ` -export const filename = ${JSON.stringify(path__namespace.basename(argsPath))}; -export const headers = typeof attributes !== "undefined" && attributes.headers; -export const meta = typeof attributes !== "undefined" && attributes.meta; -export const handle = typeof attributes !== "undefined" && attributes.handle; - `; - let compiled = await mdx.compile(fileContents, { - jsx: true, - jsxRuntime: "automatic", - rehypePlugins, - remarkPlugins - }); - let contents = ` -${compiled.value} -${remixExports}`; - let errors = []; - let warnings = []; - compiled.messages.forEach(message => { - let toPush = message.fatal ? errors : warnings; - toPush.push({ - location: message.line || message.column ? { - column: typeof message.column === "number" ? message.column : undefined, - line: typeof message.line === "number" ? message.line : undefined - } : undefined, - text: message.message, - detail: typeof message.note === "string" ? message.note : undefined - }); - }); - return { - errors: errors.length ? errors : undefined, - warnings: warnings.length ? warnings : undefined, - contents, - resolveDir: path__namespace.dirname(absolutePath), - loader: loaders.getLoaderForFile(argsPath) - }; - } catch (err) { - return { - errors: [{ - text: err.message - }] - }; - } -} - -exports.mdxPlugin = mdxPlugin; -exports.processMDX = processMDX; diff --git a/.yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js b/.yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js deleted file mode 100644 index e40bdcc..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * @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 integration = require('@vanilla-extract/integration'); -var loaders = require('../utils/loaders.js'); -var postcss = require('../utils/postcss.js'); -var dependencies = require('../../dependencies.js'); - -const pluginName = "vanilla-extract-plugin"; -const namespace = `${pluginName}-ns`; -const virtualCssFileFilter = /\.vanilla.css$/; -const staticAssetRegexp = new RegExp(`(${Object.keys(loaders.loaders).filter(ext => ext !== ".css" && loaders.loaders[ext] === "file").join("|")})$`); -let compiler; -function getCompiler(root, mode) { - compiler = compiler || integration.createCompiler({ - root, - identifiers: mode === "production" ? "short" : "debug", - vitePlugins: [{ - name: "remix-assets", - enforce: "pre", - async resolveId(source) { - // Handle root-relative imports within Vanilla Extract files - if (source.startsWith("~")) { - return await this.resolve(source.replace("~", "")); - } - // Handle static asset JS imports - if (source.startsWith("/") && staticAssetRegexp.test(source)) { - return { - external: true, - id: "~" + source - }; - } - }, - transform(code) { - // Translate Vite's fs import format for root-relative imports - return code.replace(/\/@fs\/~\//g, "~/"); - } - }] - }); - return compiler; -} -function vanillaExtractPlugin({ - config, - options -}, { - outputCss -}) { - return { - name: pluginName, - async setup(build) { - let appDependencies = dependencies.getAppDependencies(config, true); - if (!appDependencies["@vanilla-extract/css"]) { - return; - } - let root = config.appDirectory; - - // Resolve virtual CSS files first to avoid resolving the same - // file multiple times since this filter is more specific and - // doesn't require a file system lookup. - build.onResolve({ - filter: virtualCssFileFilter - }, args => { - return { - path: args.path, - namespace - }; - }); - - // Mark all .css.ts/js files as having side effects. This is to ensure - // that all usages of `globalStyle` are included in the CSS bundle, even - // if a .css.ts/js file has no exports or is otherwise tree-shaken. - let preventInfiniteLoop = {}; - build.onResolve({ - filter: /\.css(\.(j|t)sx?)?(\?.*)?$/, - namespace: "file" - }, async args => { - if (args.pluginData === preventInfiniteLoop) { - return null; - } - let resolvedPath = (await build.resolve(args.path, { - resolveDir: args.resolveDir, - kind: args.kind, - pluginData: preventInfiniteLoop - })).path; - if (!integration.cssFileFilter.test(resolvedPath)) { - return null; - } - return { - path: resolvedPath, - sideEffects: true - }; - }); - build.onLoad({ - filter: virtualCssFileFilter, - namespace - }, async ({ - path: path$1 - }) => { - let [relativeFilePath] = path$1.split(".vanilla.css"); - let compiler = getCompiler(root, options.mode); - let { - css, - filePath - } = compiler.getCssForFile(relativeFilePath); - let resolveDir = path.dirname(path.resolve(root, filePath)); - let postcssProcessor = await postcss.getPostcssProcessor({ - config, - postcssContext: { - vanillaExtract: true - } - }); - if (postcssProcessor) { - css = (await postcssProcessor.process(css, { - from: path$1, - to: path$1 - })).css; - } - return { - contents: css, - loader: "css", - resolveDir - }; - }); - build.onLoad({ - filter: integration.cssFileFilter - }, async ({ - path: filePath - }) => { - let compiler = getCompiler(root, options.mode); - let { - source, - watchFiles - } = await compiler.processVanillaFile(filePath, { - outputCss - }); - return { - contents: source, - resolveDir: path.dirname(filePath), - loader: "js", - watchFiles: (Array.from(watchFiles) || []).map(watchFile => watchFile.startsWith("~") ? path.resolve(root, watchFile.replace("~", ".")) : watchFile) - }; - }); - } - }; -} - -exports.vanillaExtractPlugin = vanillaExtractPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/compiler.js b/.yalc/@remix-run/dev/dist/compiler/server/compiler.js deleted file mode 100644 index 7e210ef..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/compiler.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @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 esbuild = require('esbuild'); -var loaders = require('../utils/loaders.js'); -var cssModuleImports = require('../plugins/cssModuleImports.js'); -var cssSideEffectImports = require('../plugins/cssSideEffectImports.js'); -var vanillaExtract = require('../plugins/vanillaExtract.js'); -var cssImports = require('../plugins/cssImports.js'); -var absoluteCssUrlsPlugin = require('../plugins/absoluteCssUrlsPlugin.js'); -var emptyModules = require('../plugins/emptyModules.js'); -var serverNodeBuiltinsPolyfill = require('./plugins/serverNodeBuiltinsPolyfill.js'); -var mdx = require('../plugins/mdx.js'); -var manifest = require('./plugins/manifest.js'); -var bareImports = require('./plugins/bareImports.js'); -var entry = require('./plugins/entry.js'); -var routes = require('./plugins/routes.js'); -var external = require('../plugins/external.js'); -var cssBundlePlugin = require('../plugins/cssBundlePlugin.js'); -var analysis = require('../analysis.js'); - -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 esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild); - -const createEsbuildConfig = (ctx, refs) => { - let stdin; - let entryPoints; - if (ctx.config.serverEntryPoint) { - entryPoints = [ctx.config.serverEntryPoint]; - } else { - stdin = { - contents: ctx.config.serverBuildTargetEntryModule, - resolveDir: ctx.config.rootDirectory, - loader: "ts" - }; - } - let plugins = [cssBundlePlugin.cssBundlePlugin(refs), cssModuleImports.cssModulesPlugin(ctx, { - outputCss: false - }), vanillaExtract.vanillaExtractPlugin(ctx, { - outputCss: false - }), cssSideEffectImports.cssSideEffectImportsPlugin(ctx), cssImports.cssFilePlugin(ctx), absoluteCssUrlsPlugin.absoluteCssUrlsPlugin(), external.externalPlugin(/^https?:\/\//, { - sideEffects: false - }), mdx.mdxPlugin(ctx), emptyModules.emptyModulesPlugin(ctx, /\.client(\.[jt]sx?)?$/), routes.serverRouteModulesPlugin(ctx), entry.serverEntryModulePlugin(ctx), manifest.serverAssetsManifestPlugin(refs), bareImports.serverBareModulesPlugin(ctx), external.externalPlugin(/^node:.*/, { - sideEffects: false - })]; - if (ctx.config.serverNodeBuiltinsPolyfill) { - plugins.unshift(serverNodeBuiltinsPolyfill.serverNodeBuiltinsPolyfillPlugin(ctx)); - } - return { - absWorkingDir: ctx.config.rootDirectory, - stdin, - entryPoints, - outfile: ctx.config.serverBuildPath, - conditions: ctx.config.serverConditions, - platform: ctx.config.serverPlatform, - format: ctx.config.serverModuleFormat, - treeShaking: true, - // The type of dead code elimination we want to do depends on the - // minify syntax property: https://github.com/evanw/esbuild/issues/672#issuecomment-1029682369 - // Dev builds are leaving code that should be optimized away in the - // bundle causing server / testing code to be shipped to the browser. - // These are properly optimized away in prod builds today, and this - // PR makes dev mode behave closer to production in terms of dead - // code elimination / tree shaking is concerned. - minifySyntax: true, - minify: ctx.options.mode === "production" && ctx.config.serverMinify, - mainFields: ctx.config.serverMainFields, - target: "node18", - loader: loaders.loaders, - bundle: true, - logLevel: "silent", - // As pointed out by https://github.com/evanw/esbuild/issues/2440, when tsconfig is set to - // `undefined`, esbuild will keep looking for a tsconfig.json recursively up. This unwanted - // behavior can only be avoided by creating an empty tsconfig file in the root directory. - tsconfig: ctx.config.tsconfigPath, - sourcemap: ctx.options.sourcemap, - // use linked (true) to fix up .map file - // The server build needs to know how to generate asset URLs for imports - // of CSS and other files. - assetNames: "_assets/[name]-[hash]", - publicPath: ctx.config.publicPath, - define: { - "process.env.NODE_ENV": JSON.stringify(ctx.options.mode), - "process.env.REMIX_DEV_ORIGIN": JSON.stringify(ctx.options.REMIX_DEV_ORIGIN ?? "") - }, - jsx: "automatic", - jsxDev: ctx.options.mode !== "production", - plugins - }; -}; -const create = async (ctx, refs) => { - let compiler = await esbuild__namespace.context({ - ...createEsbuildConfig(ctx, refs), - write: false, - metafile: true - }); - let compile = async () => { - let { - outputFiles, - metafile - } = await compiler.rebuild(); - analysis.writeMetafile(ctx, "metafile.server.json", metafile); - return outputFiles; - }; - return { - compile, - cancel: compiler.cancel, - dispose: compiler.dispose - }; -}; - -exports.create = create; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/plugins/bareImports.js b/.yalc/@remix-run/dev/dist/compiler/server/plugins/bareImports.js deleted file mode 100644 index bb0dfdb..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/plugins/bareImports.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @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 virtualModules = require('../virtualModules.js'); -var cssSideEffectImports = require('../../plugins/cssSideEffectImports.js'); -var tsconfig = require('../../utils/tsconfig.js'); -var loaders = require('../../utils/loaders.js'); - -/** - * A plugin responsible for resolving bare module ids based on server target. - * This includes externalizing for node based platforms, and bundling for single file - * environments such as cloudflare. - */ -function serverBareModulesPlugin(ctx) { - // Resolve paths according to tsconfig paths property - let matchPath = ctx.config.tsconfigPath ? tsconfig.createMatchPath(ctx.config.tsconfigPath) : undefined; - function resolvePath(id) { - if (!matchPath) { - return id; - } - return matchPath(id, undefined, undefined, [".ts", ".tsx", ".js", ".jsx"]) || id; - } - return { - name: "server-bare-modules", - setup(build) { - build.onResolve({ - filter: /.*/ - }, ({ - importer, - path - }) => { - // If it's not a bare module ID, bundle it. - if (!isBareModuleId(resolvePath(path))) { - return undefined; - } - - // Always bundle @remix-run/css-bundle - if (path === "@remix-run/css-bundle") { - return undefined; - } - - // To prevent `import xxx from "remix"` from ending up in the bundle - // we "bundle" remix but the other modules where the code lives. - if (path === "remix") { - return undefined; - } - - // These are our virtual modules, always bundle them because there is no - // "real" file on disk to externalize. - if (path === virtualModules.serverBuildVirtualModule.id || path === virtualModules.assetsManifestVirtualModule.id) { - return undefined; - } - - // Skip assets that are treated as files (.css, .svg, .png, etc.). - // Otherwise, esbuild would emit code that would attempt to require() - // or import these files --- which aren't JavaScript! - let loader; - try { - loader = loaders.getLoaderForFile(path); - } catch (e) { - if (!(e instanceof Error && e.message.startsWith("Cannot get loader for file"))) { - throw e; - } - } - if (loader === "file") { - return undefined; - } - - // Always bundle CSS side-effect imports. - if (cssSideEffectImports.isCssSideEffectImportPath(path)) { - return undefined; - } - if (ctx.config.serverDependenciesToBundle === "all") { - return undefined; - } - for (let pattern of ctx.config.serverDependenciesToBundle) { - // bundle it if the path matches the pattern - if (typeof pattern === "string" ? path === pattern : pattern.test(path)) { - return undefined; - } - } - - // Externalize everything else if we've gotten here. - return { - path, - external: true - }; - }); - } - }; -} -function isBareModuleId(id) { - return !id.startsWith("node:") && !id.startsWith(".") && !path.isAbsolute(id); -} - -exports.serverBareModulesPlugin = serverBareModulesPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/plugins/entry.js b/.yalc/@remix-run/dev/dist/compiler/server/plugins/entry.js deleted file mode 100644 index a3ab544..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/plugins/entry.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @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 virtualModules = require('../virtualModules.js'); - -/** - * Creates a virtual module called `@remix-run/dev/server-build` that exports the - * compiled server build for consumption in remix request handlers. This allows - * for you to consume the build in a custom server entry that is also fed through - * the compiler. - */ -function serverEntryModulePlugin({ - config, - options -}) { - let filter = virtualModules.serverBuildVirtualModule.filter; - return { - name: "server-entry-module", - setup(build) { - build.onResolve({ - filter - }, ({ - path - }) => { - return { - path, - namespace: "server-entry-module" - }; - }); - build.onLoad({ - filter - }, async () => { - return { - resolveDir: config.appDirectory, - loader: "js", - contents: ` -import * as entryServer from ${JSON.stringify(config.entryServerFilePath)}; -${Object.keys(config.routes).map((key, index) => { - // IMPORTANT: Any values exported from this generated module must also be - // typed in `packages/remix-dev/server-build.ts` to avoid tsc errors. - let route = config.routes[key]; - return `import * as route${index} from ${JSON.stringify(`./${route.file}`)};`; - }).join("\n")} - export const mode = ${JSON.stringify(options.mode)}; - export { default as assets } from ${JSON.stringify(virtualModules.assetsManifestVirtualModule.id)}; - export const assetsBuildDirectory = ${JSON.stringify(config.relativeAssetsBuildDirectory)}; - export const future = ${JSON.stringify(config.future)}; - export const publicPath = ${JSON.stringify(config.publicPath)}; - export const entry = { module: entryServer }; - export const routes = { - ${Object.keys(config.routes).map((key, index) => { - let route = config.routes[key]; - return `${JSON.stringify(key)}: { - id: ${JSON.stringify(route.id)}, - parentId: ${JSON.stringify(route.parentId)}, - path: ${JSON.stringify(route.path)}, - index: ${JSON.stringify(route.index)}, - caseSensitive: ${JSON.stringify(route.caseSensitive)}, - module: route${index} - }`; - }).join(",\n ")} - };` - }; - }); - } - }; -} - -exports.serverEntryModulePlugin = serverEntryModulePlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/plugins/manifest.js b/.yalc/@remix-run/dev/dist/compiler/server/plugins/manifest.js deleted file mode 100644 index c555c71..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/plugins/manifest.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @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 jsesc = require('jsesc'); -var virtualModules = require('../virtualModules.js'); -var cancel = require('../../cancel.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var jsesc__default = /*#__PURE__*/_interopDefaultLegacy(jsesc); - -/** - * Creates a virtual module called `@remix-run/dev/assets-manifest` that exports - * the assets manifest. This is used in the server entry module to access the - * assets manifest in the server build. - */ -function serverAssetsManifestPlugin(refs) { - let filter = virtualModules.assetsManifestVirtualModule.filter; - return { - name: "server-assets-manifest", - setup(build) { - build.onResolve({ - filter - }, ({ - path - }) => { - return { - path, - namespace: "server-assets-manifest" - }; - }); - build.onLoad({ - filter - }, async () => { - let manifest = await refs.manifestChannel.result; - if (!manifest.ok) throw new cancel.Cancel("server"); - return { - contents: `export default ${jsesc__default["default"](manifest.value, { - es6: true - })};`, - loader: "js" - }; - }); - } - }; -} - -exports.serverAssetsManifestPlugin = serverAssetsManifestPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/plugins/routes.js b/.yalc/@remix-run/dev/dist/compiler/server/plugins/routes.js deleted file mode 100644 index 945dfac..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/plugins/routes.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var loaders = require('../../utils/loaders.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); - -/** - * This plugin loads route modules for the server build and prevents errors - * while adding new files in development mode. - */ -function serverRouteModulesPlugin({ - config -}) { - return { - name: "server-route-modules", - setup(build) { - let routeFiles = new Set(Object.keys(config.routes).map(key => path__namespace.resolve(config.appDirectory, config.routes[key].file))); - build.onResolve({ - filter: /.*/ - }, args => { - if (routeFiles.has(args.path)) { - return { - path: args.path, - namespace: "route" - }; - } - }); - build.onLoad({ - filter: /.*/, - namespace: "route" - }, async args => { - let file = args.path; - let contents = await fse__default["default"].readFile(file, "utf-8"); - - // Default to `export {}` if the file is empty so esbuild interprets - // this file as ESM instead of CommonJS with `default: {}`. This helps - // in development when creating new files. - // See https://github.com/evanw/esbuild/issues/1043 - if (!/\S/.test(contents)) { - return { - contents: "export {}", - loader: "js" - }; - } - return { - contents, - resolveDir: path__namespace.dirname(file), - loader: loaders.getLoaderForFile(file) - }; - }); - } - }; -} - -exports.serverRouteModulesPlugin = serverRouteModulesPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/plugins/serverNodeBuiltinsPolyfill.js b/.yalc/@remix-run/dev/dist/compiler/server/plugins/serverNodeBuiltinsPolyfill.js deleted file mode 100644 index eb87fcb..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/plugins/serverNodeBuiltinsPolyfill.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @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 esbuildPluginsNodeModulesPolyfill = require('esbuild-plugins-node-modules-polyfill'); - -const serverNodeBuiltinsPolyfillPlugin = ctx => { - var _ctx$config$serverNod, _ctx$config$serverNod2; - return esbuildPluginsNodeModulesPolyfill.nodeModulesPolyfillPlugin({ - // Rename plugin to improve error message attribution - name: "server-node-builtins-polyfill-plugin", - // Only pass through the "modules" and "globals" options to ensure we - // don't leak the full plugin API to Remix consumers. - modules: ((_ctx$config$serverNod = ctx.config.serverNodeBuiltinsPolyfill) === null || _ctx$config$serverNod === void 0 ? void 0 : _ctx$config$serverNod.modules) ?? {}, - globals: ((_ctx$config$serverNod2 = ctx.config.serverNodeBuiltinsPolyfill) === null || _ctx$config$serverNod2 === void 0 ? void 0 : _ctx$config$serverNod2.globals) ?? {}, - // Since the server environment may provide its own Node polyfills, - // we don't define any fallback behavior here and allow all Node - // builtins to be marked as external - fallback: "none" - }); -}; - -exports.serverNodeBuiltinsPolyfillPlugin = serverNodeBuiltinsPolyfillPlugin; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/virtualModules.js b/.yalc/@remix-run/dev/dist/compiler/server/virtualModules.js deleted file mode 100644 index 67c2e81..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/virtualModules.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @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 serverBuildVirtualModule = { - id: "@remix-run/dev/server-build", - filter: /^@remix-run\/dev\/server-build$/ -}; -const assetsManifestVirtualModule = { - id: "@remix-run/dev/assets-manifest", - filter: /^@remix-run\/dev\/assets-manifest$/ -}; - -exports.assetsManifestVirtualModule = assetsManifestVirtualModule; -exports.serverBuildVirtualModule = serverBuildVirtualModule; diff --git a/.yalc/@remix-run/dev/dist/compiler/server/write.js b/.yalc/@remix-run/dev/dist/compiler/server/write.js deleted file mode 100644 index dae989c..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/server/write.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @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 fse = require('fs-extra'); - -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); - -async function write(config, outputFiles) { - await fse__default["default"].ensureDir(path__namespace.dirname(config.serverBuildPath)); - for (let file of outputFiles) { - if ([".js", ".cjs", ".mjs"].some(ext => file.path.endsWith(ext))) { - // fix sourceMappingURL to be relative to current path instead of /build - let filename = file.path.substring(file.path.lastIndexOf(path__namespace.sep) + 1); - let escapedFilename = filename.replace(/([.[\]])/g, "\\$1"); - let pattern = `(//# sourceMappingURL=)(.*)${escapedFilename}`; - let contents = Buffer.from(file.contents).toString("utf-8"); - contents = contents.replace(new RegExp(pattern), `$1${filename}`); - await fse__default["default"].writeFile(file.path, contents); - } else if (file.path.endsWith(".map")) { - // Don't write CSS source maps to server build output - if (file.path.endsWith(".css.map")) { - break; - } - - // remove route: prefix from source filenames so breakpoints work - let contents = Buffer.from(file.contents).toString("utf-8"); - contents = contents.replace(/"route:/gm, '"'); - await fse__default["default"].writeFile(file.path, contents); - } else { - let assetPath = path__namespace.join(config.assetsBuildDirectory, file.path.replace(path__namespace.dirname(config.serverBuildPath), "")); - - // Don't write CSS bundle from server build to browser assets directory, - // especially since the file name doesn't contain a content hash - if (assetPath === path__namespace.join(config.assetsBuildDirectory, "index.css")) { - break; - } - await fse__default["default"].ensureDir(path__namespace.dirname(assetPath)); - await fse__default["default"].writeFile(assetPath, file.contents); - } - } -} - -exports.write = write; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/crypto.js b/.yalc/@remix-run/dev/dist/compiler/utils/crypto.js deleted file mode 100644 index acbf0e2..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/crypto.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var node_crypto = require('node:crypto'); - -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 fs__namespace = /*#__PURE__*/_interopNamespace(fs); - -function getHash(source) { - return node_crypto.createHash("sha256").update(source).digest("hex"); -} -async function getFileHash(file) { - return new Promise((accept, reject) => { - let hash = node_crypto.createHash("sha256"); - fs__namespace.createReadStream(file).on("error", error => reject(error)).on("data", data => hash.update(data)).on("close", () => { - accept(hash.digest("hex")); - }); - }); -} - -exports.getFileHash = getFileHash; -exports.getHash = getHash; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/loaders.js b/.yalc/@remix-run/dev/dist/compiler/utils/loaders.js deleted file mode 100644 index 21865b0..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/loaders.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @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'); - -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); - -const loaders = { - ".aac": "file", - ".avif": "file", - ".css": "file", - ".csv": "file", - ".eot": "file", - ".fbx": "file", - ".flac": "file", - ".gif": "file", - ".glb": "file", - ".gltf": "file", - ".gql": "text", - ".graphql": "text", - ".hdr": "file", - ".ico": "file", - ".jpeg": "file", - ".jpg": "file", - ".js": "jsx", - ".jsx": "jsx", - ".json": "json", - // We preprocess md and mdx files using @mdx-js/mdx and send through - // the JSX for esbuild to handle - ".md": "jsx", - ".mdx": "jsx", - ".mov": "file", - ".mp3": "file", - ".mp4": "file", - ".node": "copy", - ".ogg": "file", - ".otf": "file", - ".png": "file", - ".psd": "file", - ".sql": "text", - ".svg": "file", - ".ts": "ts", - ".tsx": "tsx", - ".ttf": "file", - ".wasm": "file", - ".wav": "file", - ".webm": "file", - ".webmanifest": "file", - ".webp": "file", - ".woff": "file", - ".woff2": "file", - ".zip": "file" -}; -function getLoaderForFile(file) { - let ext = path__namespace.extname(file); - if (ext in loaders) return loaders[ext]; - throw new Error(`Cannot get loader for file ${file}`); -} - -exports.getLoaderForFile = getLoaderForFile; -exports.loaders = loaders; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/log.js b/.yalc/@remix-run/dev/dist/compiler/utils/log.js deleted file mode 100644 index 9907c4e..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/log.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @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 esbuild = require('esbuild'); -var cancel = require('../cancel.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var esbuild__default = /*#__PURE__*/_interopDefaultLegacy(esbuild); - -let toError = thrown => { - if (thrown instanceof Error) return thrown; - try { - return new Error(JSON.stringify(thrown)); - } catch { - // fallback in case there's an error stringifying. - // for example, due to circular references. - return new Error(String(thrown)); - } -}; -let isEsbuildError = error => { - return "warnings" in error && "errors" in error; -}; -let logEsbuildError = error => { - let warnings = esbuild__default["default"].formatMessagesSync(error.warnings, { - kind: "warning", - color: true - }); - warnings.forEach(w => console.warn(w)); - let errors = esbuild__default["default"].formatMessagesSync( - // Filter out cancelation errors - error.errors.filter(e => !e.text.startsWith(cancel.CANCEL_PREFIX)), { - kind: "error", - color: true - }); - errors.forEach(e => console.error(e)); -}; -let logThrown = thrown => { - let error = toError(thrown); - if (isEsbuildError(error)) { - logEsbuildError(error); - return; - } - console.error(error.message); -}; - -exports.logThrown = logThrown; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/postcss.js b/.yalc/@remix-run/dev/dist/compiler/utils/postcss.js deleted file mode 100644 index 0f6f313..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/postcss.js +++ /dev/null @@ -1,228 +0,0 @@ -/** - * @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_url = require('node:url'); -var fse = require('fs-extra'); -var loadConfig = require('postcss-load-config'); -var postcss = require('postcss'); -var config = require('../../config.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var loadConfig__default = /*#__PURE__*/_interopDefaultLegacy(loadConfig); -var postcss__default = /*#__PURE__*/_interopDefaultLegacy(postcss); - -const defaultPostcssContext = { - vanillaExtract: false -}; -function isPostcssEnabled(config) { - return config.postcss || config.tailwind; -} -function getCacheKey({ - config, - postcssContext -}) { - return [config.rootDirectory, postcssContext.vanillaExtract].join("|"); -} -let pluginsCache = new Map(); -async function loadPostcssPlugins({ - config, - postcssContext = defaultPostcssContext -}) { - if (!isPostcssEnabled(config)) { - return []; - } - let { - rootDirectory - } = config; - let cacheKey = getCacheKey({ - config, - postcssContext - }); - let cachedPlugins = pluginsCache.get(cacheKey); - if (cachedPlugins) { - return cachedPlugins; - } - let plugins = []; - if (config.postcss) { - try { - let postcssConfig = await loadConfig__default["default"]( - // We're nesting our custom context values in a "remix" - // namespace to avoid clashing with other tools. - { - remix: postcssContext - }, - // Custom config extensions aren't type safe - rootDirectory); - plugins.push(...postcssConfig.plugins); - } catch (err) { - // If they don't have a PostCSS config, just ignore it, - // otherwise rethrow the error. - if (err instanceof Error && !/No PostCSS Config found/i.test(err.message)) { - throw err; - } - } - } - if (config.tailwind) { - let tailwindPlugin = await loadTailwindPlugin(config); - if (tailwindPlugin && !hasTailwindPlugin(plugins, tailwindPlugin)) { - plugins.push(tailwindPlugin); - } - } - pluginsCache.set(cacheKey, plugins); - return plugins; -} -let processorCache = new Map(); -async function getPostcssProcessor({ - config, - postcssContext = defaultPostcssContext -}) { - if (!isPostcssEnabled(config)) { - return null; - } - let cacheKey = getCacheKey({ - config, - postcssContext - }); - let cachedProcessor = processorCache.get(cacheKey); - if (cachedProcessor !== undefined) { - return cachedProcessor; - } - let plugins = await loadPostcssPlugins({ - config, - postcssContext - }); - let processor = plugins.length > 0 ? postcss__default["default"](plugins) : null; - processorCache.set(cacheKey, processor); - return processor; -} -function hasTailwindPlugin(plugins, tailwindPlugin) { - return plugins.some(plugin => plugin === tailwindPlugin || typeof plugin === "function" && plugin.name === "tailwindcss" || "postcssPlugin" in plugin && plugin.postcssPlugin === "tailwindcss"); -} -let tailwindPluginCache = new Map(); -async function loadTailwindPlugin(config$1) { - var _await$import; - if (!config$1.tailwind) { - return null; - } - let { - rootDirectory - } = config$1; - let cacheKey = rootDirectory; - let cachedTailwindPlugin = tailwindPluginCache.get(cacheKey); - if (cachedTailwindPlugin !== undefined) { - return cachedTailwindPlugin; - } - let tailwindPath = null; - try { - // First ensure they have a Tailwind config - let tailwindConfigExtensions = [".js", ".cjs", ".mjs", ".ts"]; - let tailwindConfig = config.findConfig(rootDirectory, "tailwind.config", tailwindConfigExtensions); - if (!tailwindConfig) throw new Error("No Tailwind config found"); - - // Load Tailwind from the project directory - tailwindPath = require.resolve("tailwindcss", { - paths: [rootDirectory] - }); - } catch { - // If they don't have a Tailwind config or Tailwind installed, just ignore it. - return null; - } - let importedTailwindPlugin = tailwindPath ? (_await$import = await import(node_url.pathToFileURL(tailwindPath).href)) === null || _await$import === void 0 ? void 0 : _await$import.default : null; - let tailwindPlugin = importedTailwindPlugin && importedTailwindPlugin.postcss // Check that it declares itself as a PostCSS plugin - ? importedTailwindPlugin : null; - tailwindPluginCache.set(cacheKey, tailwindPlugin); - return tailwindPlugin; -} - -// PostCSS plugin result objects can contain arbitrary messages returned -// from plugins. Here we look for messages that indicate a dependency -// on another file or glob. Here we target the generic dependency messages -// returned from 'postcss-import' and 'tailwindcss' plugins, but we may -// need to add more in the future depending on what other plugins do. -// More info: -// - https://postcss.org/docs/postcss-runner-guidelines -// - https://postcss.org/api/#result -// - https://postcss.org/api/#message -function populateDependenciesFromMessages({ - messages, - fileDependencies, - globDependencies -}) { - for (let message of messages) { - if (message.type === "dependency" && typeof message.file === "string") { - fileDependencies.add(message.file); - continue; - } - if (message.type === "dir-dependency" && typeof message.dir === "string" && typeof message.glob === "string") { - globDependencies.add(path__default["default"].join(message.dir, message.glob)); - continue; - } - } -} -async function getCachedPostcssProcessor({ - config, - options, - fileWatchCache -}) { - // eslint-disable-next-line prefer-let/prefer-let -- Avoid needing to repeatedly check for null since const can't be reassigned - const postcssProcessor = await getPostcssProcessor({ - config - }); - if (!postcssProcessor) { - return null; - } - return async function processCss(args) { - let cacheKey = `postcss:${args.path}?sourcemap=${options.sourcemap}`; - let { - cacheValue - } = await fileWatchCache.getOrSet(cacheKey, async () => { - let contents = await fse__default["default"].readFile(args.path, "utf-8"); - let { - css, - messages - } = await postcssProcessor.process(contents, { - from: args.path, - to: args.path, - map: options.sourcemap - }); - let fileDependencies = new Set(); - let globDependencies = new Set(); - - // Ensure the CSS file being passed to PostCSS is tracked as a - // dependency of this cache key since a change to this file should - // invalidate the cache, not just its sub-dependencies. - fileDependencies.add(args.path); - populateDependenciesFromMessages({ - messages, - fileDependencies, - globDependencies - }); - return { - cacheValue: css, - fileDependencies, - globDependencies - }; - }); - return cacheValue; - }; -} - -exports.getCachedPostcssProcessor = getCachedPostcssProcessor; -exports.getPostcssProcessor = getPostcssProcessor; -exports.loadPostcssPlugins = loadPostcssPlugins; -exports.populateDependenciesFromMessages = populateDependenciesFromMessages; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/routeExports.js b/.yalc/@remix-run/dev/dist/compiler/utils/routeExports.js deleted file mode 100644 index c8eeb4d..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/routeExports.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @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 esbuild = require('esbuild'); -var cache = require('../../cache.js'); -var mdx = require('../plugins/mdx.js'); -var crypto = require('./crypto.js'); - -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 esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild); - -async function getRouteModuleExports(config, routeId) { - let file = path__namespace.resolve(config.appDirectory, config.routes[routeId].file); - let hash = await crypto.getFileHash(file); - let key = routeId + ".exports"; - let cached = null; - try { - cached = await cache.getJson(config.cacheDirectory, key); - } catch (error) { - // Ignore cache read errors. - } - if (!cached || cached.hash !== hash) { - let exports = await _getRouteModuleExports(config, routeId); - cached = { - hash, - exports - }; - try { - await cache.putJson(config.cacheDirectory, key, cached); - } catch (error) { - // Ignore cache put errors. - } - } - - // Layout routes can't have actions - if (routeId.match(/\/__[\s\w\d_-]+$/) && cached.exports.includes("action")) { - throw new Error(`Actions are not supported in layout routes: ${routeId}`); - } - return cached.exports; -} -async function _getRouteModuleExports(config, routeId) { - let result = await esbuild__namespace.build({ - entryPoints: [path__namespace.resolve(config.appDirectory, config.routes[routeId].file)], - platform: "neutral", - format: "esm", - metafile: true, - write: false, - loader: { - ".js": "jsx" - }, - logLevel: "silent", - plugins: [mdx.mdxPlugin({ - config - })] - }); - let metafile = result.metafile; - for (let key in metafile.outputs) { - let output = metafile.outputs[key]; - if (output.entryPoint) return output.exports; - } - throw new Error(`Unable to get exports for route ${routeId}`); -} - -exports.getRouteModuleExports = getRouteModuleExports; diff --git a/.yalc/@remix-run/dev/dist/compiler/utils/tsconfig.js b/.yalc/@remix-run/dev/dist/compiler/utils/tsconfig.js deleted file mode 100644 index c1a774a..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/utils/tsconfig.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @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 tsConfigPaths = require('tsconfig-paths'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var tsConfigPaths__default = /*#__PURE__*/_interopDefaultLegacy(tsConfigPaths); - -function createMatchPath(tsconfigPath) { - // There is no tsconfig to match paths against. - if (!tsconfigPath) { - return undefined; - } - - // When passing a absolute path, loadConfig assumes that the path contains - // a tsconfig file. - // Ref.: https://github.com/dividab/tsconfig-paths/blob/v4.0.0/src/__tests__/config-loader.test.ts#L74 - let configLoaderResult = tsConfigPaths__default["default"].loadConfig(tsconfigPath); - if (configLoaderResult.resultType === "failed") { - if (configLoaderResult.message === "Missing baseUrl in compilerOptions") { - throw new Error(`🚨 Oops! No baseUrl found, please set compilerOptions.baseUrl in your tsconfig or jsconfig`); - } - return undefined; - } - return tsConfigPaths__default["default"].createMatchPath(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll); -} - -exports.createMatchPath = createMatchPath; diff --git a/.yalc/@remix-run/dev/dist/compiler/watch.js b/.yalc/@remix-run/dev/dist/compiler/watch.js deleted file mode 100644 index 81590d6..0000000 --- a/.yalc/@remix-run/dev/dist/compiler/watch.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @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 chokidar = require('chokidar'); -var debounce = require('lodash.debounce'); -var path = require('node:path'); -var config = require('../config.js'); -var compiler = require('./compiler.js'); -var log = require('./utils/log.js'); -var routes = require('../config/routes.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 chokidar__default = /*#__PURE__*/_interopDefaultLegacy(chokidar); -var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce); -var path__namespace = /*#__PURE__*/_interopNamespace(path); - -function isEntryPoint(config, file) { - let configFile = path__namespace.join(config.rootDirectory, "remix.config.js"); - let appFile = path__namespace.relative(config.appDirectory, file); - let entryPoints = [configFile, config.entryClientFile, config.entryServerFile, ...Object.values(config.routes).map(route => route.file)]; - let normalized = routes.normalizeSlashes(appFile); - return entryPoints.includes(normalized); -} -function shouldIgnore(file) { - let filename = path__namespace.basename(file); - return filename === ".DS_Store"; -} -async function watch(ctx, { - reloadConfig = config.readConfig, - onBuildStart, - onBuildManifest, - onBuildFinish, - onFileCreated, - onFileChanged, - onFileDeleted -} = {}) { - var _ctx$config$watchPath; - let start = Date.now(); - let compiler$1 = await compiler.create(ctx); - let compile = () => compiler$1.compile({ - onManifest: onBuildManifest - }).catch(thrown => { - if (thrown instanceof Error && thrown.message === "The service is no longer running") { - ctx.logger.error("esbuild is no longer running", { - details: ["Most likely, your machine ran out of memory and killed the esbuild process", "that `remix dev` relies on for builds and rebuilds."] - }); - process.exit(1); - } - log.logThrown(thrown); - return undefined; - }); - - // initial build - onBuildStart === null || onBuildStart === void 0 ? void 0 : onBuildStart(ctx); - let manifest = await compile(); - onBuildFinish === null || onBuildFinish === void 0 ? void 0 : onBuildFinish(ctx, Date.now() - start, manifest !== undefined); - let restart = debounce__default["default"](async () => { - let start = Date.now(); - void compiler$1.dispose(); - try { - ctx.config = await reloadConfig(ctx.config.rootDirectory); - } catch (thrown) { - log.logThrown(thrown); - return; - } - onBuildStart === null || onBuildStart === void 0 ? void 0 : onBuildStart(ctx); - compiler$1 = await compiler.create(ctx); - let manifest = await compile(); - onBuildFinish === null || onBuildFinish === void 0 ? void 0 : onBuildFinish(ctx, Date.now() - start, manifest !== undefined); - }, 500); - let rebuild = debounce__default["default"](async () => { - await compiler$1.cancel(); - onBuildStart === null || onBuildStart === void 0 ? void 0 : onBuildStart(ctx); - let start = Date.now(); - let manifest = await compile(); - onBuildFinish === null || onBuildFinish === void 0 ? void 0 : onBuildFinish(ctx, Date.now() - start, manifest !== undefined); - }, 100); - let remixConfigPath = path__namespace.join(ctx.config.rootDirectory, "remix.config.js"); - let toWatch = [remixConfigPath, ctx.config.appDirectory]; - - // WARNING: Chokidar returns different paths in change events depending on - // whether the path provided to the watcher is absolute or relative. If the - // path is absolute, change events will contain absolute paths, and the - // opposite for relative paths. We need to ensure that the paths we provide - // are always absolute to ensure consistency in change events. - if (ctx.config.serverEntryPoint) { - toWatch.push(path__namespace.resolve(ctx.config.rootDirectory, ctx.config.serverEntryPoint)); - } - (_ctx$config$watchPath = ctx.config.watchPaths) === null || _ctx$config$watchPath === void 0 ? void 0 : _ctx$config$watchPath.forEach(watchPath => { - toWatch.push(path__namespace.resolve(ctx.config.rootDirectory, watchPath)); - }); - let watcher = chokidar__default["default"].watch(toWatch, { - persistent: true, - ignoreInitial: true, - awaitWriteFinish: { - stabilityThreshold: 100, - pollInterval: 100 - } - }).on("error", error => ctx.logger.error(String(error))).on("change", async file => { - if (shouldIgnore(file)) return; - onFileChanged === null || onFileChanged === void 0 ? void 0 : onFileChanged(file); - await (file === remixConfigPath ? restart : rebuild)(); - }).on("add", async file => { - if (shouldIgnore(file)) return; - onFileCreated === null || onFileCreated === void 0 ? void 0 : onFileCreated(file); - try { - ctx.config = await reloadConfig(ctx.config.rootDirectory); - } catch (thrown) { - log.logThrown(thrown); - return; - } - await (isEntryPoint(ctx.config, file) ? restart : rebuild)(); - }).on("unlink", async file => { - if (shouldIgnore(file)) return; - onFileDeleted === null || onFileDeleted === void 0 ? void 0 : onFileDeleted(file); - await (isEntryPoint(ctx.config, file) ? restart : rebuild)(); - }); - return async () => { - await watcher.close().catch(() => undefined); - void compiler$1.dispose(); - }; -} - -exports.watch = watch; diff --git a/.yalc/@remix-run/dev/dist/config.js b/.yalc/@remix-run/dev/dist/config.js deleted file mode 100644 index be47b04..0000000 --- a/.yalc/@remix-run/dev/dist/config.js +++ /dev/null @@ -1,276 +0,0 @@ -/** - * @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 node_child_process = require('node:child_process'); -var path = require('node:path'); -var node_url = require('node:url'); -var fse = require('fs-extra'); -var PackageJson = require('@npmcli/package-json'); -var routes = require('./config/routes.js'); -var serverModes = require('./config/serverModes.js'); -var virtualModules = require('./compiler/server/virtualModules.js'); -var flatRoutes = require('./config/flat-routes.js'); -var detectPackageManager = require('./cli/detectPackageManager.js'); -var logger = require('./tux/logger.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var PackageJson__default = /*#__PURE__*/_interopDefaultLegacy(PackageJson); - -/** - * The user-provided config in `remix.config.js`. - */ - -/** - * Fully resolved configuration object we use throughout Remix. - */ - -/** - * Returns a fully resolved config object from the remix.config.js in the given - * root directory. - */ -async function readConfig(remixRoot, serverMode) { - if (!remixRoot) { - remixRoot = process.env.REMIX_ROOT || process.cwd(); - } - let rootDirectory = path__default["default"].resolve(remixRoot); - let configFile = findConfig(rootDirectory, "remix.config", configExts); - let appConfig = {}; - if (configFile) { - let appConfigModule; - try { - var _appConfigModule; - // shout out to next - // https://github.com/vercel/next.js/blob/b15a976e11bf1dc867c241a4c1734757427d609c/packages/next/server/config.ts#L748-L765 - if (process.env.JEST_WORKER_ID) { - // dynamic import does not currently work inside vm which - // jest relies on, so we fall back to require for this case - // https://github.com/nodejs/node/issues/35889 - appConfigModule = require(configFile); - } else { - let stat = fse__default["default"].statSync(configFile); - appConfigModule = await import(node_url.pathToFileURL(configFile).href + "?t=" + stat.mtimeMs); - } - appConfig = ((_appConfigModule = appConfigModule) === null || _appConfigModule === void 0 ? void 0 : _appConfigModule.default) || appConfigModule; - } catch (error) { - throw new Error(`Error loading Remix config at ${configFile}\n${String(error)}`); - } - } - return await resolveConfig(appConfig, { - rootDirectory, - serverMode - }); -} -async function resolveConfig(appConfig, { - rootDirectory, - serverMode = serverModes.ServerMode.Production -}) { - var _appConfig$future; - if (!serverModes.isValidServerMode(serverMode)) { - throw new Error(`Invalid server mode "${serverMode}"`); - } - let serverBuildPath = path__default["default"].resolve(rootDirectory, appConfig.serverBuildPath ?? "build/index.js"); - let serverBuildTargetEntryModule = `export * from ${JSON.stringify(virtualModules.serverBuildVirtualModule.id)};`; - let serverConditions = appConfig.serverConditions; - let serverDependenciesToBundle = appConfig.serverDependenciesToBundle || []; - let serverEntryPoint = appConfig.server; - let serverMainFields = appConfig.serverMainFields; - let serverMinify = appConfig.serverMinify; - let serverModuleFormat = appConfig.serverModuleFormat || "esm"; - let serverPlatform = appConfig.serverPlatform || "node"; - serverMainFields ??= serverModuleFormat === "esm" ? ["module", "main"] : ["main", "module"]; - serverMinify ??= false; - let serverNodeBuiltinsPolyfill = appConfig.serverNodeBuiltinsPolyfill; - let browserNodeBuiltinsPolyfill = appConfig.browserNodeBuiltinsPolyfill; - let mdx = appConfig.mdx; - let postcss = appConfig.postcss ?? true; - let tailwind = appConfig.tailwind ?? true; - let appDirectory = path__default["default"].resolve(rootDirectory, appConfig.appDirectory || "app"); - let cacheDirectory = path__default["default"].resolve(rootDirectory, appConfig.cacheDirectory || ".cache"); - let defaultsDirectory = path__default["default"].resolve(__dirname, "config", "defaults"); - let userEntryClientFile = findEntry(appDirectory, "entry.client"); - let userEntryServerFile = findEntry(appDirectory, "entry.server"); - let entryServerFile; - let entryClientFile = userEntryClientFile || "entry.client.tsx"; - let pkgJson = await PackageJson__default["default"].load(rootDirectory); - let deps = pkgJson.content.dependencies ?? {}; - if (userEntryServerFile) { - entryServerFile = userEntryServerFile; - } else { - 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); - throw new Error(`Could not determine server runtime. Please install one of the following: ${formattedList}`); - } - if (!deps["isbot"]) { - console.log("adding `isbot` to your package.json, you should commit this change"); - pkgJson.update({ - dependencies: { - ...pkgJson.content.dependencies, - isbot: "latest" - } - }); - await pkgJson.save(); - let packageManager = detectPackageManager.detectPackageManager() ?? "npm"; - node_child_process.execSync(`${packageManager} install`, { - cwd: rootDirectory, - stdio: "inherit" - }); - } - entryServerFile = `entry.server.${serverRuntime}.tsx`; - } - let entryClientFilePath = userEntryClientFile ? path__default["default"].resolve(appDirectory, userEntryClientFile) : path__default["default"].resolve(defaultsDirectory, entryClientFile); - let entryServerFilePath = userEntryServerFile ? path__default["default"].resolve(appDirectory, userEntryServerFile) : path__default["default"].resolve(defaultsDirectory, entryServerFile); - let assetsBuildDirectory = appConfig.assetsBuildDirectory || path__default["default"].join("public", "build"); - let absoluteAssetsBuildDirectory = path__default["default"].resolve(rootDirectory, assetsBuildDirectory); - let publicPath = addTrailingSlash(appConfig.publicPath || "/build/"); - let rootRouteFile = findEntry(appDirectory, "root"); - if (!rootRouteFile) { - throw new Error(`Missing "root" route file in ${appDirectory}`); - } - let routes$1 = { - root: { - path: "", - id: "root", - file: rootRouteFile - } - }; - if (fse__default["default"].existsSync(path__default["default"].resolve(appDirectory, "routes"))) { - let fileRoutes = flatRoutes.flatRoutes(appDirectory, appConfig.ignoredRouteFiles); - for (let route of Object.values(fileRoutes)) { - routes$1[route.id] = { - ...route, - parentId: route.parentId || "root" - }; - } - } - if (appConfig.routes) { - let manualRoutes = await appConfig.routes(routes.defineRoutes); - for (let route of Object.values(manualRoutes)) { - routes$1[route.id] = { - ...route, - parentId: route.parentId || "root" - }; - } - } - let watchPaths = []; - if (typeof appConfig.watchPaths === "function") { - let directories = await appConfig.watchPaths(); - watchPaths = watchPaths.concat(Array.isArray(directories) ? directories : [directories]); - } else if (appConfig.watchPaths) { - watchPaths = watchPaths.concat(Array.isArray(appConfig.watchPaths) ? appConfig.watchPaths : [appConfig.watchPaths]); - } - - // When tsconfigPath is undefined, the default "tsconfig.json" is not - // found in the root directory. - let tsconfigPath; - let rootTsconfig = path__default["default"].resolve(rootDirectory, "tsconfig.json"); - let rootJsConfig = path__default["default"].resolve(rootDirectory, "jsconfig.json"); - if (fse__default["default"].existsSync(rootTsconfig)) { - tsconfigPath = rootTsconfig; - } else if (fse__default["default"].existsSync(rootJsConfig)) { - tsconfigPath = rootJsConfig; - } - - // Note: When a future flag is removed from here, it should be added to the - // list below, so we can let folks know if they have obsolete flags in their - // config. If we ever convert remix.config.js to a TS file, so we get proper - // typings this won't be necessary anymore. - let future = { - v3_fetcherPersist: ((_appConfig$future = appConfig.future) === null || _appConfig$future === void 0 ? void 0 : _appConfig$future.v3_fetcherPersist) === true - }; - if (appConfig.future) { - let userFlags = appConfig.future; - let deprecatedFlags = ["unstable_cssModules", "unstable_cssSideEffectImports", "unstable_dev", "unstable_postcss", "unstable_tailwind", "unstable_vanillaExtract", "v2_errorBoundary", "v2_headers", "v2_meta", "v2_normalizeFormMethod", "v2_routeConvention"]; - if ("v2_dev" in userFlags) { - if (userFlags.v2_dev === true) { - deprecatedFlags.push("v2_dev"); - } else { - logger.logger.warn("The `v2_dev` future flag is obsolete.", { - details: ["Move your dev options from `future.v2_dev` to `dev` within your `remix.config.js` file"] - }); - } - } - let obsoleteFlags = deprecatedFlags.filter(f => f in userFlags); - if (obsoleteFlags.length > 0) { - logger.logger.warn(`The following Remix future flags are now obsolete ` + `and can be removed from your remix.config.js file:\n` + obsoleteFlags.map(f => `- ${f}\n`).join("")); - } - } - return { - appDirectory, - cacheDirectory, - entryClientFile, - entryClientFilePath, - entryServerFile, - entryServerFilePath, - dev: appConfig.dev ?? {}, - assetsBuildDirectory: absoluteAssetsBuildDirectory, - relativeAssetsBuildDirectory: assetsBuildDirectory, - publicPath, - rootDirectory, - routes: routes$1, - serverBuildPath, - serverBuildTargetEntryModule, - serverConditions, - serverDependenciesToBundle, - serverEntryPoint, - serverMainFields, - serverMinify, - serverMode, - serverModuleFormat, - serverNodeBuiltinsPolyfill, - browserNodeBuiltinsPolyfill, - serverPlatform, - mdx, - postcss, - tailwind, - watchPaths, - tsconfigPath, - future - }; -} -function addTrailingSlash(path) { - return path.endsWith("/") ? path : path + "/"; -} -const entryExts = [".js", ".jsx", ".ts", ".tsx"]; -function findEntry(dir, basename) { - for (let ext of entryExts) { - let file = path__default["default"].resolve(dir, basename + ext); - if (fse__default["default"].existsSync(file)) return path__default["default"].relative(dir, file); - } - return undefined; -} -const configExts = [".js", ".cjs", ".mjs"]; -function findConfig(dir, basename, extensions) { - for (let ext of extensions) { - let name = basename + ext; - let file = path__default["default"].join(dir, name); - if (fse__default["default"].existsSync(file)) return file; - } - return undefined; -} - -// adds types for `Intl.ListFormat` to the global namespace -// we could also update our `tsconfig.json` to include `lib: ["es2021"]` -let disjunctionListFormat = new Intl.ListFormat("en", { - style: "long", - type: "disjunction" -}); - -exports.findConfig = findConfig; -exports.readConfig = readConfig; -exports.resolveConfig = resolveConfig; diff --git a/.yalc/@remix-run/dev/dist/config/defaults/entry.client.tsx b/.yalc/@remix-run/dev/dist/config/defaults/entry.client.tsx deleted file mode 100644 index 999c0a1..0000000 --- a/.yalc/@remix-run/dev/dist/config/defaults/entry.client.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { RemixBrowser } from "@remix-run/react"; -import { startTransition, StrictMode } from "react"; -import { hydrateRoot } from "react-dom/client"; - -startTransition(() => { - hydrateRoot( - document, - - - - ); -}); diff --git a/.yalc/@remix-run/dev/dist/config/defaults/entry.dev.ts b/.yalc/@remix-run/dev/dist/config/defaults/entry.dev.ts deleted file mode 100644 index 036c6c0..0000000 --- a/.yalc/@remix-run/dev/dist/config/defaults/entry.dev.ts +++ /dev/null @@ -1,13 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ - -export default () => { - import("react"); - import("react/jsx-dev-runtime"); - import("react/jsx-runtime"); - import("react-dom"); - import("react-dom/client"); - import("react-refresh/runtime"); - import("@remix-run/react"); - import("remix:hmr"); -}; diff --git a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.cloudflare.tsx b/.yalc/@remix-run/dev/dist/config/defaults/entry.server.cloudflare.tsx deleted file mode 100644 index 327c51f..0000000 --- a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.cloudflare.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import type { AppLoadContext, EntryContext } from "@remix-run/cloudflare"; -import { RemixServer } from "@remix-run/react"; -import isbot from "isbot"; -import { renderToReadableStream } from "react-dom/server"; - -export default async function handleRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext, - loadContext: AppLoadContext -) { - const body = await renderToReadableStream( - , - { - signal: request.signal, - onError(error: unknown) { - // Log streaming rendering errors from inside the shell - console.error(error); - responseStatusCode = 500; - }, - } - ); - - if (isbot(request.headers.get("user-agent"))) { - await body.allReady; - } - - responseHeaders.set("Content-Type", "text/html"); - return new Response(body, { - headers: responseHeaders, - status: responseStatusCode, - }); -} diff --git a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.deno.tsx b/.yalc/@remix-run/dev/dist/config/defaults/entry.server.deno.tsx deleted file mode 100644 index b6f81d4..0000000 --- a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.deno.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import type { AppLoadContext, EntryContext } from "@remix-run/deno"; -import { RemixServer } from "@remix-run/react"; -import isbot from "isbot"; -import { renderToReadableStream } from "react-dom/server"; - -export default async function handleRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext, - loadContext: AppLoadContext -) { - const body = await renderToReadableStream( - , - { - signal: request.signal, - onError(error: unknown) { - // Log streaming rendering errors from inside the shell - console.error(error); - responseStatusCode = 500; - }, - } - ); - - if (isbot(request.headers.get("user-agent"))) { - await body.allReady; - } - - responseHeaders.set("Content-Type", "text/html"); - return new Response(body, { - headers: responseHeaders, - status: responseStatusCode, - }); -} diff --git a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.node.tsx b/.yalc/@remix-run/dev/dist/config/defaults/entry.server.node.tsx deleted file mode 100644 index d41e6da..0000000 --- a/.yalc/@remix-run/dev/dist/config/defaults/entry.server.node.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import { PassThrough } from "node:stream"; - -import type { AppLoadContext, EntryContext } from "@remix-run/node"; -import { createReadableStreamFromReadable } from "@remix-run/node"; -import { RemixServer } from "@remix-run/react"; -import isbot from "isbot"; -import { renderToPipeableStream } from "react-dom/server"; - -const ABORT_DELAY = 5_000; - -export default function handleRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext, - loadContext: AppLoadContext -) { - return isbot(request.headers.get("user-agent")) - ? handleBotRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ) - : handleBrowserRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ); -} - -function handleBotRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext -) { - return new Promise((resolve, reject) => { - let shellRendered = false; - const { pipe, abort } = renderToPipeableStream( - , - { - onAllReady() { - shellRendered = true; - const body = new PassThrough(); - const stream = createReadableStreamFromReadable(body); - - responseHeaders.set("Content-Type", "text/html"); - - resolve( - new Response(stream, { - headers: responseHeaders, - status: responseStatusCode, - }) - ); - - pipe(body); - }, - onShellError(error: unknown) { - reject(error); - }, - onError(error: unknown) { - responseStatusCode = 500; - // Log streaming rendering errors from inside the shell. Don't log - // errors encountered during initial shell rendering since they'll - // reject and get logged in handleDocumentRequest. - if (shellRendered) { - console.error(error); - } - }, - } - ); - - setTimeout(abort, ABORT_DELAY); - }); -} - -function handleBrowserRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext -) { - return new Promise((resolve, reject) => { - let shellRendered = false; - const { pipe, abort } = renderToPipeableStream( - , - { - onShellReady() { - shellRendered = true; - const body = new PassThrough(); - const stream = createReadableStreamFromReadable(body); - - responseHeaders.set("Content-Type", "text/html"); - - resolve( - new Response(stream, { - headers: responseHeaders, - status: responseStatusCode, - }) - ); - - pipe(body); - }, - onShellError(error: unknown) { - reject(error); - }, - onError(error: unknown) { - responseStatusCode = 500; - // Log streaming rendering errors from inside the shell. Don't log - // errors encountered during initial shell rendering since they'll - // reject and get logged in handleDocumentRequest. - if (shellRendered) { - console.error(error); - } - }, - } - ); - - setTimeout(abort, ABORT_DELAY); - }); -} diff --git a/.yalc/@remix-run/dev/dist/config/flat-routes.js b/.yalc/@remix-run/dev/dist/config/flat-routes.js deleted file mode 100644 index 6baed5f..0000000 --- a/.yalc/@remix-run/dev/dist/config/flat-routes.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var path = require('node:path'); -var minimatch = require('minimatch'); -var routes = require('./routes.js'); -var config = require('../config.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -const routeModuleExts = [".js", ".jsx", ".ts", ".tsx", ".md", ".mdx"]; -let paramPrefixChar = "$"; -let escapeStart = "["; -let escapeEnd = "]"; -let optionalStart = "("; -let optionalEnd = ")"; -const PrefixLookupTrieEndSymbol = Symbol("PrefixLookupTrieEndSymbol"); -class PrefixLookupTrie { - root = { - [PrefixLookupTrieEndSymbol]: false - }; - add(value) { - if (!value) throw new Error("Cannot add empty string to PrefixLookupTrie"); - let node = this.root; - for (let char of value) { - if (!node[char]) { - node[char] = { - [PrefixLookupTrieEndSymbol]: false - }; - } - node = node[char]; - } - node[PrefixLookupTrieEndSymbol] = true; - } - findAndRemove(prefix, filter) { - let node = this.root; - for (let char of prefix) { - if (!node[char]) return []; - node = node[char]; - } - return this.#findAndRemoveRecursive([], node, prefix, filter); - } - #findAndRemoveRecursive(values, node, prefix, filter) { - for (let char of Object.keys(node)) { - this.#findAndRemoveRecursive(values, node[char], prefix + char, filter); - } - if (node[PrefixLookupTrieEndSymbol] && filter(prefix)) { - node[PrefixLookupTrieEndSymbol] = false; - values.push(prefix); - } - return values; - } -} -function flatRoutes(appDirectory, ignoredFilePatterns = [], prefix = "routes") { - let ignoredFileRegex = ignoredFilePatterns.map(re => minimatch.makeRe(re)).filter(re => !!re); - let routesDir = path__default["default"].join(appDirectory, prefix); - let rootRoute = config.findConfig(appDirectory, "root", routeModuleExts); - if (!rootRoute) { - throw new Error(`Could not find a root route module in the app directory: ${appDirectory}`); - } - if (!fs__default["default"].existsSync(rootRoute)) { - throw new Error(`Could not find the routes directory: ${routesDir}. Did you forget to create it?`); - } - - // Only read the routes directory - let entries = fs__default["default"].readdirSync(routesDir, { - withFileTypes: true, - encoding: "utf-8" - }); - let routes = []; - for (let entry of entries) { - let filepath = path__default["default"].join(routesDir, entry.name); - let route = null; - // If it's a directory, don't recurse into it, instead just look for a route module - if (entry.isDirectory()) { - route = findRouteModuleForFolder(appDirectory, filepath, ignoredFileRegex); - } else if (entry.isFile()) { - route = findRouteModuleForFile(appDirectory, filepath, ignoredFileRegex); - } - if (route) routes.push(route); - } - let routeManifest = flatRoutesUniversal(appDirectory, routes, prefix); - return routeManifest; -} -function flatRoutesUniversal(appDirectory, routes$1, prefix = "routes") { - let urlConflicts = new Map(); - let routeManifest = {}; - let prefixLookup = new PrefixLookupTrie(); - let uniqueRoutes = new Map(); - let routeIdConflicts = new Map(); - - // id -> file - let routeIds = new Map(); - for (let file of routes$1) { - let normalizedFile = routes.normalizeSlashes(file); - let routeExt = path__default["default"].extname(normalizedFile); - let routeDir = path__default["default"].dirname(normalizedFile); - let normalizedApp = routes.normalizeSlashes(appDirectory); - let routeId = routeDir === path__default["default"].posix.join(normalizedApp, prefix) ? path__default["default"].posix.relative(normalizedApp, normalizedFile).slice(0, -routeExt.length) : path__default["default"].posix.relative(normalizedApp, routeDir); - let conflict = routeIds.get(routeId); - if (conflict) { - let currentConflicts = routeIdConflicts.get(routeId); - if (!currentConflicts) { - currentConflicts = [path__default["default"].posix.relative(normalizedApp, conflict)]; - } - currentConflicts.push(path__default["default"].posix.relative(normalizedApp, normalizedFile)); - routeIdConflicts.set(routeId, currentConflicts); - continue; - } - routeIds.set(routeId, normalizedFile); - } - let sortedRouteIds = Array.from(routeIds).sort(([a], [b]) => b.length - a.length); - for (let [routeId, file] of sortedRouteIds) { - let index = routeId.endsWith("_index"); - let [segments, raw] = getRouteSegments(routeId.slice(prefix.length + 1)); - let pathname = createRoutePath(segments, raw, index); - routeManifest[routeId] = { - file: file.slice(appDirectory.length + 1), - id: routeId, - path: pathname - }; - if (index) routeManifest[routeId].index = true; - let childRouteIds = prefixLookup.findAndRemove(routeId, value => { - return [".", "/"].includes(value.slice(routeId.length).charAt(0)); - }); - prefixLookup.add(routeId); - if (childRouteIds.length > 0) { - for (let childRouteId of childRouteIds) { - routeManifest[childRouteId].parentId = routeId; - } - } - } - - // path creation - let parentChildrenMap = new Map(); - for (let [routeId] of sortedRouteIds) { - let config = routeManifest[routeId]; - if (!config.parentId) continue; - let existingChildren = parentChildrenMap.get(config.parentId) || []; - existingChildren.push(config); - parentChildrenMap.set(config.parentId, existingChildren); - } - for (let [routeId] of sortedRouteIds) { - let config = routeManifest[routeId]; - let originalPathname = config.path || ""; - let pathname = config.path; - let parentConfig = config.parentId ? routeManifest[config.parentId] : null; - if (parentConfig !== null && parentConfig !== void 0 && parentConfig.path && pathname) { - pathname = pathname.slice(parentConfig.path.length).replace(/^\//, "").replace(/\/$/, ""); - } - if (!config.parentId) config.parentId = "root"; - config.path = pathname || undefined; - - /** - * We do not try to detect path collisions for pathless layout route - * files because, by definition, they create the potential for route - * collisions _at that level in the tree_. - * - * Consider example where a user may want multiple pathless layout routes - * for different subfolders - * - * routes/ - * account.tsx - * account._private.tsx - * account._private.orders.tsx - * account._private.profile.tsx - * account._public.tsx - * account._public.login.tsx - * account._public.perks.tsx - * - * In order to support both a public and private layout for `/account/*` - * URLs, we are creating a mutually exclusive set of URLs beneath 2 - * separate pathless layout routes. In this case, the route paths for - * both account._public.tsx and account._private.tsx is the same - * (/account), but we're again not expecting to match at that level. - * - * By only ignoring this check when the final portion of the filename is - * pathless, we will still detect path collisions such as: - * - * routes/parent._pathless.foo.tsx - * routes/parent._pathless2.foo.tsx - * - * and - * - * routes/parent._pathless/index.tsx - * routes/parent._pathless2/index.tsx - */ - let lastRouteSegment = config.id.replace(new RegExp(`^${prefix}/`), "").split(".").pop(); - let isPathlessLayoutRoute = lastRouteSegment && lastRouteSegment.startsWith("_") && lastRouteSegment !== "_index"; - if (isPathlessLayoutRoute) { - continue; - } - let conflictRouteId = originalPathname + (config.index ? "?index" : ""); - let conflict = uniqueRoutes.get(conflictRouteId); - uniqueRoutes.set(conflictRouteId, config); - if (conflict && (originalPathname || config.index)) { - let currentConflicts = urlConflicts.get(originalPathname); - if (!currentConflicts) currentConflicts = [conflict]; - currentConflicts.push(config); - urlConflicts.set(originalPathname, currentConflicts); - continue; - } - } - if (routeIdConflicts.size > 0) { - for (let [routeId, files] of routeIdConflicts.entries()) { - console.error(getRouteIdConflictErrorMessage(routeId, files)); - } - } - - // report conflicts - if (urlConflicts.size > 0) { - for (let [path, routes] of urlConflicts.entries()) { - // delete all but the first route from the manifest - for (let i = 1; i < routes.length; i++) { - delete routeManifest[routes[i].id]; - } - let files = routes.map(r => r.file); - console.error(getRoutePathConflictErrorMessage(path, files)); - } - } - return routeManifest; -} -function findRouteModuleForFile(appDirectory, filepath, ignoredFileRegex) { - let relativePath = path__default["default"].relative(appDirectory, filepath); - let isIgnored = ignoredFileRegex.some(regex => regex.test(relativePath)); - if (isIgnored) return null; - return filepath; -} -function findRouteModuleForFolder(appDirectory, filepath, ignoredFileRegex) { - let relativePath = path__default["default"].relative(appDirectory, filepath); - let isIgnored = ignoredFileRegex.some(regex => regex.test(relativePath)); - if (isIgnored) return null; - let routeRouteModule = config.findConfig(filepath, "route", routeModuleExts); - let routeIndexModule = config.findConfig(filepath, "index", routeModuleExts); - - // if both a route and index module exist, throw a conflict error - // preferring the route module over the index module - if (routeRouteModule && routeIndexModule) { - let [segments, raw] = getRouteSegments(path__default["default"].relative(appDirectory, filepath)); - let routePath = createRoutePath(segments, raw, false); - console.error(getRoutePathConflictErrorMessage(routePath || "/", [routeRouteModule, routeIndexModule])); - } - return routeRouteModule || routeIndexModule || null; -} -function getRouteSegments(routeId) { - let routeSegments = []; - let rawRouteSegments = []; - let index = 0; - let routeSegment = ""; - let rawRouteSegment = ""; - let state = "NORMAL"; - let pushRouteSegment = (segment, rawSegment) => { - if (!segment) return; - let notSupportedInRR = (segment, char) => { - throw new Error(`Route segment "${segment}" for "${routeId}" cannot contain "${char}".\n` + `If this is something you need, upvote this proposal for React Router https://github.com/remix-run/react-router/discussions/9822.`); - }; - if (rawSegment.includes("*")) { - return notSupportedInRR(rawSegment, "*"); - } - if (rawSegment.includes(":")) { - return notSupportedInRR(rawSegment, ":"); - } - if (rawSegment.includes("/")) { - return notSupportedInRR(segment, "/"); - } - routeSegments.push(segment); - rawRouteSegments.push(rawSegment); - }; - while (index < routeId.length) { - let char = routeId[index]; - index++; //advance to next char - - switch (state) { - case "NORMAL": - { - if (isSegmentSeparator(char)) { - pushRouteSegment(routeSegment, rawRouteSegment); - routeSegment = ""; - rawRouteSegment = ""; - state = "NORMAL"; - break; - } - if (char === escapeStart) { - state = "ESCAPE"; - rawRouteSegment += char; - break; - } - if (char === optionalStart) { - state = "OPTIONAL"; - rawRouteSegment += char; - break; - } - if (!routeSegment && char == paramPrefixChar) { - if (index === routeId.length) { - routeSegment += "*"; - rawRouteSegment += char; - } else { - routeSegment += ":"; - rawRouteSegment += char; - } - break; - } - routeSegment += char; - rawRouteSegment += char; - break; - } - case "ESCAPE": - { - if (char === escapeEnd) { - state = "NORMAL"; - rawRouteSegment += char; - break; - } - routeSegment += char; - rawRouteSegment += char; - break; - } - case "OPTIONAL": - { - if (char === optionalEnd) { - routeSegment += "?"; - rawRouteSegment += char; - state = "NORMAL"; - break; - } - if (char === escapeStart) { - state = "OPTIONAL_ESCAPE"; - rawRouteSegment += char; - break; - } - if (!routeSegment && char === paramPrefixChar) { - if (index === routeId.length) { - routeSegment += "*"; - rawRouteSegment += char; - } else { - routeSegment += ":"; - rawRouteSegment += char; - } - break; - } - routeSegment += char; - rawRouteSegment += char; - break; - } - case "OPTIONAL_ESCAPE": - { - if (char === escapeEnd) { - state = "OPTIONAL"; - rawRouteSegment += char; - break; - } - routeSegment += char; - rawRouteSegment += char; - break; - } - } - } - - // process remaining segment - pushRouteSegment(routeSegment, rawRouteSegment); - return [routeSegments, rawRouteSegments]; -} -function createRoutePath(routeSegments, rawRouteSegments, isIndex) { - let result = []; - if (isIndex) { - routeSegments = routeSegments.slice(0, -1); - } - for (let index = 0; index < routeSegments.length; index++) { - let segment = routeSegments[index]; - let rawSegment = rawRouteSegments[index]; - - // skip pathless layout segments - if (segment.startsWith("_") && rawSegment.startsWith("_")) { - continue; - } - - // remove trailing slash - if (segment.endsWith("_") && rawSegment.endsWith("_")) { - segment = segment.slice(0, -1); - } - result.push(segment); - } - return result.length ? result.join("/") : undefined; -} -function getRoutePathConflictErrorMessage(pathname, routes) { - let [taken, ...others] = routes; - if (!pathname.startsWith("/")) { - pathname = "/" + pathname; - } - return `⚠️ Route Path Collision: "${pathname}"\n\n` + `The following routes all define the same URL, only the first one will be used\n\n` + `🟢 ${taken}\n` + others.map(route => `⭕️️ ${route}`).join("\n") + "\n"; -} -function getRouteIdConflictErrorMessage(routeId, files) { - let [taken, ...others] = files; - return `⚠️ Route ID Collision: "${routeId}"\n\n` + `The following routes all define the same Route ID, only the first one will be used\n\n` + `🟢 ${taken}\n` + others.map(route => `⭕️️ ${route}`).join("\n") + "\n"; -} -function isSegmentSeparator(checkChar) { - if (!checkChar) return false; - return ["/", ".", path__default["default"].win32.sep].includes(checkChar); -} - -exports.createRoutePath = createRoutePath; -exports.escapeEnd = escapeEnd; -exports.escapeStart = escapeStart; -exports.flatRoutes = flatRoutes; -exports.flatRoutesUniversal = flatRoutesUniversal; -exports.getRouteIdConflictErrorMessage = getRouteIdConflictErrorMessage; -exports.getRoutePathConflictErrorMessage = getRoutePathConflictErrorMessage; -exports.getRouteSegments = getRouteSegments; -exports.isSegmentSeparator = isSegmentSeparator; -exports.optionalEnd = optionalEnd; -exports.optionalStart = optionalStart; -exports.paramPrefixChar = paramPrefixChar; -exports.routeModuleExts = routeModuleExts; diff --git a/.yalc/@remix-run/dev/dist/config/format.js b/.yalc/@remix-run/dev/dist/config/format.js deleted file mode 100644 index ba53512..0000000 --- a/.yalc/@remix-run/dev/dist/config/format.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @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 }); - -let RoutesFormat = /*#__PURE__*/function (RoutesFormat) { - RoutesFormat["json"] = "json"; - RoutesFormat["jsx"] = "jsx"; - return RoutesFormat; -}({}); -function isRoutesFormat(format) { - return format === RoutesFormat.json || format === RoutesFormat.jsx; -} -function formatRoutes(routeManifest, format) { - switch (format) { - case RoutesFormat.json: - return formatRoutesAsJson(routeManifest); - case RoutesFormat.jsx: - return formatRoutesAsJsx(routeManifest); - } -} -function formatRoutesAsJson(routeManifest) { - function handleRoutesRecursive(parentId) { - let routes = Object.values(routeManifest).filter(route => route.parentId === parentId); - let children = []; - for (let route of routes) { - children.push({ - id: route.id, - index: route.index, - path: route.path, - caseSensitive: route.caseSensitive, - file: route.file, - children: handleRoutesRecursive(route.id) - }); - } - if (children.length > 0) { - return children; - } - return undefined; - } - return JSON.stringify(handleRoutesRecursive() || null, null, 2); -} -function formatRoutesAsJsx(routeManifest) { - let output = ""; - function handleRoutesRecursive(parentId, level = 1) { - let routes = Object.values(routeManifest).filter(route => route.parentId === parentId); - let indent = Array(level * 2).fill(" ").join(""); - for (let route of routes) { - output += "\n" + indent; - output += ``; - if (handleRoutesRecursive(route.id, level + 1)) { - output += "\n" + indent; - output += ""; - } else { - output = output.slice(0, -1) + " />"; - } - } - return routes.length > 0; - } - handleRoutesRecursive(); - output += "\n"; - return output; -} - -exports.RoutesFormat = RoutesFormat; -exports.formatRoutes = formatRoutes; -exports.formatRoutesAsJson = formatRoutesAsJson; -exports.formatRoutesAsJsx = formatRoutesAsJsx; -exports.isRoutesFormat = isRoutesFormat; diff --git a/.yalc/@remix-run/dev/dist/config/routes.js b/.yalc/@remix-run/dev/dist/config/routes.js deleted file mode 100644 index ec9f659..0000000 --- a/.yalc/@remix-run/dev/dist/config/routes.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @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'); - -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); - -/** - * A route that was created using `defineRoutes` or created conventionally from - * looking at the files on the filesystem. - */ - -/** - * A function for defining a route that is passed as the argument to the - * `defineRoutes` callback. - * - * Calls to this function are designed to be nested, using the `children` - * callback argument. - * - * defineRoutes(route => { - * route('/', 'pages/layout', () => { - * route('react-router', 'pages/react-router'); - * route('reach-ui', 'pages/reach-ui'); - * }); - * }); - */ - -/** - * A function for defining routes programmatically, instead of using the - * filesystem convention. - */ -function defineRoutes(callback) { - let routes = Object.create(null); - let parentRoutes = []; - let alreadyReturned = false; - let defineRoute = (path, file, optionsOrChildren, children) => { - if (alreadyReturned) { - throw new Error("You tried to define routes asynchronously but started defining " + "routes before the async work was done. Please await all async " + "data before calling `defineRoutes()`"); - } - let options; - if (typeof optionsOrChildren === "function") { - // route(path, file, children) - options = {}; - children = optionsOrChildren; - } else { - // route(path, file, options, children) - // route(path, file, options) - options = optionsOrChildren || {}; - } - let route = { - path: path ? path : undefined, - index: options.index ? true : undefined, - caseSensitive: options.caseSensitive ? true : undefined, - id: options.id || createRouteId(file), - parentId: parentRoutes.length > 0 ? parentRoutes[parentRoutes.length - 1].id : "root", - file - }; - if (route.id in routes) { - throw new Error(`Unable to define routes with duplicate route id: "${route.id}"`); - } - routes[route.id] = route; - if (children) { - parentRoutes.push(route); - children(); - parentRoutes.pop(); - } - }; - callback(defineRoute); - alreadyReturned = true; - return routes; -} -function createRouteId(file) { - return normalizeSlashes(stripFileExtension(file)); -} -function normalizeSlashes(file) { - return file.split(path__namespace.win32.sep).join("/"); -} -function stripFileExtension(file) { - return file.replace(/\.[a-z0-9]+$/i, ""); -} - -exports.createRouteId = createRouteId; -exports.defineRoutes = defineRoutes; -exports.normalizeSlashes = normalizeSlashes; diff --git a/.yalc/@remix-run/dev/dist/config/serverModes.js b/.yalc/@remix-run/dev/dist/config/serverModes.js deleted file mode 100644 index dfdfa9f..0000000 --- a/.yalc/@remix-run/dev/dist/config/serverModes.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @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 }); - -/** - * The mode to use when running the server. - */ -let ServerMode = /*#__PURE__*/function (ServerMode) { - ServerMode["Development"] = "development"; - ServerMode["Production"] = "production"; - ServerMode["Test"] = "test"; - return ServerMode; -}({}); -function isValidServerMode(mode) { - return mode === ServerMode.Development || mode === ServerMode.Production || mode === ServerMode.Test; -} - -exports.ServerMode = ServerMode; -exports.isValidServerMode = isValidServerMode; diff --git a/.yalc/@remix-run/dev/dist/dependencies.js b/.yalc/@remix-run/dev/dist/dependencies.js deleted file mode 100644 index 133b7c9..0000000 --- a/.yalc/@remix-run/dev/dist/dependencies.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @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 fs = require('node:fs'); -var path = require('node:path'); - -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 fs__namespace = /*#__PURE__*/_interopNamespace(fs); -var path__namespace = /*#__PURE__*/_interopNamespace(path); - -function getPackageDependencies(packageJsonFile, includeDev) { - let pkg = JSON.parse(fs__namespace.readFileSync(packageJsonFile, "utf8")); - let deps = (pkg === null || pkg === void 0 ? void 0 : pkg.dependencies) || {}; - if (includeDev) { - Object.assign(deps, (pkg === null || pkg === void 0 ? void 0 : pkg.devDependencies) || {}); - } - return deps; -} -function getAppDependencies(config, includeDev) { - return getPackageDependencies(path__namespace.resolve(config.rootDirectory, "package.json"), includeDev); -} -function getDependenciesToBundle(...pkg) { - let aggregatedDeps = new Set(pkg); - let visitedPackages = new Set(); - pkg.forEach(p => { - getPackageDependenciesRecursive(p, aggregatedDeps, visitedPackages); - }); - return Array.from(aggregatedDeps); -} -function isErrorWithCode(error) { - return error instanceof Error && typeof error.code === "string"; -} -function getPackageDependenciesRecursive(pkg, aggregatedDeps, visitedPackages) { - visitedPackages.add(pkg); - let pkgPath; - try { - pkgPath = require.resolve(pkg); - } catch (err) { - if (isErrorWithCode(err) && err.code === "ERR_PACKAGE_PATH_NOT_EXPORTED") { - // Handle packages without main exports. - // They at least need to have package.json exported. - pkgPath = require.resolve(`${pkg}/package.json`); - } else { - throw err; - } - } - let lastIndexOfPackageName = pkgPath.lastIndexOf(pkg); - if (lastIndexOfPackageName !== -1) { - pkgPath = pkgPath.substring(0, lastIndexOfPackageName); - } - let pkgJson = path__namespace.join(pkgPath, "package.json"); - if (!fs__namespace.existsSync(pkgJson)) { - console.log(pkgJson, `does not exist`); - return; - } - let dependencies = getPackageDependencies(pkgJson); - Object.keys(dependencies).forEach(dep => { - aggregatedDeps.add(dep); - if (!visitedPackages.has(dep)) { - getPackageDependenciesRecursive(dep, aggregatedDeps, visitedPackages); - } - }); -} - -exports.getAppDependencies = getAppDependencies; -exports.getDependenciesToBundle = getDependenciesToBundle; diff --git a/.yalc/@remix-run/dev/dist/devServer/liveReload.js b/.yalc/@remix-run/dev/dist/devServer/liveReload.js deleted file mode 100644 index f0888f5..0000000 --- a/.yalc/@remix-run/dev/dist/devServer/liveReload.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @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 exitHook = require('exit-hook'); -var fse = require('fs-extra'); -var path = require('node:path'); -var prettyMs = require('pretty-ms'); -var WebSocket = require('ws'); -require('node:fs'); -require('node:module'); -require('esbuild'); -require('node:url'); -require('postcss-load-config'); -require('postcss'); -require('node:child_process'); -require('@npmcli/package-json'); -require('minimatch'); -var logger = require('../tux/logger.js'); -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 watch = require('../compiler/watch.js'); -var fileWatchCache = require('../compiler/fileWatchCache.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var exitHook__default = /*#__PURE__*/_interopDefaultLegacy(exitHook); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var prettyMs__default = /*#__PURE__*/_interopDefaultLegacy(prettyMs); -var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket); - -const relativePath = file => path__default["default"].relative(process.cwd(), file); -let clean = config => { - try { - fse__default["default"].emptyDirSync(config.assetsBuildDirectory); - } catch { - // ignore failed clean up attempts - } -}; -async function liveReload(config, options) { - clean(config); - let wss = new WebSocket__default["default"].Server({ - port: options.port - }); - function broadcast(event) { - setTimeout(() => { - wss.clients.forEach(client => { - if (client.readyState === WebSocket__default["default"].OPEN) { - client.send(JSON.stringify(event)); - } - }); - }, 500); - } - function log(message) { - let _message = `💿 ${message}`; - console.log(_message); - broadcast({ - type: "LOG", - message: _message - }); - } - let fileWatchCache$1 = fileWatchCache.createFileWatchCache(); - let hasBuilt = false; - let dispose = await watch.watch({ - config, - options: { - mode: options.mode, - sourcemap: true - }, - fileWatchCache: fileWatchCache$1, - logger: logger.logger - }, { - onBuildStart() { - clean(config); - log((hasBuilt ? "Rebuilding" : "Building") + "..."); - }, - onBuildFinish(_, durationMs, manifest) { - if (manifest === undefined) return; - hasBuilt = true; - log((hasBuilt ? "Rebuilt" : "Built") + ` in ${prettyMs__default["default"](durationMs)}`); - broadcast({ - type: "RELOAD" - }); - }, - onFileCreated(file) { - log(`File created: ${relativePath(file)}`); - }, - onFileChanged(file) { - log(`File changed: ${relativePath(file)}`); - fileWatchCache$1.invalidateFile(file); - }, - onFileDeleted(file) { - log(`File deleted: ${relativePath(file)}`); - fileWatchCache$1.invalidateFile(file); - } - }); - let heartbeat = setInterval(broadcast, 60000, { - type: "PING" - }); - exitHook__default["default"](() => clean(config)); - return async () => { - wss.close(); - clearInterval(heartbeat); - await dispose(); - }; -} - -exports.liveReload = liveReload; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/env.js b/.yalc/@remix-run/dev/dist/devServer_unstable/env.js deleted file mode 100644 index 71fec96..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/env.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @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 fse = require('fs-extra'); -var path = require('node:path'); - -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 fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var path__namespace = /*#__PURE__*/_interopNamespace(path); - -// Import environment variables from: .env, failing gracefully if it doesn't exist -async function loadEnv(rootDirectory) { - let envPath = path__namespace.join(rootDirectory, ".env"); - if (!fse__default["default"].existsSync(envPath)) return; - let result = require("dotenv").config({ - path: envPath - }); - if (result.error) throw result.error; -} - -exports.loadEnv = loadEnv; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/hdr.js b/.yalc/@remix-run/dev/dist/devServer_unstable/hdr.js deleted file mode 100644 index 86f824a..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/hdr.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @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 esbuild = require('esbuild'); -var emptyModules = require('../compiler/plugins/emptyModules.js'); -var external = require('../compiler/plugins/external.js'); -var routeExports = require('../compiler/utils/routeExports.js'); -var tsconfig = require('../compiler/utils/tsconfig.js'); -var invariant = require('../invariant.js'); -var mdx = require('../compiler/plugins/mdx.js'); -var loaders = require('../compiler/utils/loaders.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 esbuild__default = /*#__PURE__*/_interopDefaultLegacy(esbuild); - -function isBareModuleId(id) { - return !id.startsWith("node:") && !id.startsWith(".") && !path__namespace.isAbsolute(id); -} -let detectLoaderChanges = async ctx => { - let entryPoints = {}; - for (let id of Object.keys(ctx.config.routes)) { - entryPoints[id] = ctx.config.routes[id].file + "?loader"; - } - let options = { - bundle: true, - entryPoints: entryPoints, - treeShaking: true, - metafile: true, - outdir: ".", - write: false, - entryNames: "[hash]", - loader: loaders.loaders, - logLevel: "silent", - plugins: [{ - name: "hmr-loader", - setup(build) { - let routesByFile = Object.keys(ctx.config.routes).reduce((map, key) => { - let route = ctx.config.routes[key]; - map.set(route.file, route); - return map; - }, new Map()); - let filter = /\?loader$/; - build.onResolve({ - filter - }, args => { - return { - path: args.path, - namespace: "hmr-loader" - }; - }); - build.onLoad({ - filter, - namespace: "hmr-loader" - }, async args => { - let file = args.path.replace(filter, ""); - let route = routesByFile.get(file); - invariant["default"](route, `Cannot get route by path: ${args.path}`); - let cacheKey = `module-exports:${route.id}`; - let { - cacheValue: theExports - } = await ctx.fileWatchCache.getOrSet(cacheKey, async () => { - let file = path__namespace.resolve(ctx.config.appDirectory, ctx.config.routes[route.id].file); - return { - cacheValue: await routeExports.getRouteModuleExports(ctx.config, route.id), - fileDependencies: new Set([file]) - }; - }); - let contents = "module.exports = {};"; - if (theExports.includes("loader")) { - contents = `export { loader } from ${JSON.stringify(`./${file}`)};`; - } - return { - contents, - resolveDir: ctx.config.appDirectory, - loader: "js" - }; - }); - } - }, external.externalPlugin(/^node:.*/, { - sideEffects: false - }), external.externalPlugin(/\.css$/, { - sideEffects: false - }), external.externalPlugin(/^https?:\/\//, { - sideEffects: false - }), mdx.mdxPlugin(ctx), emptyModules.emptyModulesPlugin(ctx, /\.client(\.[jt]sx?)?$/), { - name: "hmr-bare-modules", - setup(build) { - let matchPath = ctx.config.tsconfigPath ? tsconfig.createMatchPath(ctx.config.tsconfigPath) : undefined; - function resolvePath(id) { - if (!matchPath) return id; - return matchPath(id, undefined, undefined, [".ts", ".tsx", ".js", ".jsx"]) || id; - } - build.onResolve({ - filter: /.*/ - }, args => { - if (!isBareModuleId(resolvePath(args.path))) { - return undefined; - } - return { - path: args.path, - external: true - }; - }); - } - }] - }; - let { - metafile - } = await esbuild__default["default"].build(options); - let entries = {}; - for (let [hashjs, { - entryPoint - }] of Object.entries(metafile.outputs)) { - if (entryPoint === undefined) continue; - let file = entryPoint.replace(/^hmr-loader:/, "").replace(/\?loader$/, ""); - entries[file] = hashjs.replace(/\.js$/, ""); - } - return entries; -}; - -exports.detectLoaderChanges = detectLoaderChanges; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/hmr.js b/.yalc/@remix-run/dev/dist/devServer_unstable/hmr.js deleted file mode 100644 index 81ef7b0..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/hmr.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @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'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); - -// route id: filepaths relative to app/ dir without extension -// filename: absolute or relative to root for things we don't handle -// for things we handle: relative to app dir -let updates = (config, manifest, prevManifest, hdr, prevHdr) => { - let updates = []; - for (let [routeId, route] of Object.entries(manifest.routes)) { - var _prevRoute$imports; - let prevRoute = prevManifest.routes[routeId]; - let file = config.routes[routeId].file; - let moduleId = path__default["default"].relative(config.rootDirectory, path__default["default"].join(config.appDirectory, file)); - - // new route - if (!prevRoute) { - updates.push({ - id: moduleId, - routeId: route.id, - url: route.module, - revalidate: true, - reason: "Route added" - }); - continue; - } - - // when loaders are diff - let loaderHash = hdr[file]; - let prevLoaderHash = prevHdr === null || prevHdr === void 0 ? void 0 : prevHdr[file]; - if (loaderHash !== prevLoaderHash) { - updates.push({ - id: moduleId, - routeId: route.id, - url: route.module, - revalidate: true, - reason: "Loader changed" - }); - continue; - } - - // when fingerprinted assets are diff (self or imports) - let diffModule = route.module !== prevRoute.module; - let xorImports = new Set(route.imports ?? []); - (_prevRoute$imports = prevRoute.imports) === null || _prevRoute$imports === void 0 ? void 0 : _prevRoute$imports.forEach(xorImports.delete.bind(xorImports)); - if (diffModule || xorImports.size > 0) { - updates.push({ - id: moduleId, - routeId: route.id, - url: route.module, - revalidate: false, - reason: "Component changed" - }); - continue; - } - } - return updates; -}; - -exports.updates = updates; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/index.js b/.yalc/@remix-run/dev/dist/devServer_unstable/index.js deleted file mode 100644 index 39e5111..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/index.js +++ /dev/null @@ -1,300 +0,0 @@ -/** - * @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 stream = require('node:stream'); -var http = require('node:http'); -var https = require('node:https'); -var fse = require('fs-extra'); -var prettyMs = require('pretty-ms'); -var execa = require('execa'); -var express = require('express'); -var pc = require('picocolors'); -var exitHook = require('exit-hook'); -var channel = require('../channel.js'); -require('node:fs'); -require('node:module'); -require('esbuild'); -var invariant = require('../invariant.js'); -require('node:url'); -require('postcss-load-config'); -require('postcss'); -require('node:child_process'); -require('@npmcli/package-json'); -require('minimatch'); -var detectPackageManager = require('../cli/detectPackageManager.js'); -var logger = require('../tux/logger.js'); -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 result = require('../result.js'); -var watch = require('../compiler/watch.js'); -var fileWatchCache = require('../compiler/fileWatchCache.js'); -var env = require('./env.js'); -var socket = require('./socket.js'); -var hmr = require('./hmr.js'); -var hdr = require('./hdr.js'); -var proc = require('./proc.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 stream__namespace = /*#__PURE__*/_interopNamespace(stream); -var http__namespace = /*#__PURE__*/_interopNamespace(http); -var https__namespace = /*#__PURE__*/_interopNamespace(https); -var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse); -var prettyMs__default = /*#__PURE__*/_interopDefaultLegacy(prettyMs); -var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa); -var express__default = /*#__PURE__*/_interopDefaultLegacy(express); -var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc); -var exitHook__default = /*#__PURE__*/_interopDefaultLegacy(exitHook); - -let detectBin = async () => { - let pkgManager = detectPackageManager.detectPackageManager() ?? "npm"; - if (pkgManager === "npm") { - // npm v9 removed the `bin` command, so have to use `prefix` - let { - stdout - } = await execa__default["default"](pkgManager, ["prefix"]); - return path__namespace.join(stdout.trim(), "node_modules", ".bin"); - } - if (pkgManager === "bun") { - let { - stdout - } = await execa__default["default"](pkgManager, ["pm", "bin"]); - return stdout.trim(); - } - let { - stdout - } = await execa__default["default"](pkgManager, ["bin"]); - return stdout.trim(); -}; -let serve = async (initialConfig, options) => { - await env.loadEnv(initialConfig.rootDirectory); - let state = {}; - let app = express__default["default"]() - // handle `broadcastDevReady` messages - .use(express__default["default"].json()).post("/ping", (req, res) => { - var _state$manifest; - let { - buildHash - } = req.body; - if (typeof buildHash !== "string") { - logger.logger.warn(`unrecognized payload: ${req.body}`); - res.sendStatus(400); - } - if (buildHash === ((_state$manifest = state.manifest) === null || _state$manifest === void 0 ? void 0 : _state$manifest.version)) { - var _state$appReady; - (_state$appReady = state.appReady) === null || _state$appReady === void 0 ? void 0 : _state$appReady.ok(); - } - res.sendStatus(200); - }); - let server = options.tlsKey && options.tlsCert ? https__namespace.createServer({ - key: fse__default["default"].readFileSync(options.tlsKey), - cert: fse__default["default"].readFileSync(options.tlsCert) - }, app) : http__namespace.createServer(app); - let websocket = socket.serve(server); - let bin = await detectBin(); - let startAppServer = command => { - let cmd = command ?? `remix-serve ${path__namespace.relative(process.cwd(), initialConfig.serverBuildPath)}`; - let newAppServer = execa__default["default"].command(cmd, { - stdio: "pipe", - env: { - NODE_ENV: "development", - PATH: bin + (process.platform === "win32" ? ";" : ":") + process.env.PATH, - REMIX_DEV_ORIGIN: options.REMIX_DEV_ORIGIN.href, - FORCE_COLOR: process.env.NO_COLOR === undefined ? "1" : "0" - }, - // https://github.com/sindresorhus/execa/issues/433 - windowsHide: false - }).on("error", e => { - // patch execa error types - invariant["default"]("errno" in e && typeof e.errno === "number", "errno missing"); - invariant["default"]("code" in e && typeof e.code === "string", "code missing"); - invariant["default"]("path" in e && typeof e.path === "string", "path missing"); - if (command === undefined) { - logger.logger.error(`command not found: ${e.path}`, { - details: [`\`remix dev\` did not receive \`--command\` nor \`-c\`, defaulting to \`${cmd}\`.`, "You probably meant to use `-c` for your app server command.", "For example: `remix dev -c 'node ./server.js'`"] - }); - process.exit(1); - } - logger.logger.error("app failed to start" + pc__default["default"].gray(` (${command})`)); - throw e; - }); - if (newAppServer.stdin) process.stdin.pipe(newAppServer.stdin, { - end: true - }); - if (newAppServer.stderr) newAppServer.stderr.pipe(process.stderr, { - end: false - }); - if (newAppServer.stdout) { - newAppServer.stdout.pipe(new stream__namespace.PassThrough({ - transform(chunk, _, callback) { - let str = chunk.toString(); - let matches = str && str.matchAll(/\[REMIX DEV\] ([A-Fa-f0-9]+) ready/g); - if (matches) { - for (let match of matches) { - var _state$manifest2; - let buildHash = match[1]; - if (buildHash === ((_state$manifest2 = state.manifest) === null || _state$manifest2 === void 0 ? void 0 : _state$manifest2.version)) { - var _state$appReady2; - (_state$appReady2 = state.appReady) === null || _state$appReady2 === void 0 ? void 0 : _state$appReady2.ok(); - } - } - } - callback(null, chunk); - } - })).pipe(process.stdout, { - end: false - }); - } - return newAppServer; - }; - let fileWatchCache$1 = fileWatchCache.createFileWatchCache(); - let dispose = await watch.watch({ - config: initialConfig, - options: { - mode: "development", - sourcemap: true, - REMIX_DEV_ORIGIN: options.REMIX_DEV_ORIGIN - }, - fileWatchCache: fileWatchCache$1, - logger: logger.logger - }, { - onBuildStart: async ctx => { - var _state$appReady3; - // stop listening for previous manifest - (_state$appReady3 = state.appReady) === null || _state$appReady3 === void 0 ? void 0 : _state$appReady3.err(); - clean(ctx.config); - if (!state.prevManifest) { - let msg = "building..."; - websocket.log(msg); - logger.logger.info(msg); - } - state.loaderChanges = hdr.detectLoaderChanges(ctx).then(result.ok, result.err); - }, - onBuildManifest: manifest => { - state.manifest = manifest; - state.appReady = channel.create(); - }, - onBuildFinish: async (ctx, durationMs, succeeded) => { - if (!succeeded) return; - let msg = (state.prevManifest ? "rebuilt" : "built") + pc__default["default"].gray(` (${prettyMs__default["default"](durationMs)})`); - websocket.log(msg); - logger.logger.info(msg); - - // accumulate new state, but only update state after updates are processed - let newState = { - prevManifest: state.manifest - }; - try { - let start = Date.now(); - if (state.appServer === undefined || !options.manual) { - var _state$appServer; - if ((_state$appServer = state.appServer) !== null && _state$appServer !== void 0 && _state$appServer.pid) { - await proc.killtree(state.appServer.pid); - } - state.appServer = startAppServer(options.command); - } - let appReady = await state.appReady.result; - if (!appReady.ok) return; - if (state.prevManifest) { - logger.logger.info(`app server ready` + pc__default["default"].gray(` (${prettyMs__default["default"](Date.now() - start)})`)); - } - - // HMR + HDR - let loaderChanges = await state.loaderChanges; - if (loaderChanges.ok) { - newState.prevLoaderHashes = loaderChanges.value; - } - if (loaderChanges !== null && loaderChanges !== void 0 && loaderChanges.ok && state.manifest && state.prevManifest) { - let updates = hmr.updates(ctx.config, state.manifest, state.prevManifest, loaderChanges.value, state.prevLoaderHashes); - websocket.hmr(state.manifest, updates); - let hdr = updates.some(u => u.revalidate); - logger.logger.info("hmr" + (hdr ? " + hdr" : "")); - return; - } - - // Live Reload - if (state.prevManifest !== undefined) { - websocket.reload(); - logger.logger.info("live reload"); - } - } finally { - // commit accumulated state - Object.assign(state, newState); - process.stdout.write("\n"); - } - }, - onFileCreated: file => { - logger.logger.info(`rebuilding...` + pc__default["default"].gray(` (+ ${relativePath(file)})`)); - websocket.log(`file created: ${relativePath(file)}`); - }, - onFileChanged: file => { - logger.logger.info(`rebuilding...` + pc__default["default"].gray(` (~ ${relativePath(file)})`)); - websocket.log(`file changed: ${relativePath(file)}`); - fileWatchCache$1.invalidateFile(file); - }, - onFileDeleted: file => { - logger.logger.info(`rebuilding` + pc__default["default"].gray(` (- ${relativePath(file)})`)); - websocket.log(`file deleted: ${relativePath(file)}`); - fileWatchCache$1.invalidateFile(file); - } - }); - server.listen(options.port); - let cleanup = async () => { - var _state$appServer2; - (_state$appServer2 = state.appServer) === null || _state$appServer2 === void 0 ? void 0 : _state$appServer2.kill(); - websocket.close(); - server.close(); - await dispose(); - }; - exitHook__default["default"](cleanup); - return cleanup; -}; -let clean = config => { - try { - fse__default["default"].emptyDirSync(config.relativeAssetsBuildDirectory); - } catch {} -}; -let relativePath = file => path__namespace.relative(process.cwd(), file); - -exports.serve = serve; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/proc.js b/.yalc/@remix-run/dev/dist/devServer_unstable/proc.js deleted file mode 100644 index 9da844f..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/proc.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @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 execa = require('execa'); -var pidtree = require('pidtree'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa); -var pidtree__default = /*#__PURE__*/_interopDefaultLegacy(pidtree); - -let isWindows = process.platform === "win32"; -let kill = async pid => { - if (!isAlive(pid)) return; - if (isWindows) { - await execa__default["default"]("taskkill", ["/F", "/PID", pid.toString()]).catch(error => { - // taskkill 128 -> the process is already dead - if (error.exitCode === 128) return; - if (/There is no running instance of the task./.test(error.message)) return; - console.warn(error.message); - }); - return; - } - await execa__default["default"]("kill", ["-9", pid.toString()]).catch(error => { - // process is already dead - if (/No such process/.test(error.message)) return; - console.warn(error.message); - }); -}; -let isAlive = pid => { - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } -}; -let killtree = async pid => { - let descendants = await pidtree__default["default"](pid).catch(() => undefined); - if (descendants === undefined) return; - let pids = [pid, ...descendants]; - await Promise.all(pids.map(kill)); - return new Promise((resolve, reject) => { - let check = setInterval(() => { - pids = pids.filter(isAlive); - if (pids.length === 0) { - clearInterval(check); - resolve(); - } - }, 50); - setTimeout(() => { - clearInterval(check); - reject(new Error("Timeout: Processes did not exit within the specified time.")); - }, 2000); - }); -}; - -exports.kill = kill; -exports.killtree = killtree; diff --git a/.yalc/@remix-run/dev/dist/devServer_unstable/socket.js b/.yalc/@remix-run/dev/dist/devServer_unstable/socket.js deleted file mode 100644 index fcb7260..0000000 --- a/.yalc/@remix-run/dev/dist/devServer_unstable/socket.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @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 WebSocket = require('ws'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket); - -let serve = server => { - let wss = new WebSocket__default["default"].Server({ - server - }); - let broadcast = message => { - wss.clients.forEach(client => { - if (client.readyState === WebSocket__default["default"].OPEN) { - client.send(JSON.stringify(message)); - } - }); - }; - let log = messageText => { - let _message = `[remix] ${messageText}`; - broadcast({ - type: "LOG", - message: _message - }); - }; - let reload = () => broadcast({ - type: "RELOAD" - }); - let hmr = (assetsManifest, updates) => { - broadcast({ - type: "HMR", - assetsManifest, - updates - }); - }; - let heartbeat = setInterval(broadcast, 60000, { - type: "PING" - }); - let close = () => { - clearInterval(heartbeat); - return wss.close(); - }; - return { - log, - reload, - hmr, - close - }; -}; - -exports.serve = serve; diff --git a/.yalc/@remix-run/dev/dist/index.js b/.yalc/@remix-run/dev/dist/index.js deleted file mode 100644 index 5d39f5a..0000000 --- a/.yalc/@remix-run/dev/dist/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @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 index = require('./cli/index.js'); -var dependencies = require('./dependencies.js'); -var index$1 = require('./vite/index.js'); - - - -exports.cli = index; -exports.getDependenciesToBundle = dependencies.getDependenciesToBundle; -exports.unstable_createViteServer = index$1.unstable_createViteServer; -exports.unstable_loadViteServerBuild = index$1.unstable_loadViteServerBuild; -exports.unstable_vitePlugin = index$1.unstable_vitePlugin; diff --git a/.yalc/@remix-run/dev/dist/invariant.js b/.yalc/@remix-run/dev/dist/invariant.js deleted file mode 100644 index 6595f65..0000000 --- a/.yalc/@remix-run/dev/dist/invariant.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @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 }); - -function invariant(value, message) { - if (value === false || value === null || typeof value === "undefined") { - console.error("The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new"); - throw new Error(message); - } -} - -exports["default"] = invariant; diff --git a/.yalc/@remix-run/dev/dist/package.json b/.yalc/@remix-run/dev/dist/package.json deleted file mode 100644 index e877336..0000000 --- a/.yalc/@remix-run/dev/dist/package.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "name": "@remix-run/dev", - "version": "2.2.0", - "description": "Dev tools and CLI for Remix", - "homepage": "https://remix.run", - "bugs": { - "url": "https://github.com/remix-run/remix/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/remix-run/remix", - "directory": "packages/remix-dev" - }, - "license": "MIT", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "bin": { - "remix": "dist/cli.js" - }, - "dependencies": { - "@babel/core": "^7.21.8", - "@babel/generator": "^7.21.5", - "@babel/parser": "^7.21.8", - "@babel/plugin-syntax-decorators": "^7.22.10", - "@babel/plugin-syntax-jsx": "^7.21.4", - "@babel/preset-typescript": "^7.21.5", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.22.5", - "@mdx-js/mdx": "^2.3.0", - "@npmcli/package-json": "^4.0.1", - "@remix-run/node": "2.2.0", - "@remix-run/router": "1.11.0", - "@remix-run/server-runtime": "2.2.0", - "@types/mdx": "^2.0.5", - "@vanilla-extract/integration": "^6.2.0", - "arg": "^5.0.1", - "cacache": "^17.1.3", - "chalk": "^4.1.2", - "chokidar": "^3.5.1", - "cross-spawn": "^7.0.3", - "dotenv": "^16.0.0", - "es-module-lexer": "^1.3.1", - "esbuild": "0.17.6", - "esbuild-plugins-node-modules-polyfill": "^1.6.0", - "execa": "5.1.1", - "exit-hook": "2.2.1", - "express": "^4.17.1", - "fs-extra": "^10.0.0", - "get-port": "^5.1.1", - "gunzip-maybe": "^1.4.2", - "jsesc": "3.0.2", - "json5": "^2.2.2", - "lodash": "^4.17.21", - "lodash.debounce": "^4.0.8", - "minimatch": "^9.0.0", - "node-fetch": "^2.6.9", - "ora": "^5.4.1", - "parse-multipart-data": "^1.5.0", - "picocolors": "^1.0.0", - "picomatch": "^2.3.1", - "pidtree": "^0.6.0", - "postcss": "^8.4.19", - "postcss-discard-duplicates": "^5.1.0", - "postcss-load-config": "^4.0.1", - "postcss-modules": "^6.0.0", - "prettier": "^2.7.1", - "pretty-ms": "^7.0.1", - "react-refresh": "^0.14.0", - "remark-frontmatter": "4.0.1", - "remark-mdx-frontmatter": "^1.0.1", - "semver": "^7.3.7", - "set-cookie-parser": "^2.6.0", - "tar-fs": "^2.1.1", - "tsconfig-paths": "^4.0.0", - "undici": "^5.22.1", - "ws": "^7.4.5" - }, - "devDependencies": { - "@remix-run/serve": "2.2.0", - "@types/cacache": "^17.0.0", - "@types/cross-spawn": "^6.0.2", - "@types/gunzip-maybe": "^1.4.0", - "@types/jsesc": "^3.0.1", - "@types/lodash.debounce": "^4.0.6", - "@types/node": "^18.17.1", - "@types/node-fetch": "^2.5.7", - "@types/npmcli__package-json": "^4.0.0", - "@types/picomatch": "^2.3.0", - "@types/prettier": "^2.7.3", - "@types/shelljs": "^0.8.11", - "@types/tar-fs": "^2.0.1", - "@types/ws": "^7.4.1", - "esbuild-register": "^3.3.2", - "fast-glob": "3.2.11", - "msw": "^1.2.3", - "strip-ansi": "^6.0.1", - "tiny-invariant": "^1.2.0", - "vite": "^4.4.9" - }, - "peerDependencies": { - "@remix-run/serve": "^2.2.0", - "typescript": "^5.1.0", - "vite": "^4.4.9" - }, - "peerDependenciesMeta": { - "@remix-run/serve": { - "optional": true - }, - "typescript": { - "optional": true - }, - "vite": { - "optional": true - } - }, - "engines": { - "node": ">=18.0.0" - }, - "files": [ - "dist/", - "compiler/shims/", - "server-build.js", - "server-build.d.ts", - "CHANGELOG.md", - "LICENSE.md", - "README.md" - ] -} diff --git a/.yalc/@remix-run/dev/dist/result.js b/.yalc/@remix-run/dev/dist/result.js deleted file mode 100644 index acc66a3..0000000 --- a/.yalc/@remix-run/dev/dist/result.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @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 }); - -let ok = value => ({ - ok: true, - value -}); -let err = error => ({ - ok: false, - error -}); - -exports.err = err; -exports.ok = ok; diff --git a/.yalc/@remix-run/dev/dist/server-build.js b/.yalc/@remix-run/dev/dist/server-build.js deleted file mode 100644 index 0935c70..0000000 --- a/.yalc/@remix-run/dev/dist/server-build.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/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'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -throw new Error("@remix-run/dev/server-build is not meant to be used directly from node_modules." + " It exists to provide type definitions for a virtual module provided" + " by the Remix compiler at build time."); -const mode = undefined; -const assets = undefined; -const entry = undefined; -const routes = undefined; -const future = undefined; -const publicPath = undefined; -// prettier-ignore -const assetsBuildDirectory = undefined; - -exports.assets = assets; -exports.assetsBuildDirectory = assetsBuildDirectory; -exports.entry = entry; -exports.future = future; -exports.mode = mode; -exports.publicPath = publicPath; -exports.routes = routes; diff --git a/.yalc/@remix-run/dev/dist/tux/format.js b/.yalc/@remix-run/dev/dist/tux/format.js deleted file mode 100644 index 9f80954..0000000 --- a/.yalc/@remix-run/dev/dist/tux/format.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @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 pc = require('picocolors'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc); - -let format = ({ - label, - color -}) => (message, details = []) => { - let lines = []; - lines.push((pc__default["default"].isColorSupported ? pc__default["default"].inverse(color(` ${label} `)) : `[${label}]`) + " " + message); - if (details.length > 0) { - for (let detail of details) { - lines.push(color("┃") + " " + pc__default["default"].gray(detail)); - } - lines.push(color("┗")); - } - return lines.join("\n"); -}; - -exports.format = format; diff --git a/.yalc/@remix-run/dev/dist/tux/logger.js b/.yalc/@remix-run/dev/dist/tux/logger.js deleted file mode 100644 index 7500f23..0000000 --- a/.yalc/@remix-run/dev/dist/tux/logger.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @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 pc = require('picocolors'); -var format = require('./format.js'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc); - -let log = ({ - label, - color, - dest -}) => { - let _format = format.format({ - label, - color - }); - let already = new Set(); - return (message, { - details, - key - } = {}) => { - let formatted = _format(message, details) + "\n"; - if (key === undefined) return dest.write(formatted); - if (already.has(key)) return; - already.add(key); - dest.write(formatted); - }; -}; -let logger = { - debug: log({ - label: "debug", - color: pc__default["default"].green, - dest: process.stdout - }), - info: log({ - label: "info", - color: pc__default["default"].blue, - dest: process.stdout - }), - warn: log({ - label: "warn", - color: pc__default["default"].yellow, - dest: process.stderr - }), - error: log({ - label: "error", - color: pc__default["default"].red, - dest: process.stderr - }) -}; - -exports.logger = logger; diff --git a/.yalc/@remix-run/dev/dist/vite/index.js b/.yalc/@remix-run/dev/dist/vite/index.js deleted file mode 100644 index a257497..0000000 --- a/.yalc/@remix-run/dev/dist/vite/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @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 vmod = require('./vmod.js'); - -// This file allows us to dynamically require the plugin so non-Vite consumers -const unstable_vitePlugin = (...args) => { - // eslint-disable-next-line @typescript-eslint/consistent-type-imports - let { - remixVitePlugin - } = require("./plugin"); - return remixVitePlugin(...args); -}; -const unstable_createViteServer = async () => { - let vite = await import('vite'); - return vite.createServer({ - server: { - middlewareMode: true - } - }); -}; -const unstable_loadViteServerBuild = async vite => { - return vite.ssrLoadModule(vmod.id("server-entry")); -}; - -exports.unstable_createViteServer = unstable_createViteServer; -exports.unstable_loadViteServerBuild = unstable_loadViteServerBuild; -exports.unstable_vitePlugin = unstable_vitePlugin; diff --git a/.yalc/@remix-run/dev/dist/vite/legacy-css-imports.js b/.yalc/@remix-run/dev/dist/vite/legacy-css-imports.js deleted file mode 100644 index 8d90e4c..0000000 --- a/.yalc/@remix-run/dev/dist/vite/legacy-css-imports.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @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 parser = require('@babel/parser'); -var t = require('@babel/types'); -var traverse = require('@babel/traverse'); -var generate = require('@babel/generator'); - -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 t__namespace = /*#__PURE__*/_interopNamespace(t); -var traverse__default = /*#__PURE__*/_interopDefaultLegacy(traverse); -var generate__default = /*#__PURE__*/_interopDefaultLegacy(generate); - -const transformLegacyCssImports = source => { - let ast = parser.parse(source, { - sourceType: "module", - plugins: ["typescript", "jsx"] - }); - traverse__default["default"](ast, { - // Handle `import styles from "./styles.css"` - ImportDeclaration(path) { - if (path.node.source.value.endsWith(".css") && - // CSS Modules are bundled in the Remix compiler so they're already - // compatible with Vite's default CSS handling - !path.node.source.value.endsWith(".module.css") && t__namespace.isImportDefaultSpecifier(path.node.specifiers[0])) { - path.node.source.value += "?url"; - } - } - }); - return { - code: generate__default["default"](ast, { - retainLines: true - }).code, - map: null - }; -}; - -exports.transformLegacyCssImports = transformLegacyCssImports; diff --git a/.yalc/@remix-run/dev/dist/vite/node/adapter.js b/.yalc/@remix-run/dev/dist/vite/node/adapter.js deleted file mode 100644 index 1d068aa..0000000 --- a/.yalc/@remix-run/dev/dist/vite/node/adapter.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @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 events = require('events'); -var multipart = require('parse-multipart-data'); -var setCookieParser = require('set-cookie-parser'); -var stream = require('stream'); -var undici = require('undici'); -var node = require('@remix-run/node'); -var serverRuntime = require('@remix-run/server-runtime'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var multipart__default = /*#__PURE__*/_interopDefaultLegacy(multipart); - -// @ts-nocheck -node.installGlobals(); -function nodeToWeb(nodeStream) { - let destroyed = false; - let listeners = {}; - function start(controller) { - listeners["data"] = onData; - listeners["end"] = onData; - listeners["end"] = onDestroy; - listeners["close"] = onDestroy; - listeners["error"] = onDestroy; - for (let name in listeners) nodeStream.on(name, listeners[name]); - nodeStream.pause(); - function onData(chunk) { - if (destroyed) return; - controller.enqueue(chunk); - nodeStream.pause(); - } - function onDestroy(err) { - if (destroyed) return; - destroyed = true; - for (let name in listeners) nodeStream.removeListener(name, listeners[name]); - if (err) controller.error(err);else controller.close(); - } - } - function pull() { - if (destroyed) return; - nodeStream.resume(); - } - function cancel() { - destroyed = true; - for (let name in listeners) nodeStream.removeListener(name, listeners[name]); - nodeStream.push(null); - nodeStream.pause(); - if (nodeStream.destroy) nodeStream.destroy();else if (nodeStream.close) nodeStream.close(); - } - return new ReadableStream({ - start: start, - pull: pull, - cancel: cancel - }); -} -function createHeaders(requestHeaders) { - let headers = new undici.Headers(); - for (let [key, values] of Object.entries(requestHeaders)) { - if (values) { - if (Array.isArray(values)) { - for (let value of values) { - headers.append(key, value); - } - } else { - headers.set(key, values); - } - } - } - return headers; -} -class NodeRequest extends undici.Request { - constructor(input, init) { - if (init && init.data && init.data.on) { - var _init$data$headers$co; - init = { - duplex: "half", - ...init, - body: (_init$data$headers$co = init.data.headers["content-type"]) !== null && _init$data$headers$co !== void 0 && _init$data$headers$co.includes("x-www") ? init.data : nodeToWeb(init.data) - }; - } - super(input, init); - } - - // async json() { - // return JSON.parse(await this.text()); - // } - - async buffer() { - return Buffer.from(await super.arrayBuffer()); - } - - // async text() { - // return (await this.buffer()).toString(); - // } - - // @ts-ignore - async formData() { - if (this.headers.get("content-type") === "application/x-www-form-urlencoded") { - return await super.formData(); - } else { - let data = await this.buffer(); - let input = multipart__default["default"].parse(data, this.headers.get("content-type").replace("multipart/form-data; boundary=", "")); - let form = new undici.FormData(); - input.forEach(({ - name, - data, - filename, - type - }) => { - // file fields have Content-Type set, - // whereas non-file fields must not - // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data - let isFile = type !== undefined; - if (isFile) { - let value = new undici.File([data], filename, { - type - }); - form.append(name, value, filename); - } else { - let value = data.toString("utf-8"); - form.append(name, value); - } - }); - return form; - } - } - - // @ts-ignore - clone() { - /** @type {BaseNodeRequest & { buffer?: () => Promise; formData?: () => Promise }} */ - let el = super.clone(); - el.buffer = this.buffer.bind(el); - el.formData = this.formData.bind(el); - return el; - } -} -function createRequest(req) { - let origin = req.headers.origin && "null" !== req.headers.origin ? req.headers.origin : `http://${req.headers.host}`; - let url = new URL(req.url, origin); - let init = { - method: req.method, - headers: createHeaders(req.headers), - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods - data: ["POST", "PUT", "DELETE", "PATCH"].includes(req.method) ? req : null - }; - return new NodeRequest(url.href, init); -} -async function handleNodeResponse(webRes, res) { - res.statusCode = webRes.status; - res.statusMessage = webRes.statusText; - for (let [name, value] of webRes.headers) { - if (name === "set-cookie") { - res.setHeader(name, setCookieParser.splitCookiesString(value)); - } else res.setHeader(name, value); - } - if (webRes.body) { - let readable = stream.Readable.from(webRes.body); - readable.pipe(res); - await events.once(readable, "end"); - } else { - res.end(); - } -} -let createRequestHandler = (build, { - mode = "production", - criticalCss -}) => { - let handler = serverRuntime.createRequestHandler(build, mode); - return async (req, res) => { - let request = createRequest(req); - let response = await handler(request, {}, { - __criticalCss: criticalCss - }); - handleNodeResponse(response, res); - }; -}; - -exports.createRequestHandler = createRequestHandler; diff --git a/.yalc/@remix-run/dev/dist/vite/plugin.js b/.yalc/@remix-run/dev/dist/vite/plugin.js deleted file mode 100644 index 9bef461..0000000 --- a/.yalc/@remix-run/dev/dist/vite/plugin.js +++ /dev/null @@ -1,668 +0,0 @@ -/** - * @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 node_crypto = require('node:crypto'); -var path = require('node:path'); -var fs = require('node:fs/promises'); -var babel = require('@babel/core'); -var vite = require('vite'); -var esModuleLexer = require('es-module-lexer'); -var jsesc = require('jsesc'); -var pick = require('lodash/pick'); -var pc = require('picocolors'); -var config = require('../config.js'); -var adapter = require('./node/adapter.js'); -var styles = require('./styles.js'); -var vmod = require('./vmod.js'); -var removeExports = require('./remove-exports.js'); -var legacyCssImports = require('./legacy-css-imports.js'); -var replaceImportSpecifier = require('./replace-import-specifier.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 fs__namespace = /*#__PURE__*/_interopNamespace(fs); -var babel__default = /*#__PURE__*/_interopDefaultLegacy(babel); -var jsesc__default = /*#__PURE__*/_interopDefaultLegacy(jsesc); -var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick); -var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc); - -const supportedRemixConfigKeys = ["appDirectory", "assetsBuildDirectory", "future", "ignoredRouteFiles", "publicPath", "routes", "serverBuildPath", "serverModuleFormat"]; -let serverEntryId = vmod.id("server-entry"); -let serverManifestId = vmod.id("server-manifest"); -let browserManifestId = vmod.id("browser-manifest"); -let remixReactProxyId = vmod.id("remix-react-proxy"); -let hmrRuntimeId = vmod.id("hmr-runtime"); -const normalizePath = p => { - let unixPath = p.replace(/[\\/]+/g, "/").replace(/^([a-zA-Z]+:|\.\/)/, ""); - return vite.normalizePath(unixPath); -}; -const resolveFileUrl = ({ - rootDirectory -}, filePath) => { - let relativePath = path__namespace.relative(rootDirectory, filePath); - if (relativePath.startsWith("..") || path__namespace.isAbsolute(relativePath)) { - throw new Error(`Cannot resolve asset path "${filePath}" outside of root directory "${rootDirectory}".`); - } - return `/${normalizePath(relativePath)}`; -}; -const isJsFile = filePath => /\.[cm]?[jt]sx?$/i.test(filePath); -const resolveRelativeRouteFilePath = (route, pluginConfig) => { - let file = route.file; - let fullPath = path__namespace.resolve(pluginConfig.appDirectory, file); - return normalizePath(fullPath); -}; -let vmods = [serverEntryId, serverManifestId, browserManifestId]; -const getHash = (source, maxLength) => { - let hash = node_crypto.createHash("sha256").update(source).digest("hex"); - return typeof maxLength === "number" ? hash.slice(0, maxLength) : hash; -}; -const resolveBuildAssetPaths = (pluginConfig, manifest, absoluteFilePath) => { - var _manifestEntry$import, _manifestEntry$css; - let rootRelativeFilePath = path__namespace.relative(pluginConfig.rootDirectory, absoluteFilePath); - let manifestKey = normalizePath(rootRelativeFilePath); - let manifestEntry = manifest[manifestKey]; - if (!manifestEntry) { - let knownManifestKeys = Object.keys(manifest).map(key => '"' + key + '"').join(", "); - throw new Error(`No manifest entry found for "${manifestKey}". Known manifest keys: ${knownManifestKeys}`); - } - return { - module: `${pluginConfig.publicPath}${manifestEntry.file}`, - imports: ((_manifestEntry$import = manifestEntry.imports) === null || _manifestEntry$import === void 0 ? void 0 : _manifestEntry$import.map(imported => { - return `${pluginConfig.publicPath}${manifest[imported].file}`; - })) ?? [], - css: ((_manifestEntry$css = manifestEntry.css) === null || _manifestEntry$css === void 0 ? void 0 : _manifestEntry$css.map(href => { - return `${pluginConfig.publicPath}${href}`; - })) ?? [] - }; -}; -const writeFileSafe = async (file, contents) => { - await fs__namespace.mkdir(path__namespace.dirname(file), { - recursive: true - }); - await fs__namespace.writeFile(file, contents); -}; -const getRouteModuleExports = async (viteChildCompiler, pluginConfig, routeFile) => { - if (!viteChildCompiler) { - throw new Error("Vite child compiler not found"); - } - - // We transform the route module code with the Vite child compiler so that we - // can parse the exports from non-JS files like MDX. This ensures that we can - // understand the exports from anything that Vite can compile to JS, not just - // the route file formats that the Remix compiler historically supported. - - let ssr = true; - let { - pluginContainer, - moduleGraph - } = viteChildCompiler; - let routePath = path__namespace.join(pluginConfig.appDirectory, routeFile); - let url = resolveFileUrl(pluginConfig, routePath); - let resolveId = async () => { - let result = await pluginContainer.resolveId(url, undefined, { - ssr - }); - if (!result) throw new Error(`Could not resolve module ID for ${url}`); - return result.id; - }; - let [id, code] = await Promise.all([resolveId(), fs__namespace.readFile(routePath, "utf-8"), - // pluginContainer.transform(...) fails if we don't do this first: - moduleGraph.ensureEntryFromUrl(url, ssr)]); - let transformed = await pluginContainer.transform(code, id, { - ssr - }); - let [, exports] = esModuleLexer.parse(transformed.code); - let exportNames = exports.map(e => e.n); - return exportNames; -}; -const showUnstableWarning = () => { - console.warn(pc__default["default"].yellow("\n ⚠️ Remix support for Vite is unstable\n and not recommended for production\n")); -}; -const getViteMajor = () => { - let vitePkg = require("vite/package.json"); - return parseInt(vitePkg.version.split(".")[0]); -}; -const remixVitePlugin = (options = {}) => { - let isViteGTEv5 = getViteMajor() >= 5; - let viteCommand; - let viteUserConfig; - let cssModulesManifest = {}; - let ssrBuildContext; - let viteChildCompiler = null; - let resolvePluginConfig = async () => { - var _options$future; - let rootDirectory = viteUserConfig.root ?? process.env.REMIX_ROOT ?? process.cwd(); - - // Avoid leaking any config options that the Vite plugin doesn't support - let config$1 = pick__default["default"](options, supportedRemixConfigKeys); - - // Only select the Remix config options that the Vite plugin uses - let { - appDirectory, - assetsBuildDirectory, - entryClientFilePath, - publicPath, - routes, - entryServerFilePath, - serverBuildPath, - serverModuleFormat, - relativeAssetsBuildDirectory - } = await config.resolveConfig(config$1, { - rootDirectory - }); - return { - appDirectory, - rootDirectory, - assetsBuildDirectory, - entryClientFilePath, - publicPath, - routes, - entryServerFilePath, - serverBuildPath, - serverModuleFormat, - relativeAssetsBuildDirectory, - future: { - v3_fetcherPersist: ((_options$future = options.future) === null || _options$future === void 0 ? void 0 : _options$future.v3_fetcherPersist) === true - } - }; - }; - let getServerEntry = async () => { - let pluginConfig = await resolvePluginConfig(); - return ` - import * as entryServer from ${JSON.stringify(resolveFileUrl(pluginConfig, pluginConfig.entryServerFilePath))}; - ${Object.keys(pluginConfig.routes).map((key, index) => { - let route = pluginConfig.routes[key]; - return `import * as route${index} from ${JSON.stringify(resolveFileUrl(pluginConfig, resolveRelativeRouteFilePath(route, pluginConfig)))};`; - }).join("\n")} - export { default as assets } from ${JSON.stringify(serverManifestId)}; - export const assetsBuildDirectory = ${JSON.stringify(pluginConfig.relativeAssetsBuildDirectory)}; - ${pluginConfig.future ? `export const future = ${JSON.stringify(pluginConfig.future)}` : ""}; - export const publicPath = ${JSON.stringify(pluginConfig.publicPath)}; - export const entry = { module: entryServer }; - export const routes = { - ${Object.keys(pluginConfig.routes).map((key, index) => { - let route = pluginConfig.routes[key]; - return `${JSON.stringify(key)}: { - id: ${JSON.stringify(route.id)}, - parentId: ${JSON.stringify(route.parentId)}, - path: ${JSON.stringify(route.path)}, - index: ${JSON.stringify(route.index)}, - caseSensitive: ${JSON.stringify(route.caseSensitive)}, - module: route${index} - }`; - }).join(",\n ")} - };`; - }; - let createBuildManifest = async () => { - let pluginConfig = await resolvePluginConfig(); - let viteManifestPath = isViteGTEv5 ? path__namespace.join(".vite", "manifest.json") : "manifest.json"; - let viteManifest = JSON.parse(await fs__namespace.readFile(path__namespace.resolve(pluginConfig.assetsBuildDirectory, viteManifestPath), "utf-8")); - let entry = resolveBuildAssetPaths(pluginConfig, viteManifest, pluginConfig.entryClientFilePath); - let routes = {}; - for (let [key, route] of Object.entries(pluginConfig.routes)) { - let routeFilePath = path__namespace.join(pluginConfig.appDirectory, route.file); - let sourceExports = await getRouteModuleExports(viteChildCompiler, pluginConfig, route.file); - routes[key] = { - id: route.id, - parentId: route.parentId, - path: route.path, - index: route.index, - caseSensitive: route.caseSensitive, - hasAction: sourceExports.includes("action"), - hasLoader: sourceExports.includes("loader"), - hasErrorBoundary: sourceExports.includes("ErrorBoundary"), - ...resolveBuildAssetPaths(pluginConfig, viteManifest, routeFilePath) - }; - } - let fingerprintedValues = { - entry, - routes - }; - let version = getHash(JSON.stringify(fingerprintedValues), 8); - let manifestFilename = `manifest-${version}.js`; - let url = `${pluginConfig.publicPath}${manifestFilename}`; - let nonFingerprintedValues = { - url, - version - }; - let manifest = { - ...fingerprintedValues, - ...nonFingerprintedValues - }; - await writeFileSafe(path__namespace.join(pluginConfig.assetsBuildDirectory, manifestFilename), `window.__remixManifest=${JSON.stringify(manifest)};`); - return manifest; - }; - let getDevManifest = async () => { - let pluginConfig = await resolvePluginConfig(); - let routes = {}; - for (let [key, route] of Object.entries(pluginConfig.routes)) { - let sourceExports = await getRouteModuleExports(viteChildCompiler, pluginConfig, route.file); - routes[key] = { - id: route.id, - parentId: route.parentId, - path: route.path, - index: route.index, - caseSensitive: route.caseSensitive, - module: `${resolveFileUrl(pluginConfig, resolveRelativeRouteFilePath(route, pluginConfig))}${isJsFile(route.file) ? "" : "?import" // Ensure the Vite dev server responds with a JS module - }`, - hasAction: sourceExports.includes("action"), - hasLoader: sourceExports.includes("loader"), - hasErrorBoundary: sourceExports.includes("ErrorBoundary"), - imports: [] - }; - } - return { - version: String(Math.random()), - url: vmod.url(browserManifestId), - entry: { - module: resolveFileUrl(pluginConfig, pluginConfig.entryClientFilePath), - imports: [] - }, - routes - }; - }; - return [{ - name: "remix", - config: async (_viteUserConfig, viteConfigEnv) => { - var _viteUserConfig$build, _viteUserConfig$build2; - viteUserConfig = _viteUserConfig; - viteCommand = viteConfigEnv.command; - let pluginConfig = await resolvePluginConfig(); - return { - appType: "custom", - experimental: { - hmrPartialAccept: true - }, - optimizeDeps: { - include: [ - // pre-bundle React dependencies to avoid React duplicates, - // even if React dependencies are not direct dependencies - // https://react.dev/warnings/invalid-hook-call-warning#duplicate-react - "react", `react/jsx-runtime`, `react/jsx-dev-runtime`, "react-dom/client"] - }, - resolve: { - // https://react.dev/warnings/invalid-hook-call-warning#duplicate-react - dedupe: ["react", "react-dom"] - }, - ...(viteCommand === "build" && { - base: pluginConfig.publicPath, - build: { - ...viteUserConfig.build, - ...(!viteConfigEnv.ssrBuild ? { - manifest: true, - outDir: pluginConfig.assetsBuildDirectory, - rollupOptions: { - ...((_viteUserConfig$build = viteUserConfig.build) === null || _viteUserConfig$build === void 0 ? void 0 : _viteUserConfig$build.rollupOptions), - preserveEntrySignatures: "exports-only", - input: [pluginConfig.entryClientFilePath, ...Object.values(pluginConfig.routes).map(route => path__namespace.resolve(pluginConfig.appDirectory, route.file))] - } - } : { - outDir: path__namespace.dirname(pluginConfig.serverBuildPath), - rollupOptions: { - ...((_viteUserConfig$build2 = viteUserConfig.build) === null || _viteUserConfig$build2 === void 0 ? void 0 : _viteUserConfig$build2.rollupOptions), - preserveEntrySignatures: "exports-only", - input: serverEntryId, - output: { - entryFileNames: path__namespace.basename(pluginConfig.serverBuildPath), - format: pluginConfig.serverModuleFormat - } - } - }) - } - }) - }; - }, - async configResolved(viteConfig) { - await esModuleLexer.init; - viteChildCompiler = await vite.createServer({ - ...viteUserConfig, - server: { - ...viteUserConfig.server, - // when parent compiler runs in middleware mode to support - // custom servers, we don't want the child compiler also - // run in middleware mode as that will cause websocket port conflicts - middlewareMode: false - }, - configFile: false, - envFile: false, - plugins: [...(viteUserConfig.plugins ?? []).flat() - // Exclude this plugin from the child compiler to prevent an - // infinite loop (plugin creates a child compiler with the same - // plugin that creates another child compiler, repeat ad - // infinitum), and to prevent the manifest from being written to - // disk from the child compiler. This is important in the - // production build because the child compiler is a Vite dev - // server and will generate incorrect manifests. - .filter(plugin => typeof plugin === "object" && plugin !== null && "name" in plugin && plugin.name !== "remix" && plugin.name !== "remix-hmr-updates"), { - name: "no-hmr", - handleHotUpdate() { - // parent vite server is already sending HMR updates - // do not send duplicate HMR updates from child server - // which log confusing "page reloaded" messages that aren't true - return []; - } - }] - }); - await viteChildCompiler.pluginContainer.buildStart({}); - ssrBuildContext = viteConfig.build.ssr && viteCommand === "build" ? { - isSsrBuild: true, - getManifest: createBuildManifest - } : { - isSsrBuild: false - }; - }, - transform(code, id) { - if (styles.isCssModulesFile(id)) { - cssModulesManifest[id] = code; - } - }, - buildStart() { - if (viteCommand === "build") { - showUnstableWarning(); - } - }, - configureServer(vite) { - var _vite$httpServer; - (_vite$httpServer = vite.httpServer) === null || _vite$httpServer === void 0 ? void 0 : _vite$httpServer.on("listening", () => { - setTimeout(showUnstableWarning, 50); - }); - // Let user servers handle SSR requests in middleware mode - if (vite.config.server.middlewareMode) return; - return () => { - vite.middlewares.use(async (req, res, next) => { - try { - // Invalidate all virtual modules - vmods.forEach(vmod$1 => { - let mod = vite.moduleGraph.getModuleById(vmod.resolve(vmod$1)); - if (mod) { - vite.moduleGraph.invalidateModule(mod); - } - }); - let { - url - } = req; - let [pluginConfig, build] = await Promise.all([resolvePluginConfig(), vite.ssrLoadModule(serverEntryId)]); - let handle = adapter.createRequestHandler(build, { - mode: "development", - criticalCss: await styles.getStylesForUrl(vite, pluginConfig, cssModulesManifest, build, url) - }); - await handle(req, res); - } catch (error) { - next(error); - } - }); - }; - }, - async buildEnd() { - var _viteChildCompiler; - await ((_viteChildCompiler = viteChildCompiler) === null || _viteChildCompiler === void 0 ? void 0 : _viteChildCompiler.close()); - } - }, { - name: "remix-virtual-modules", - enforce: "pre", - resolveId(id) { - if (vmods.includes(id)) return vmod.resolve(id); - }, - async load(id) { - switch (id) { - case vmod.resolve(serverEntryId): - { - return await getServerEntry(); - } - case vmod.resolve(serverManifestId): - { - let manifest = ssrBuildContext.isSsrBuild ? await ssrBuildContext.getManifest() : await getDevManifest(); - return `export default ${jsesc__default["default"](manifest, { - es6: true - })};`; - } - case vmod.resolve(browserManifestId): - { - if (viteCommand === "build") { - throw new Error("This module only exists in development"); - } - let manifest = await getDevManifest(); - return `window.__remixManifest=${jsesc__default["default"](manifest, { - es6: true - })};`; - } - } - } - }, { - name: "remix-empty-server-modules", - enforce: "pre", - async transform(_code, id, options) { - if (!(options !== null && options !== void 0 && options.ssr) && /\.server(\.[cm]?[jt]sx?)?$/.test(id)) return { - code: "export default {}", - map: null - }; - } - }, { - name: "remix-empty-client-modules", - enforce: "pre", - async transform(_code, id, options) { - if (options !== null && options !== void 0 && options.ssr && /\.client(\.[cm]?[jt]sx?)?$/.test(id)) return { - code: "export default {}", - map: null - }; - } - }, { - name: "remix-remove-server-exports", - enforce: "post", - // Ensure we're operating on the transformed code to support MDX etc. - async transform(code, id, options) { - if (options !== null && options !== void 0 && options.ssr) return; - let pluginConfig = await resolvePluginConfig(); - let route = getRoute(pluginConfig, id); - if (!route) return; - let serverExports = ["loader", "action", "headers"]; - return { - code: removeExports.removeExports(code, serverExports), - map: null - }; - } - }, { - name: "remix-remix-react-proxy", - enforce: "post", - // Ensure we're operating on the transformed code to support MDX etc. - resolveId(id) { - if (id === remixReactProxyId) { - return vmod.resolve(remixReactProxyId); - } - }, - transform(code, id) { - // Don't transform the proxy itself, otherwise it will import itself - if (id === vmod.resolve(remixReactProxyId)) { - return; - } - - // Don't transform files that don't need the proxy - if (!code.includes("@remix-run/react") && !code.includes("LiveReload")) { - return; - } - - // Rewrite imports to use the proxy - return replaceImportSpecifier.replaceImportSpecifier({ - code, - specifier: "@remix-run/react", - replaceWith: remixReactProxyId - }); - }, - load(id) { - if (id === vmod.resolve(remixReactProxyId)) { - // TODO: ensure react refresh is initialized before `` - return ['import { createElement } from "react";', 'export * from "@remix-run/react";', 'export const LiveReload = process.env.NODE_ENV !== "development" ? () => null : ', '() => createElement("script", {', ' type: "module",', " async: true,", " suppressHydrationWarning: true,", " dangerouslySetInnerHTML: { __html: `", ` import RefreshRuntime from "${vmod.url(hmrRuntimeId)}"`, " RefreshRuntime.injectIntoGlobalHook(window)", " window.$RefreshReg$ = () => {}", " window.$RefreshSig$ = () => (type) => type", " window.__vite_plugin_react_preamble_installed__ = true", " `}", "});"].join("\n"); - } - } - }, { - name: "remix-hmr-runtime", - enforce: "pre", - resolveId(id) { - if (id === hmrRuntimeId) return vmod.resolve(hmrRuntimeId); - }, - async load(id) { - if (id !== vmod.resolve(hmrRuntimeId)) return; - let reactRefreshDir = path__namespace.dirname(require.resolve("react-refresh/package.json")); - let reactRefreshRuntimePath = path__namespace.join(reactRefreshDir, "cjs/react-refresh-runtime.development.js"); - return ["const exports = {}", await fs__namespace.readFile(reactRefreshRuntimePath, "utf8"), await fs__namespace.readFile(require.resolve("./static/refresh-utils.cjs"), "utf8"), "export default exports"].join("\n"); - } - }, { - name: "remix-react-refresh-babel", - enforce: "post", - async transform(code, id, options) { - if (viteCommand !== "serve") return; - if (id.includes("/node_modules/")) return; - let [filepath] = id.split("?"); - if (!/.[tj]sx?$/.test(filepath)) return; - let devRuntime = "react/jsx-dev-runtime"; - let ssr = (options === null || options === void 0 ? void 0 : options.ssr) === true; - let isJSX = filepath.endsWith("x"); - let useFastRefresh = !ssr && (isJSX || code.includes(devRuntime)); - if (!useFastRefresh) return; - let result = await babel__default["default"].transformAsync(code, { - filename: id, - sourceFileName: filepath, - parserOpts: { - sourceType: "module", - allowAwaitOutsideFunction: true, - plugins: ["jsx", "typescript"] - }, - plugins: ["react-refresh/babel"], - sourceMaps: true - }); - if (result === null) return; - code = result.code; - let refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/; - if (refreshContentRE.test(code)) { - let pluginConfig = await resolvePluginConfig(); - code = addRefreshWrapper(pluginConfig, code, id); - } - return { - code, - map: result.map - }; - } - }, { - name: "remix-hmr-updates", - async handleHotUpdate({ - server, - file, - modules - }) { - let pluginConfig = await resolvePluginConfig(); - let route = getRoute(pluginConfig, file); - server.ws.send({ - type: "custom", - event: "remix:hmr", - data: { - route: route ? await getRouteMetadata(pluginConfig, viteChildCompiler, route) : null - } - }); - return modules; - } - }, ...(options.legacyCssImports ? [{ - name: "remix-legacy-css-imports", - enforce: "pre", - transform(code) { - if (code.includes('.css"') || code.includes(".css'")) { - return legacyCssImports.transformLegacyCssImports(code); - } - } - }] : [])]; -}; -function addRefreshWrapper(pluginConfig, code, id) { - let isRoute = getRoute(pluginConfig, id); - let acceptExports = isRoute ? ["meta", "links", "shouldRevalidate"] : []; - return REACT_REFRESH_HEADER.replace("__SOURCE__", JSON.stringify(id)) + code + REACT_REFRESH_FOOTER.replace("__SOURCE__", JSON.stringify(id)).replace("__ACCEPT_EXPORTS__", JSON.stringify(acceptExports)); -} -const REACT_REFRESH_HEADER = ` -import RefreshRuntime from "${hmrRuntimeId}"; - -const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; -let prevRefreshReg; -let prevRefreshSig; - -if (import.meta.hot && !inWebWorker) { - if (!window.__vite_plugin_react_preamble_installed__) { - throw new Error( - "@vitejs/plugin-react can't detect preamble. Something is wrong. " + - "See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201" - ); - } - - prevRefreshReg = window.$RefreshReg$; - prevRefreshSig = window.$RefreshSig$; - window.$RefreshReg$ = (type, id) => { - RefreshRuntime.register(type, __SOURCE__ + " " + id) - }; - window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; -}`.replace(/\n+/g, ""); -const REACT_REFRESH_FOOTER = ` -if (import.meta.hot && !inWebWorker) { - window.$RefreshReg$ = prevRefreshReg; - window.$RefreshSig$ = prevRefreshSig; - RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => { - RefreshRuntime.registerExportsForReactRefresh(__SOURCE__, currentExports); - import.meta.hot.accept((nextExports) => { - if (!nextExports) return; - const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(currentExports, nextExports, __ACCEPT_EXPORTS__); - if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage); - }); - }); -}`; -function getRoute(pluginConfig, file) { - if (!file.startsWith(vite.normalizePath(pluginConfig.appDirectory))) return; - let routePath = vite.normalizePath(path__namespace.relative(pluginConfig.appDirectory, file)); - let route = Object.values(pluginConfig.routes).find(r => r.file === routePath); - return route; -} -async function getRouteMetadata(pluginConfig, viteChildCompiler, route) { - let sourceExports = await getRouteModuleExports(viteChildCompiler, pluginConfig, route.file); - let info = { - id: route.id, - parentId: route.parentId, - path: route.path, - index: route.index, - caseSensitive: route.caseSensitive, - url: "/" + path__namespace.relative(pluginConfig.rootDirectory, resolveRelativeRouteFilePath(route, pluginConfig)), - module: `${resolveFileUrl(pluginConfig, resolveRelativeRouteFilePath(route, pluginConfig))}?import`, - // Ensure the Vite dev server responds with a JS module - hasAction: sourceExports.includes("action"), - hasLoader: sourceExports.includes("loader"), - hasErrorBoundary: sourceExports.includes("ErrorBoundary"), - imports: [] - }; - return info; -} - -exports.remixVitePlugin = remixVitePlugin; diff --git a/.yalc/@remix-run/dev/dist/vite/remove-exports.js b/.yalc/@remix-run/dev/dist/vite/remove-exports.js deleted file mode 100644 index 6c47bff..0000000 --- a/.yalc/@remix-run/dev/dist/vite/remove-exports.js +++ /dev/null @@ -1,288 +0,0 @@ -/** - * @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 parser = require('@babel/parser'); -var t = require('@babel/types'); -var traverse = require('@babel/traverse'); -var generate = require('@babel/generator'); - -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 t__namespace = /*#__PURE__*/_interopNamespace(t); -var traverse__default = /*#__PURE__*/_interopDefaultLegacy(traverse); -var generate__default = /*#__PURE__*/_interopDefaultLegacy(generate); - -// Adapted from https://github.com/egoist/babel-plugin-eliminator/blob/d29859396b7708b7f7abbacdd951cbbc80902f00/src/index.ts -function getIdentifier(path) { - let parentPath = path.parentPath; - if (parentPath.type === "VariableDeclarator") { - let variablePath = parentPath; - let name = variablePath.get("id"); - return name.node.type === "Identifier" ? name : null; - } - if (parentPath.type === "AssignmentExpression") { - let variablePath = parentPath; - let name = variablePath.get("left"); - return name.node.type === "Identifier" ? name : null; - } - if (path.node.type === "ArrowFunctionExpression") { - return null; - } - return path.node.id && path.node.id.type === "Identifier" ? path.get("id") : null; -} -function isIdentifierReferenced(ident) { - let binding = ident.scope.getBinding(ident.node.name); - if (binding !== null && binding !== void 0 && binding.referenced) { - // Functions can reference themselves, so we need to check if there's a - // binding outside the function scope or not. - if (binding.path.type === "FunctionDeclaration") { - return !binding.constantViolations.concat(binding.referencePaths) - // Check that every reference is contained within the function: - .every(ref => ref.findParent(parent => parent === (binding === null || binding === void 0 ? void 0 : binding.path))); - } - return true; - } - return false; -} -const removeExports = (source, exportsToRemove) => { - let document = parser.parse(source, { - sourceType: "module" - }); - let generateCode = () => generate__default["default"](document).code; - let referencedIdentifiers = new Set(); - let removedExports = new Set(); - let markImport = path => { - let local = path.get("local"); - if (isIdentifierReferenced(local)) { - referencedIdentifiers.add(local); - } - }; - let markFunction = path => { - let identifier = getIdentifier(path); - if (identifier !== null && identifier !== void 0 && identifier.node && isIdentifierReferenced(identifier)) { - referencedIdentifiers.add(identifier); - } - }; - traverse__default["default"](document, { - VariableDeclarator(variablePath) { - if (variablePath.node.id.type === "Identifier") { - let local = variablePath.get("id"); - if (isIdentifierReferenced(local)) { - referencedIdentifiers.add(local); - } - } else if (variablePath.node.id.type === "ObjectPattern") { - let pattern = variablePath.get("id"); - let properties = pattern.get("properties"); - properties.forEach(p => { - let local = p.get(p.node.type === "ObjectProperty" ? "value" : p.node.type === "RestElement" ? "argument" : function () { - throw new Error("invariant"); - }()); - if (isIdentifierReferenced(local)) { - referencedIdentifiers.add(local); - } - }); - } else if (variablePath.node.id.type === "ArrayPattern") { - let pattern = variablePath.get("id"); - let elements = pattern.get("elements"); - elements.forEach(element => { - var _element$node, _element$node2; - let local; - if (((_element$node = element.node) === null || _element$node === void 0 ? void 0 : _element$node.type) === "Identifier") { - local = element; - } else if (((_element$node2 = element.node) === null || _element$node2 === void 0 ? void 0 : _element$node2.type) === "RestElement") { - local = element.get("argument"); - } else { - return; - } - if (isIdentifierReferenced(local)) { - referencedIdentifiers.add(local); - } - }); - } - }, - FunctionDeclaration: markFunction, - FunctionExpression: markFunction, - ArrowFunctionExpression: markFunction, - ImportSpecifier: markImport, - ImportDefaultSpecifier: markImport, - ImportNamespaceSpecifier: markImport, - ExportNamedDeclaration(path) { - let shouldRemove = false; - - // Handle re-exports: export { preload } from './foo' - path.node.specifiers = path.node.specifiers.filter(spec => { - if (spec.exported.type !== "Identifier") { - return true; - } - let { - name - } = spec.exported; - for (let namedExport of exportsToRemove) { - if (name === namedExport) { - removedExports.add(namedExport); - return false; - } - } - return true; - }); - let { - declaration - } = path.node; - - // When no re-exports are left, remove the path - if (!declaration && path.node.specifiers.length === 0) { - shouldRemove = true; - } - if (declaration && declaration.type === "VariableDeclaration") { - declaration.declarations = declaration.declarations.filter(declarator => { - for (let name of exportsToRemove) { - if (declarator.id.name === name) { - removedExports.add(name); - return false; - } - } - return true; - }); - if (declaration.declarations.length === 0) { - shouldRemove = true; - } - } - if (declaration && declaration.type === "FunctionDeclaration") { - for (let name of exportsToRemove) { - var _declaration$id; - if (((_declaration$id = declaration.id) === null || _declaration$id === void 0 ? void 0 : _declaration$id.name) === name) { - shouldRemove = true; - removedExports.add(name); - } - } - } - if (shouldRemove) { - path.remove(); - } - } - }); - if (removedExports.size === 0) { - // No server-specific exports found so there's - // no need to remove unused references - return generateCode(); - } - let referencesRemovedInThisPass; - let sweepFunction = path => { - let identifier = getIdentifier(path); - if (identifier !== null && identifier !== void 0 && identifier.node && referencedIdentifiers.has(identifier) && !isIdentifierReferenced(identifier)) { - ++referencesRemovedInThisPass; - if (t__namespace.isAssignmentExpression(path.parentPath.node) || t__namespace.isVariableDeclarator(path.parentPath.node)) { - path.parentPath.remove(); - } else { - path.remove(); - } - } - }; - let sweepImport = path => { - let local = path.get("local"); - if (referencedIdentifiers.has(local) && !isIdentifierReferenced(local)) { - ++referencesRemovedInThisPass; - path.remove(); - if (path.parent.specifiers.length === 0) { - path.parentPath.remove(); - } - } - }; - - // Traverse again to remove unused references. This happens at least once, - // then repeats until no more references are removed. - do { - referencesRemovedInThisPass = 0; - traverse__default["default"](document, { - Program(path) { - path.scope.crawl(); - }, - // eslint-disable-next-line no-loop-func - VariableDeclarator(variablePath) { - if (variablePath.node.id.type === "Identifier") { - let local = variablePath.get("id"); - if (referencedIdentifiers.has(local) && !isIdentifierReferenced(local)) { - ++referencesRemovedInThisPass; - variablePath.remove(); - } - } else if (variablePath.node.id.type === "ObjectPattern") { - let pattern = variablePath.get("id"); - let beforeCount = referencesRemovedInThisPass; - let properties = pattern.get("properties"); - properties.forEach(property => { - let local = property.get(property.node.type === "ObjectProperty" ? "value" : property.node.type === "RestElement" ? "argument" : function () { - throw new Error("invariant"); - }()); - if (referencedIdentifiers.has(local) && !isIdentifierReferenced(local)) { - ++referencesRemovedInThisPass; - property.remove(); - } - }); - if (beforeCount !== referencesRemovedInThisPass && pattern.get("properties").length < 1) { - variablePath.remove(); - } - } else if (variablePath.node.id.type === "ArrayPattern") { - let pattern = variablePath.get("id"); - let beforeCount = referencesRemovedInThisPass; - let elements = pattern.get("elements"); - elements.forEach(e => { - var _e$node, _e$node2; - let local; - if (((_e$node = e.node) === null || _e$node === void 0 ? void 0 : _e$node.type) === "Identifier") { - local = e; - } else if (((_e$node2 = e.node) === null || _e$node2 === void 0 ? void 0 : _e$node2.type) === "RestElement") { - local = e.get("argument"); - } else { - return; - } - if (referencedIdentifiers.has(local) && !isIdentifierReferenced(local)) { - ++referencesRemovedInThisPass; - e.remove(); - } - }); - if (beforeCount !== referencesRemovedInThisPass && pattern.get("elements").length < 1) { - variablePath.remove(); - } - } - }, - FunctionDeclaration: sweepFunction, - FunctionExpression: sweepFunction, - ArrowFunctionExpression: sweepFunction, - ImportSpecifier: sweepImport, - ImportDefaultSpecifier: sweepImport, - ImportNamespaceSpecifier: sweepImport - }); - } while (referencesRemovedInThisPass); - return generateCode(); -}; - -exports.removeExports = removeExports; diff --git a/.yalc/@remix-run/dev/dist/vite/replace-import-specifier.js b/.yalc/@remix-run/dev/dist/vite/replace-import-specifier.js deleted file mode 100644 index b79e5ee..0000000 --- a/.yalc/@remix-run/dev/dist/vite/replace-import-specifier.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @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 parser = require('@babel/parser'); -require('@babel/types'); -var traverse = require('@babel/traverse'); -var generate = require('@babel/generator'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var traverse__default = /*#__PURE__*/_interopDefaultLegacy(traverse); -var generate__default = /*#__PURE__*/_interopDefaultLegacy(generate); - -const replaceImportSpecifier = ({ - code, - specifier, - replaceWith -}) => { - let ast = parser.parse(code, { - sourceType: "module" - }); - traverse__default["default"](ast, { - ImportDeclaration(path) { - if (path.node.source.value === specifier) { - path.node.source.value = replaceWith; - } - } - }); - return { - code: generate__default["default"](ast, { - retainLines: true - }).code, - map: null - }; -}; - -exports.replaceImportSpecifier = replaceImportSpecifier; diff --git a/.yalc/@remix-run/dev/dist/vite/static/refresh-utils.cjs b/.yalc/@remix-run/dev/dist/vite/static/refresh-utils.cjs deleted file mode 100644 index 8d98852..0000000 --- a/.yalc/@remix-run/dev/dist/vite/static/refresh-utils.cjs +++ /dev/null @@ -1,174 +0,0 @@ -// adapted from https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/src/refreshUtils.js -// This file gets injected into the browser as a part of the HMR runtime - -function debounce(fn, delay) { - let handle; - return () => { - clearTimeout(handle); - handle = setTimeout(fn, delay); - }; -} - -/* eslint-disable no-undef */ -const enqueueUpdate = debounce(async () => { - let manifest; - if (routeUpdates.size > 0) { - manifest = JSON.parse(JSON.stringify(__remixManifest)); - - for (let route of routeUpdates.values()) { - manifest.routes[route.id] = route; - - let imported = await __hmr_import(route.url + "?t=" + Date.now()); - let routeModule = { - ...imported, - // react-refresh takes care of updating these in-place, - // if we don't preserve existing values we'll loose state. - default: imported.default - ? window.__remixRouteModules[route.id]?.default ?? imported.default - : imported.default, - ErrorBoundary: imported.ErrorBoundary - ? window.__remixRouteModules[route.id]?.ErrorBoundary ?? - imported.ErrorBoundary - : imported.ErrorBoundary, - }; - window.__remixRouteModules[route.id] = routeModule; - } - - let needsRevalidation = new Set( - Array.from(routeUpdates.values()) - .filter((route) => route.hasLoader) - .map((route) => route.id) - ); - - let routes = __remixRouter.createRoutesForHMR( - needsRevalidation, - manifest.routes, - window.__remixRouteModules, - window.__remixContext.future - ); - __remixRouter._internalSetRoutes(routes); - routeUpdates.clear(); - } - - await revalidate(); - if (manifest) { - Object.assign(window.__remixManifest, manifest); - } - exports.performReactRefresh(); -}, 16); - -// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141 -// This allows to resister components not detected by SWC like styled component -function registerExportsForReactRefresh(filename, moduleExports) { - for (let key in moduleExports) { - if (key === "__esModule") continue; - let exportValue = moduleExports[key]; - if (exports.isLikelyComponentType(exportValue)) { - // 'export' is required to avoid key collision when renamed exports that - // shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116 - // The register function has an identity check to not register twice the same component, - // so this is safe to not used the same key here. - exports.register(exportValue, filename + " export " + key); - } - } -} - -function validateRefreshBoundaryAndEnqueueUpdate( - prevExports, - nextExports, - // non-component exports that are handled by the framework (e.g. `meta` and `links` for route modules) - acceptExports = [] -) { - if ( - !predicateOnExport( - prevExports, - (key) => key in nextExports || acceptExports.includes(key) - ) - ) { - return "Could not Fast Refresh (export removed)"; - } - if ( - !predicateOnExport( - nextExports, - (key) => key in prevExports || acceptExports.includes(key) - ) - ) { - return "Could not Fast Refresh (new export)"; - } - - let hasExports = false; - let allExportsAreHandledOrUnchanged = predicateOnExport( - nextExports, - (key, value) => { - hasExports = true; - // Remix can handle Remix-specific exports (e.g. `meta` and `links`) - if (acceptExports.includes(key)) return true; - // React Fast Refresh can handle component exports - if (exports.isLikelyComponentType(value)) return true; - // Unchanged exports are implicitly handled - return prevExports[key] === nextExports[key]; - } - ); - if (hasExports && allExportsAreHandledOrUnchanged) { - enqueueUpdate(); - } else { - return "Could not Fast Refresh. Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports"; - } -} - -function predicateOnExport(moduleExports, predicate) { - for (let key in moduleExports) { - if (key === "__esModule") continue; - let desc = Object.getOwnPropertyDescriptor(moduleExports, key); - if (desc && desc.get) return false; - if (!predicate(key, moduleExports[key])) return false; - } - return true; -} - -// Hides vite-ignored dynamic import so that Vite can skip analysis if no other -// dynamic import is present (https://github.com/vitejs/vite/pull/12732) -function __hmr_import(module) { - return import(/* @vite-ignore */ module); -} - -const routeUpdates = new Map(); - -async function revalidate() { - let { promise, resolve } = channel(); - let unsub = __remixRouter.subscribe((state) => { - if (state.revalidation === "idle") { - unsub(); - // Ensure RouterProvider setState has flushed before re-rendering - resolve(); - } - }); - window.__remixRevalidation = (window.__remixRevalidation || 0) + 1; - __remixRouter.revalidate(); - return promise; -} - -function channel() { - let resolve; - let reject; - - let promise = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - return { promise, resolve, reject }; -} - -import.meta.hot.on("remix:hmr", async ({ route }) => { - window.__remixClearCriticalCss(); - - if (route) { - routeUpdates.set(route.id, route); - } -}); - -exports.__hmr_import = __hmr_import; -exports.registerExportsForReactRefresh = registerExportsForReactRefresh; -exports.validateRefreshBoundaryAndEnqueueUpdate = - validateRefreshBoundaryAndEnqueueUpdate; -exports.enqueueUpdate = enqueueUpdate; diff --git a/.yalc/@remix-run/dev/dist/vite/styles.js b/.yalc/@remix-run/dev/dist/vite/styles.js deleted file mode 100644 index 3b44be7..0000000 --- a/.yalc/@remix-run/dev/dist/vite/styles.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @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 router = require('@remix-run/router'); - -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); - -// Style collection logic adapted from solid-start: https://github.com/solidjs/solid-start - -// Vite doesn't expose these so we just copy the list for now -// https://github.com/vitejs/vite/blob/d6bde8b03d433778aaed62afc2be0630c8131908/packages/vite/src/node/constants.ts#L49C23-L50 -const cssFileRegExp = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/; -// https://github.com/vitejs/vite/blob/d6bde8b03d433778aaed62afc2be0630c8131908/packages/vite/src/node/plugins/css.ts#L160 -const cssModulesRegExp = new RegExp(`\\.module${cssFileRegExp.source}`); -const isCssFile = file => cssFileRegExp.test(file); -const isCssModulesFile = file => cssModulesRegExp.test(file); -const getStylesForFiles = async (viteServer, cssModulesManifest, files) => { - let styles = {}; - let deps = new Set(); - try { - for (let file of files) { - let normalizedPath = path__namespace.resolve(file).replace(/\\/g, "/"); - let node = await viteServer.moduleGraph.getModuleById(normalizedPath); - if (!node) { - let absolutePath = path__namespace.resolve(file); - await viteServer.ssrLoadModule(absolutePath); - node = await viteServer.moduleGraph.getModuleByUrl(absolutePath); - if (!node) { - console.log(`Could not resolve module for file: ${file}`); - continue; - } - } - await findDeps(viteServer, node, deps); - } - } catch (e) { - console.error(e); - } - for (let dep of deps) { - if (dep.file && isCssFile(dep.file) && !dep.url.endsWith("?url") // Ignore styles that resolved as URLs, otherwise we'll end up injecting URLs into the style tag contents - ) { - try { - let css = isCssModulesFile(dep.file) ? cssModulesManifest[dep.file] : (await viteServer.ssrLoadModule(dep.url)).default; - if (css === undefined) { - throw new Error(); - } - styles[dep.url] = css; - } catch { - console.warn(`Could not load ${dep.file}`); - // this can happen with dynamically imported modules, I think - // because the Vite module graph doesn't distinguish between - // static and dynamic imports? TODO investigate, submit fix - } - } - } - - return Object.entries(styles).map(([fileName, css], i) => [`\n/* ${fileName - // Escape comment syntax in file paths - .replace(/\/\*/g, "/\\*").replace(/\*\//g, "*\\/")} */`, css]).flat().join("\n") || undefined; -}; -const findDeps = async (vite, node, deps) => { - // since `ssrTransformResult.deps` contains URLs instead of `ModuleNode`s, this process is asynchronous. - // instead of using `await`, we resolve all branches in parallel. - let branches = []; - async function addFromNode(node) { - if (!deps.has(node)) { - deps.add(node); - await findDeps(vite, node, deps); - } - } - async function addFromUrl(url) { - let node = await vite.moduleGraph.getModuleByUrl(url); - if (node) { - await addFromNode(node); - } - } - if (node.ssrTransformResult) { - if (node.ssrTransformResult.deps) { - node.ssrTransformResult.deps.forEach(url => branches.push(addFromUrl(url))); - } - } else { - node.importedModules.forEach(node => branches.push(addFromNode(node))); - } - await Promise.all(branches); -}; -const groupRoutesByParentId = manifest => { - let routes = {}; - Object.values(manifest).forEach(route => { - let parentId = route.parentId || ""; - if (!routes[parentId]) { - routes[parentId] = []; - } - routes[parentId].push(route); - }); - return routes; -}; - -// Create a map of routes by parentId to use recursively instead of -// repeatedly filtering the manifest. -const createRoutes = (manifest, parentId = "", routesByParentId = groupRoutesByParentId(manifest)) => { - return (routesByParentId[parentId] || []).map(route => ({ - ...route, - children: createRoutes(manifest, route.id, routesByParentId) - })); -}; -const getStylesForUrl = async (vite, config, cssModulesManifest, build, url) => { - var _matchRoutes; - if (url === undefined || url.includes("?_data=")) { - return undefined; - } - let routes = createRoutes(build.routes); - let appPath = path__namespace.relative(process.cwd(), config.appDirectory); - let documentRouteFiles = ((_matchRoutes = router.matchRoutes(routes, url)) === null || _matchRoutes === void 0 ? void 0 : _matchRoutes.map(match => path__namespace.join(appPath, config.routes[match.route.id].file))) ?? []; - let styles = await getStylesForFiles(vite, cssModulesManifest, documentRouteFiles); - return styles; -}; - -exports.getStylesForUrl = getStylesForUrl; -exports.isCssModulesFile = isCssModulesFile; diff --git a/.yalc/@remix-run/dev/dist/vite/vmod.js b/.yalc/@remix-run/dev/dist/vite/vmod.js deleted file mode 100644 index 41880e0..0000000 --- a/.yalc/@remix-run/dev/dist/vite/vmod.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @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 }); - -let id = name => `virtual:${name}`; -let resolve = id => `\0${id}`; -let url = id => `/@id/__x00__${id}`; - -exports.id = id; -exports.resolve = resolve; -exports.url = url; diff --git a/.yalc/@remix-run/dev/package.json b/.yalc/@remix-run/dev/package.json deleted file mode 100644 index 6ce9448..0000000 --- a/.yalc/@remix-run/dev/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "@remix-run/dev", - "version": "2.2.0", - "description": "Dev tools and CLI for Remix", - "homepage": "https://remix.run", - "bugs": { - "url": "https://github.com/remix-run/remix/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/remix-run/remix", - "directory": "packages/remix-dev" - }, - "license": "MIT", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "bin": { - "remix": "dist/cli.js" - }, - "dependencies": { - "@babel/core": "^7.21.8", - "@babel/generator": "^7.21.5", - "@babel/parser": "^7.21.8", - "@babel/plugin-syntax-decorators": "^7.22.10", - "@babel/plugin-syntax-jsx": "^7.21.4", - "@babel/preset-typescript": "^7.21.5", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.22.5", - "@mdx-js/mdx": "^2.3.0", - "@npmcli/package-json": "^4.0.1", - "@remix-run/node": "2.2.0", - "@remix-run/router": "1.11.0", - "@remix-run/server-runtime": "2.2.0", - "@types/mdx": "^2.0.5", - "@vanilla-extract/integration": "^6.2.0", - "arg": "^5.0.1", - "cacache": "^17.1.3", - "chalk": "^4.1.2", - "chokidar": "^3.5.1", - "cross-spawn": "^7.0.3", - "dotenv": "^16.0.0", - "es-module-lexer": "^1.3.1", - "esbuild": "0.17.6", - "esbuild-plugins-node-modules-polyfill": "^1.6.0", - "execa": "5.1.1", - "exit-hook": "2.2.1", - "express": "^4.17.1", - "fs-extra": "^10.0.0", - "get-port": "^5.1.1", - "gunzip-maybe": "^1.4.2", - "jsesc": "3.0.2", - "json5": "^2.2.2", - "lodash": "^4.17.21", - "lodash.debounce": "^4.0.8", - "minimatch": "^9.0.0", - "node-fetch": "^2.6.9", - "ora": "^5.4.1", - "parse-multipart-data": "^1.5.0", - "picocolors": "^1.0.0", - "picomatch": "^2.3.1", - "pidtree": "^0.6.0", - "postcss": "^8.4.19", - "postcss-discard-duplicates": "^5.1.0", - "postcss-load-config": "^4.0.1", - "postcss-modules": "^6.0.0", - "prettier": "^2.7.1", - "pretty-ms": "^7.0.1", - "react-refresh": "^0.14.0", - "remark-frontmatter": "4.0.1", - "remark-mdx-frontmatter": "^1.0.1", - "semver": "^7.3.7", - "set-cookie-parser": "^2.6.0", - "tar-fs": "^2.1.1", - "tsconfig-paths": "^4.0.0", - "undici": "^5.22.1", - "ws": "^7.4.5" - }, - "peerDependencies": { - "@remix-run/serve": "^2.2.0", - "typescript": "^5.1.0", - "vite": "^4.4.9" - }, - "peerDependenciesMeta": { - "@remix-run/serve": { - "optional": true - }, - "typescript": { - "optional": true - }, - "vite": { - "optional": true - } - }, - "engines": { - "node": ">=18.0.0" - }, - "files": [ - "dist/", - "compiler/shims/", - "server-build.js", - "server-build.d.ts", - "CHANGELOG.md", - "LICENSE.md", - "README.md" - ], - "yalcSig": "dbca81764aea04533d6247b122d1500e" -} diff --git a/.yalc/@remix-run/dev/server-build.js b/.yalc/@remix-run/dev/server-build.js deleted file mode 100644 index 0935c70..0000000 --- a/.yalc/@remix-run/dev/server-build.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/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'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -throw new Error("@remix-run/dev/server-build is not meant to be used directly from node_modules." + " It exists to provide type definitions for a virtual module provided" + " by the Remix compiler at build time."); -const mode = undefined; -const assets = undefined; -const entry = undefined; -const routes = undefined; -const future = undefined; -const publicPath = undefined; -// prettier-ignore -const assetsBuildDirectory = undefined; - -exports.assets = assets; -exports.assetsBuildDirectory = assetsBuildDirectory; -exports.entry = entry; -exports.future = future; -exports.mode = mode; -exports.publicPath = publicPath; -exports.routes = routes; diff --git a/.yalc/@remix-run/dev/yalc.sig b/.yalc/@remix-run/dev/yalc.sig deleted file mode 100644 index e5cd87e..0000000 --- a/.yalc/@remix-run/dev/yalc.sig +++ /dev/null @@ -1 +0,0 @@ -dbca81764aea04533d6247b122d1500e \ No newline at end of file diff --git a/examples/remix-vite/api/trpc/index.ts b/examples/remix-vite/api/trpc/index.ts index 65ebf14..578c90b 100644 --- a/examples/remix-vite/api/trpc/index.ts +++ b/examples/remix-vite/api/trpc/index.ts @@ -1,6 +1,6 @@ import { articlesRouter } from './articles.ts'; import { authRouter } from './auth.ts'; -import { router } from './trpc.ts'; +import { createCallerFactory, router } from './trpc.ts'; export type AppRouter = typeof appRouter; @@ -8,3 +8,5 @@ export const appRouter = router({ auth: authRouter, articles: articlesRouter, }); + +export const createCaller = createCallerFactory(appRouter); diff --git a/examples/remix-vite/api/trpc/trpc.ts b/examples/remix-vite/api/trpc/trpc.ts index d7170be..7a8e71d 100644 --- a/examples/remix-vite/api/trpc/trpc.ts +++ b/examples/remix-vite/api/trpc/trpc.ts @@ -18,6 +18,8 @@ const t = initTRPC.context().create({ export const router = t.router; +export const createCallerFactory = t.createCallerFactory; + export const publicProcedure = t.procedure; const isAuthed = t.middleware(({ ctx, next }) => { diff --git a/examples/remix-vite/app/app.ts b/examples/remix-vite/app/app.ts index 2eb1666..9a63ee6 100644 --- a/examples/remix-vite/app/app.ts +++ b/examples/remix-vite/app/app.ts @@ -20,7 +20,6 @@ const { clientHandler, serverHandler, ctx } = createApp({ queryClientConfig: { defaultOptions: { queries: { - suspense: true, retry: false, staleTime: 1000 * 60, refetchOnReconnect: true, diff --git a/examples/remix-vite/app/entry.server.tsx b/examples/remix-vite/app/entry.server.tsx index b8f6e4a..41f0d1c 100644 --- a/examples/remix-vite/app/entry.server.tsx +++ b/examples/remix-vite/app/entry.server.tsx @@ -1,7 +1,7 @@ import type { AppLoadContext, EntryContext } from '@remix-run/server-runtime'; import { createReqCtx } from '~api/middleware/context.ts'; -import { appRouter } from '~api/trpc/index.ts'; +import { createCaller } from '~api/trpc/index.ts'; import { serverHandler } from './app.ts'; @@ -22,7 +22,7 @@ export default async function handleRequest( loadContext, // used by @ssrx/plugin-trpc-react - trpcCaller: appRouter.createCaller(reqCtx), + trpcCaller: createCaller(reqCtx), }, }); diff --git a/examples/remix-vite/app/root.tsx b/examples/remix-vite/app/root.tsx index 7020861..7db93aa 100644 --- a/examples/remix-vite/app/root.tsx +++ b/examples/remix-vite/app/root.tsx @@ -48,7 +48,7 @@ const AppContainer = () => { - Articles 2 + Articles diff --git a/examples/remix-vite/app/routes/_index.tsx b/examples/remix-vite/app/routes/_index.tsx index c775fa2..5ea515e 100644 --- a/examples/remix-vite/app/routes/_index.tsx +++ b/examples/remix-vite/app/routes/_index.tsx @@ -1,30 +1,24 @@ import type { ServerRuntimeMetaFunction } from '@remix-run/server-runtime'; export const meta: ServerRuntimeMetaFunction = () => { - return [{ title: 'New Remix App' }, { name: 'description', content: 'Welcome to Remix!' }]; + return [{ title: 'Remix Vite' }]; }; export default function Index() { return ( -
-

Welcome to Remix

- +
+

Remix Vite Example

+ +

+ This example leverages Remix's new Vite plugin. It makes it simple to use `@tanstack/query` + `trpc` in an + isomorphic way, alongside all of the great functionality Remix already offers. Note, there is some simulated + latency throughout the example to help see loading screens etc. +

+ +

+ Click the login button in the top right to login with preset credentials. Then, click the articles link in the + top left. +

); } diff --git a/examples/streaming-kitchen-sink/server/index.ts b/examples/streaming-kitchen-sink/server/index.ts index 97857a6..f4cf5d7 100644 --- a/examples/streaming-kitchen-sink/server/index.ts +++ b/examples/streaming-kitchen-sink/server/index.ts @@ -5,7 +5,7 @@ import { Hono } from 'hono'; import { serverHandler } from '~app'; import { type ReqCtx, reqCtxMiddleware } from '~server/middleware/context.ts'; import { trpcServer } from '~server/middleware/trpc.ts'; -import { appRouter } from '~server/trpc/index.ts'; +import { appRouter, createCaller } from '~server/trpc/index.ts'; import { deleteCookie, setCookie } from '~server/utils/cookies.ts'; type HonoEnv = { Variables: ReqCtx }; @@ -58,7 +58,7 @@ server req: c.req.raw, meta: { // used by @ssrx/plugin-trpc-react - trpcCaller: appRouter.createCaller(c.var), + trpcCaller: createCaller(c.var), }, }); diff --git a/examples/streaming-kitchen-sink/server/trpc/index.ts b/examples/streaming-kitchen-sink/server/trpc/index.ts index 65ebf14..578c90b 100644 --- a/examples/streaming-kitchen-sink/server/trpc/index.ts +++ b/examples/streaming-kitchen-sink/server/trpc/index.ts @@ -1,6 +1,6 @@ import { articlesRouter } from './articles.ts'; import { authRouter } from './auth.ts'; -import { router } from './trpc.ts'; +import { createCallerFactory, router } from './trpc.ts'; export type AppRouter = typeof appRouter; @@ -8,3 +8,5 @@ export const appRouter = router({ auth: authRouter, articles: articlesRouter, }); + +export const createCaller = createCallerFactory(appRouter); diff --git a/examples/streaming-kitchen-sink/server/trpc/trpc.ts b/examples/streaming-kitchen-sink/server/trpc/trpc.ts index e377bb9..bbacb21 100644 --- a/examples/streaming-kitchen-sink/server/trpc/trpc.ts +++ b/examples/streaming-kitchen-sink/server/trpc/trpc.ts @@ -18,6 +18,8 @@ const t = initTRPC.context().create({ export const router = t.router; +export const createCallerFactory = t.createCallerFactory; + export const publicProcedure = t.procedure; const isAuthed = t.middleware(({ ctx, next }) => { diff --git a/package.json b/package.json index 992bbd7..85b921c 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@ssrx/remix": "workspace:*", "@ssrx/renderer": "workspace:*", "@ssrx/solid": "workspace:*", - "@ssrx/vite": "workspace:*", - "@remix-run/dev": "file:.yalc/@remix-run/dev" + "@ssrx/trpc-react-query": "workspace:*", + "@ssrx/vite": "workspace:*" }, "devDependencies": { "@changesets/changelog-github": "0.5.0", diff --git a/yalc.lock b/yalc.lock deleted file mode 100644 index 3adebfe..0000000 --- a/yalc.lock +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": "v1", - "packages": { - "@remix-run/dev": { - "signature": "dbca81764aea04533d6247b122d1500e", - "pure": true - } - } -} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ffac37e..5b106bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1322,13 +1322,6 @@ __metadata: languageName: node linkType: hard -"@fastify/busboy@npm:^2.0.0": - version: 2.1.0 - resolution: "@fastify/busboy@npm:2.1.0" - checksum: abe055fc33e214063908e6382279906e825db0b14eb188276dcb2832a589f6d3bc22dab772dbb9ce0f65bdbde8e4b807b179adbc91f505eb1c36916fbf27d217 - languageName: node - linkType: hard - "@floating-ui/core@npm:^1.4.2": version: 1.5.2 resolution: "@floating-ui/core@npm:1.5.2" @@ -2145,9 +2138,9 @@ __metadata: languageName: node linkType: hard -"@remix-run/dev@file:.yalc/@remix-run/dev::locator=%40ssrx%2Froot%40workspace%3A.": - version: 2.2.0 - resolution: "@remix-run/dev@file:.yalc/@remix-run/dev#.yalc/@remix-run/dev::hash=f0ed50&locator=%40ssrx%2Froot%40workspace%3A." +"@remix-run/dev@npm:2.4.1": + version: 2.4.1 + resolution: "@remix-run/dev@npm:2.4.1" dependencies: "@babel/core": "npm:^7.21.8" "@babel/generator": "npm:^7.21.5" @@ -2159,9 +2152,9 @@ __metadata: "@babel/types": "npm:^7.22.5" "@mdx-js/mdx": "npm:^2.3.0" "@npmcli/package-json": "npm:^4.0.1" - "@remix-run/node": "npm:2.2.0" - "@remix-run/router": "npm:1.11.0" - "@remix-run/server-runtime": "npm:2.2.0" + "@remix-run/node": "npm:2.4.1" + "@remix-run/router": "npm:1.14.1" + "@remix-run/server-runtime": "npm:2.4.1" "@types/mdx": "npm:^2.0.5" "@vanilla-extract/integration": "npm:^6.2.0" arg: "npm:^5.0.1" @@ -2184,9 +2177,7 @@ __metadata: lodash: "npm:^4.17.21" lodash.debounce: "npm:^4.0.8" minimatch: "npm:^9.0.0" - node-fetch: "npm:^2.6.9" ora: "npm:^5.4.1" - parse-multipart-data: "npm:^1.5.0" picocolors: "npm:^1.0.0" picomatch: "npm:^2.3.1" pidtree: "npm:^0.6.0" @@ -2203,12 +2194,11 @@ __metadata: set-cookie-parser: "npm:^2.6.0" tar-fs: "npm:^2.1.1" tsconfig-paths: "npm:^4.0.0" - undici: "npm:^5.22.1" ws: "npm:^7.4.5" peerDependencies: - "@remix-run/serve": ^2.2.0 + "@remix-run/serve": ^2.4.1 typescript: ^5.1.0 - vite: ^4.4.9 + vite: ^5.0.0 peerDependenciesMeta: "@remix-run/serve": optional: true @@ -2218,7 +2208,7 @@ __metadata: optional: true bin: remix: dist/cli.js - checksum: 813bf487d0b2721936c075d7b47789156efb19a9d09fbaea88af5b6d675793f3249a18c1d629df5787ad7052ec0657836f065b32adb669b30af71c0c7568252d + checksum: 7dc64c819529cd0069f902cd9ad81bacb8242433f421a5ec8115a6f88fcad3cf045aabebfb8dbd6cd65e13d54c8a72a16c29d2648127d02bce6c2478ab8f689c languageName: node linkType: hard @@ -2237,27 +2227,6 @@ __metadata: languageName: node linkType: hard -"@remix-run/node@npm:2.2.0": - version: 2.2.0 - resolution: "@remix-run/node@npm:2.2.0" - dependencies: - "@remix-run/server-runtime": "npm:2.2.0" - "@remix-run/web-fetch": "npm:^4.4.1" - "@remix-run/web-file": "npm:^3.1.0" - "@remix-run/web-stream": "npm:^1.1.0" - "@web3-storage/multipart-parser": "npm:^1.0.0" - cookie-signature: "npm:^1.1.0" - source-map-support: "npm:^0.5.21" - stream-slice: "npm:^0.1.2" - peerDependencies: - typescript: ^5.1.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 292da682a44b3e47523c02db58dbe0973a2674a62ae1ee55c9426d46ddd8be8980973928306e2ad2bc7a17344c014dfaa839decac322c33fd42fe038b3b6f29e - languageName: node - linkType: hard - "@remix-run/node@npm:2.4.1": version: 2.4.1 resolution: "@remix-run/node@npm:2.4.1" @@ -2298,13 +2267,6 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.11.0": - version: 1.11.0 - resolution: "@remix-run/router@npm:1.11.0" - checksum: 1e99effe5d39d8b14b34a158fdd0e6878416e813d160a46124e02859b20a7ff11a12d5dffdff004ce1fc915cdf80dc590c44695192beac1973c1be3a1ba61cd8 - languageName: node - linkType: hard - "@remix-run/router@npm:1.14.1": version: 1.14.1 resolution: "@remix-run/router@npm:1.14.1" @@ -2330,25 +2292,6 @@ __metadata: languageName: node linkType: hard -"@remix-run/server-runtime@npm:2.2.0": - version: 2.2.0 - resolution: "@remix-run/server-runtime@npm:2.2.0" - dependencies: - "@remix-run/router": "npm:1.11.0" - "@types/cookie": "npm:^0.4.1" - "@web3-storage/multipart-parser": "npm:^1.0.0" - cookie: "npm:^0.4.1" - set-cookie-parser: "npm:^2.4.8" - source-map: "npm:^0.7.3" - peerDependencies: - typescript: ^5.1.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: fbd740c6668dc2d9c64f734586448c0b5f07acb9eef872797522fc282135ca2e65a09bdad78e1bc1a6f25529f9d3de236c418c545ecc71673d42a04349f7ff27 - languageName: node - linkType: hard - "@remix-run/server-runtime@npm:2.4.1": version: 2.4.1 resolution: "@remix-run/server-runtime@npm:2.4.1" @@ -2378,7 +2321,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/web-fetch@npm:^4.4.1, @remix-run/web-fetch@npm:^4.4.2": +"@remix-run/web-fetch@npm:^4.4.2": version: 4.4.2 resolution: "@remix-run/web-fetch@npm:4.4.2" dependencies: @@ -2723,7 +2666,7 @@ __metadata: languageName: unknown linkType: soft -"@ssrx/trpc-react-query@npm:*, @ssrx/trpc-react-query@workspace:packages/trpc-react-query": +"@ssrx/trpc-react-query@workspace:*, @ssrx/trpc-react-query@workspace:packages/trpc-react-query": version: 0.0.0-use.local resolution: "@ssrx/trpc-react-query@workspace:packages/trpc-react-query" dependencies: @@ -2915,13 +2858,6 @@ __metadata: languageName: node linkType: hard -"@types/cookie@npm:^0.4.1": - version: 0.4.1 - resolution: "@types/cookie@npm:0.4.1" - checksum: b4bbdfb07d15056f118afcc6232ad006094ec65defa585b085f02242cff8a0bfb104a6b54ab366498cff4c4eb7ed1bd69986d1219c11c6aae5abd3ae059edf4c - languageName: node - linkType: hard - "@types/cookie@npm:^0.5.3": version: 0.5.4 resolution: "@types/cookie@npm:0.5.4" @@ -4679,13 +4615,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.4.1": - version: 0.4.2 - resolution: "cookie@npm:0.4.2" - checksum: e2b0be16f59835785be50f5dfe076c26e81ab49c988a6290144444d0dfdf8192e82b0aa1857734b292567795e7af3f2c951d82e5036a2aacb15cd4a6681b5d49 - languageName: node - linkType: hard - "cookie@npm:^0.6.0": version: 0.6.0 resolution: "cookie@npm:0.6.0" @@ -9502,7 +9431,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.5.0, node-fetch@npm:^2.6.9": +"node-fetch@npm:^2.5.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -10112,13 +10041,6 @@ __metadata: languageName: node linkType: hard -"parse-multipart-data@npm:^1.5.0": - version: 1.5.0 - resolution: "parse-multipart-data@npm:1.5.0" - checksum: 659357a01dab36cfaa9c1b0e099df57fe7af0d86690b46cdfc5b1e16555fbe971ef5b2278c68b686b74a187450bc7c58de72d805a873dad9fdbec681f465fa73 - languageName: node - linkType: hard - "parseurl@npm:~1.3.3": version: 1.3.3 resolution: "parseurl@npm:1.3.3" @@ -12834,15 +12756,6 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.22.1": - version: 5.28.2 - resolution: "undici@npm:5.28.2" - dependencies: - "@fastify/busboy": "npm:^2.0.0" - checksum: 5b2f149b549abdf3df142e9e6bc2a3a618588d4a4a9cb096288a81f1e44580c87e954f23c7ba4c411966df5a009b527be8579e67f902c66b22ad85f6e84d9089 - languageName: node - linkType: hard - "unhead@npm:~1.8.9": version: 1.8.9 resolution: "unhead@npm:1.8.9"