diff --git a/app/routes/docs.main.($slug).ts b/app/routes/docs.main.($slug).ts new file mode 100644 index 0000000..40b1dc1 --- /dev/null +++ b/app/routes/docs.main.($slug).ts @@ -0,0 +1,9 @@ +import { LoaderFunctionArgs, redirect } from "@remix-run/node"; + +export const loader = ({ params }: LoaderFunctionArgs) => { + if (!params.slug) { + return redirect('/docs/latest'); + } + + return redirect(`/docs/latest/${params.slug}`); +}; diff --git a/app/routes/docs.next.($slug).ts b/app/routes/docs.next.($slug).ts new file mode 100644 index 0000000..fd77510 --- /dev/null +++ b/app/routes/docs.next.($slug).ts @@ -0,0 +1,9 @@ +import { LoaderFunctionArgs, redirect } from "@remix-run/node"; + +export const loader = ({ params }: LoaderFunctionArgs) => { + if (!params.slug) { + return redirect('/docs/dev'); + } + + return redirect(`/docs/dev/${params.slug}`); +}; diff --git a/posts/next/apis/default-fetch-handler.mdx b/posts/dev/apis/default-fetch-handler.mdx similarity index 100% rename from posts/next/apis/default-fetch-handler.mdx rename to posts/dev/apis/default-fetch-handler.mdx diff --git a/posts/next/apis/error-handler.mdx b/posts/dev/apis/error-handler.mdx similarity index 100% rename from posts/next/apis/error-handler.mdx rename to posts/dev/apis/error-handler.mdx diff --git a/posts/next/apis/get-load-context.mdx b/posts/dev/apis/get-load-context.mdx similarity index 100% rename from posts/next/apis/get-load-context.mdx rename to posts/dev/apis/get-load-context.mdx diff --git a/posts/next/apis/index.md b/posts/dev/apis/index.md similarity index 100% rename from posts/next/apis/index.md rename to posts/dev/apis/index.md diff --git a/posts/next/apis/worker-action.mdx b/posts/dev/apis/worker-action.mdx similarity index 100% rename from posts/next/apis/worker-action.mdx rename to posts/dev/apis/worker-action.mdx diff --git a/posts/next/apis/worker-loader.mdx b/posts/dev/apis/worker-loader.mdx similarity index 100% rename from posts/next/apis/worker-loader.mdx rename to posts/dev/apis/worker-loader.mdx diff --git a/posts/next/discussion/index.md b/posts/dev/discussion/index.md similarity index 100% rename from posts/next/discussion/index.md rename to posts/dev/discussion/index.md diff --git a/posts/next/discussion/pwa-vs-sw.mdx b/posts/dev/discussion/pwa-vs-sw.mdx similarity index 100% rename from posts/next/discussion/pwa-vs-sw.mdx rename to posts/dev/discussion/pwa-vs-sw.mdx diff --git a/posts/next/discussion/runtimes.mdx b/posts/dev/discussion/runtimes.mdx similarity index 100% rename from posts/next/discussion/runtimes.mdx rename to posts/dev/discussion/runtimes.mdx diff --git a/posts/next/discussion/technical-explanation.mdx b/posts/dev/discussion/technical-explanation.mdx similarity index 100% rename from posts/next/discussion/technical-explanation.mdx rename to posts/dev/discussion/technical-explanation.mdx diff --git a/posts/next/getting-started/changelog.mdx b/posts/dev/getting-started/changelog.mdx similarity index 100% rename from posts/next/getting-started/changelog.mdx rename to posts/dev/getting-started/changelog.mdx diff --git a/posts/next/getting-started/community.mdx b/posts/dev/getting-started/community.mdx similarity index 100% rename from posts/next/getting-started/community.mdx rename to posts/dev/getting-started/community.mdx diff --git a/posts/main/started/index.md b/posts/dev/getting-started/index.md similarity index 100% rename from posts/main/started/index.md rename to posts/dev/getting-started/index.md diff --git a/posts/next/getting-started/quick-start.mdx b/posts/dev/getting-started/quick-start.mdx similarity index 100% rename from posts/next/getting-started/quick-start.mdx rename to posts/dev/getting-started/quick-start.mdx diff --git a/posts/next/getting-started/tutorial.mdx b/posts/dev/getting-started/tutorial.mdx similarity index 100% rename from posts/next/getting-started/tutorial.mdx rename to posts/dev/getting-started/tutorial.mdx diff --git a/posts/next/getting-started/v5.mdx b/posts/dev/getting-started/v5.mdx similarity index 100% rename from posts/next/getting-started/v5.mdx rename to posts/dev/getting-started/v5.mdx diff --git a/posts/next/guides/background-sync.mdx b/posts/dev/guides/background-sync.mdx similarity index 100% rename from posts/next/guides/background-sync.mdx rename to posts/dev/guides/background-sync.mdx diff --git a/posts/main/guides/browser-support.mdx b/posts/dev/guides/browser-support.mdx similarity index 100% rename from posts/main/guides/browser-support.mdx rename to posts/dev/guides/browser-support.mdx diff --git a/posts/next/guides/cli.mdx b/posts/dev/guides/cli.mdx similarity index 100% rename from posts/next/guides/cli.mdx rename to posts/dev/guides/cli.mdx diff --git a/posts/next/guides/contributing.mdx b/posts/dev/guides/contributing.mdx similarity index 100% rename from posts/next/guides/contributing.mdx rename to posts/dev/guides/contributing.mdx diff --git a/posts/next/guides/deployment.mdx b/posts/dev/guides/deployment.mdx similarity index 100% rename from posts/next/guides/deployment.mdx rename to posts/dev/guides/deployment.mdx diff --git a/posts/next/guides/enhanced-cache.mdx b/posts/dev/guides/enhanced-cache.mdx similarity index 100% rename from posts/next/guides/enhanced-cache.mdx rename to posts/dev/guides/enhanced-cache.mdx diff --git a/posts/dev/guides/env.mdx b/posts/dev/guides/env.mdx new file mode 100644 index 0000000..af8293c --- /dev/null +++ b/posts/dev/guides/env.mdx @@ -0,0 +1,37 @@ +--- +title: Environment Variables +description: "Environment variables are a way to store app state and config data outside of your codebase. A guide to access them safely within Remix PWA" +alternateTitle: Environment Variables +toc: false +--- + +Remix PWA does not do anything to or with environment variables (mostly). In Remix PWA, the `process` object is not available (as service workers run in the client), and as such, accessing them directly is not possible. + +However, Remix PWA isn't unaware of some of these variables. The main and only one being `NODE_ENV`, this variable is used to determine the state for which the service worker is bundled. As a `production` value will bundle the service worker with optimizations and less exposed stuffs (like `Logger`s), while a `development` value will bundle the service worker with full utilities to help you debug and develop. + +You can also utilise `process.env.NODE_ENV` (in that order) within your service worker as Remix PWA would handle substituting the value for you at compilation time. + +## Custom Variables + +Remix PWA now allows for injecting custom variables via the `buildVariables` option in the Vite plugin configuration. This allows you to inject variables that are accessible within the service worker. + +```ts +// vite.config.ts +export default defineConfig({ + plugins: [ + remixPWA({ + buildVariables: { + 'process.env.PUBLIC_KEY': 'my-public-key', + // can also be in another format + 'myVery_PuBlick3y': 'my-public-key-2', + }, + }), + ], +}); + +// entry.worker.ts +console.log(process.env.PUBLIC_KEY); // my-public-key +console.log(process.env.myVery_PuBlick3y); // my-public-key-2 + +console.log(process.env); // logs all the variables as an object +``` diff --git a/posts/next/guides/gotchas.mdx b/posts/dev/guides/gotchas.mdx similarity index 100% rename from posts/next/guides/gotchas.mdx rename to posts/dev/guides/gotchas.mdx diff --git a/posts/next/guides/index.md b/posts/dev/guides/index.md similarity index 100% rename from posts/next/guides/index.md rename to posts/dev/guides/index.md diff --git a/posts/next/guides/messaging.mdx b/posts/dev/guides/messaging.mdx similarity index 100% rename from posts/next/guides/messaging.mdx rename to posts/dev/guides/messaging.mdx diff --git a/posts/next/guides/push-api.mdx b/posts/dev/guides/push-api.mdx similarity index 100% rename from posts/next/guides/push-api.mdx rename to posts/dev/guides/push-api.mdx diff --git a/posts/next/guides/single-fetch.mdx b/posts/dev/guides/single-fetch.mdx similarity index 100% rename from posts/next/guides/single-fetch.mdx rename to posts/dev/guides/single-fetch.mdx diff --git a/posts/next/guides/spa.mdx b/posts/dev/guides/spa.mdx similarity index 100% rename from posts/next/guides/spa.mdx rename to posts/dev/guides/spa.mdx diff --git a/posts/next/guides/versioning.mdx b/posts/dev/guides/versioning.mdx similarity index 100% rename from posts/next/guides/versioning.mdx rename to posts/dev/guides/versioning.mdx diff --git a/posts/dev/guides/web-manifest.mdx b/posts/dev/guides/web-manifest.mdx new file mode 100644 index 0000000..4e0c892 --- /dev/null +++ b/posts/dev/guides/web-manifest.mdx @@ -0,0 +1,52 @@ +--- +title: Web Manifest +description: "Web Manifests are the heart of PWAs. Explore how to create a Web Manifest for your Remix PWA in this guide." +alternateTitle: Web Manifest +--- + +Web Manifests in Remix PWA are quite a trifle affair really. They are the heart of PWAs, and they are what makes your app installable on devices. + +## What is a Web Manifest? + +A Web Manifest is a JSON file that provides information about your web app. It tells the browser about your app's name, description, icon, and other details. It is what the browser uses to install your app on a device. + +## Creating a Web Manifest + +Creating aweb manifest can be done manually by creating a JSON file within the `public` directory, but why the hassle? Using Remix PWA cli, you can now generate a Web Manifest for your app with a single command. + +To generate a Web Manifest for your Remix PWA app, run the following command: + +```bash +npx remix-pwa manifest +``` + +This command will generate a basic web manifest resource route within your application at `routes/manifest[.webmanifest].ts`. It comes with typings automatically, to generate a JavaScript file instead of TypeScript, you can pass the `--js` flag to the command. Note that you can customise the file destination by passing the `--dest` flag. Check out the CLI guide for more. + +## Customising the Web Manifest + +The generated Web Manifest is quite basic and actually missing one important thing. Icons. As `remix-pwa` no longer ships with placeholder icons, you would need to source and register them in your web manifest loader, no worries though, the typings are there to help you out. As well as any further customisation you might want to do like `screenshots`, `share_target`, `orientation` etc. + +## Registering the Web Manifest + +Remix PWA also comes shipped with a `ManifestLink` component that is a shorthand for registering the Web Manifest in your app. You can use it like so: + +```tsx {{filename:'root.tsx'}} +import { ManifestLink } from '@remix-pwa/manifest/manifest-link'; + +export default function App() { + return ( + + + {/* Within your tag */} + + + + {/* Rest of the Remix application */} + + ); +} +``` + +> Make sure to use above Remix's `` component. + +And that's it! You now have a Web Manifest for your Remix PWA app. 🎉 diff --git a/posts/next/hooks-components/index.md b/posts/dev/hooks-components/index.md similarity index 100% rename from posts/next/hooks-components/index.md rename to posts/dev/hooks-components/index.md diff --git a/posts/next/hooks-components/install-pwa-globals.mdx b/posts/dev/hooks-components/install-pwa-globals.mdx similarity index 100% rename from posts/next/hooks-components/install-pwa-globals.mdx rename to posts/dev/hooks-components/install-pwa-globals.mdx diff --git a/posts/next/hooks-components/manifest-link.mdx b/posts/dev/hooks-components/manifest-link.mdx similarity index 100% rename from posts/next/hooks-components/manifest-link.mdx rename to posts/dev/hooks-components/manifest-link.mdx diff --git a/posts/next/hooks-components/pwa-scripts.mdx b/posts/dev/hooks-components/pwa-scripts.mdx similarity index 100% rename from posts/next/hooks-components/pwa-scripts.mdx rename to posts/dev/hooks-components/pwa-scripts.mdx diff --git a/posts/next/hooks-components/use-badge-api.mdx b/posts/dev/hooks-components/use-badge-api.mdx similarity index 100% rename from posts/next/hooks-components/use-badge-api.mdx rename to posts/dev/hooks-components/use-badge-api.mdx diff --git a/posts/next/hooks-components/use-battery-manager.mdx b/posts/dev/hooks-components/use-battery-manager.mdx similarity index 100% rename from posts/next/hooks-components/use-battery-manager.mdx rename to posts/dev/hooks-components/use-battery-manager.mdx diff --git a/posts/next/hooks-components/use-network-connectivity.mdx b/posts/dev/hooks-components/use-network-connectivity.mdx similarity index 100% rename from posts/next/hooks-components/use-network-connectivity.mdx rename to posts/dev/hooks-components/use-network-connectivity.mdx diff --git a/posts/next/hooks-components/use-permission.mdx b/posts/dev/hooks-components/use-permission.mdx similarity index 100% rename from posts/next/hooks-components/use-permission.mdx rename to posts/dev/hooks-components/use-permission.mdx diff --git a/posts/next/hooks-components/use-push.mdx b/posts/dev/hooks-components/use-push.mdx similarity index 100% rename from posts/next/hooks-components/use-push.mdx rename to posts/dev/hooks-components/use-push.mdx diff --git a/posts/next/hooks-components/use-pwa-manager.mdx b/posts/dev/hooks-components/use-pwa-manager.mdx similarity index 100% rename from posts/next/hooks-components/use-pwa-manager.mdx rename to posts/dev/hooks-components/use-pwa-manager.mdx diff --git a/posts/next/metadata.json b/posts/dev/metadata.json similarity index 99% rename from posts/next/metadata.json rename to posts/dev/metadata.json index 57694e6..b63c620 100644 --- a/posts/next/metadata.json +++ b/posts/dev/metadata.json @@ -268,7 +268,7 @@ "title": "Logger", "alternateTitle": "Logger", "description": "Logger is a logging utility build for better looking logs in the console.", - "stub": true, + "stub": false, "section": "Utilities", "slug": "logger" }, @@ -300,7 +300,7 @@ "title": "vite.config.ts", "alternateTitle": "vite.config.ts", "description": "Remix PWA Vite plugin configurations", - "stub": true, + "stub": false, "section": "Utilities", "slug": "vite-config" }, @@ -357,7 +357,7 @@ "title": "Environment Variables", "alternateTitle": "Environment Variables", "description": "Environment variables are a way to store app state and config data outside of your codebase. A guide to access them safely within Remix PWA", - "stub": true, + "stub": false, "section": "Guides", "slug": "env" }, @@ -413,7 +413,7 @@ "title": "Web Manifest", "alternateTitle": "Web Manifest", "description": "Web Manifests are the heart of PWAs. Explore how to create a Web Manifest for your Remix PWA in this guide.", - "stub": true, + "stub": false, "section": "Guides", "slug": "web-manifest" } diff --git a/posts/next/utils/cache-api.mdx b/posts/dev/utils/cache-api.mdx similarity index 100% rename from posts/next/utils/cache-api.mdx rename to posts/dev/utils/cache-api.mdx diff --git a/posts/main/utils/defer.mdx b/posts/dev/utils/defer.mdx similarity index 100% rename from posts/main/utils/defer.mdx rename to posts/dev/utils/defer.mdx diff --git a/posts/next/utils/index.md b/posts/dev/utils/index.md similarity index 100% rename from posts/next/utils/index.md rename to posts/dev/utils/index.md diff --git a/posts/main/utils/json.mdx b/posts/dev/utils/json.mdx similarity index 100% rename from posts/main/utils/json.mdx rename to posts/dev/utils/json.mdx diff --git a/posts/dev/utils/logger.mdx b/posts/dev/utils/logger.mdx new file mode 100644 index 0000000..e373271 --- /dev/null +++ b/posts/dev/utils/logger.mdx @@ -0,0 +1,107 @@ +--- +title: Logger +description: "Logger is a logging utility build for better looking logs in the console." +alternateTitle: Logger +--- + +`logger` is a `Console` wrapper for Remix PWA that provides much better looking logs in the console. + +It can be utilized like a normal logger: + +```ts +import { logger } from '@remix-pwa/sw/logger'; + +// System startup logs +logger.info('🚀 Service Worker initialized successfully'); +logger.debug('📊 Debug mode enabled - verbose logging active'); + +// Cache operations +logger.groupCollapsed('📦 Cache Operations'); +logger.log('✅ Static assets cached successfully'); +logger.log('📝 Cache manifest updated - v2.1.0'); +logger.groupEnd(); + +// Warning and error scenarios +logger.warn('⚠️ Network connection unstable - falling back to cache'); +logger.error('❌ Failed to fetch resource: /api/users [Status: 404]'); + +// Feature usage tracking +logger.info('👤 User authenticated successfully'); +logger.debug('🔍 Processing request parameters', { + route: '/dashboard', + method: 'GET', + timestamp: new Date().toISOString() +}); + +// Performance monitoring +logger.groupCollapsed('⚡ Performance Metrics'); +logger.log('📊 Time to First Byte: 120ms'); +logger.log('⏱️ Total Page Load: 1.2s'); +logger.log('🗃️ Cache Hit Ratio: 85%'); +logger.groupEnd(); +``` + +Or can be customised to provide better ownership + +## `Logger` + +The `Logger` class is a class that allows you to create your own logger, with your own styles, prefix and more. + +### Instantiating `Logger` + +To create a new `Logger` instance, you can easily do so via the `Logger` constructor: + +```ts +import { Logger } from '@remix-pwa/sw/logger'; + +const logger = new Logger(); +``` + +When no options are provided, the logger will use the default options. + +#### Constructor Options + +The `Logger` constructor accepts the following options: + +- `prefix` - The prefix to be used in the logs. By default, this is `remix-pwa`. +- `logLevel` - The log level to be used. By default, this is `info`. Check out the [Log Levels](#log-levels) section for more information. +- `styles` - The styles to be used in the logs. By default, this is a pre-defined set of styles for each log level, you +can choose to extend or override these styles, individually or collectively. +- `isProductionEnv` - This would be auto-filled in by Remix PWA Vite bundler. **Don't** set this manually. + +### `Logger` methods + +The `Logger` class provides the following methods: + +- `debug` - Logs a message with the `debug` log level. +- `info` - Logs a message with the `info` log level. +- `log` - Logs a message with the `log` log level. +- `warn` - Logs a message with the `warn` log level. +- `error` - Logs a message with the `error` log level. +- `groupCollapsed` - Logs a group of messages with the `log` log level. +- `groupEnd` - Ends a group of messages. + +They perform the same as the `console` methods, but with better looking logs. + +The other set fo not-so-conventional methods include: + +- `setLogLevel` - Sets the log level for the logger. +- `setStyles` - Sets the styles for the logger. Can be used to override styles after instantiation. + +## Log Levels + +Log levels in Remix PWA `Logger` is a hierarchical structure, that allows you to filter out logs based on their severity. + +The log levels are as follows: + +- `debug` - The most verbose log level. Used for debugging purposes. +- `info` - The default log level. Used for general information. +- `log` - The default log level. Used for general information. +- `warn` - The warning log level. Used for non-critical issues. +- `error` - The error log level. Used for critical issues. + +The log levels are hierarchical, meaning that a log level will log all logs of its level and below. + +## `logger` + +The `logger` export is a pre-instantiated `Logger` instance with the default options. diff --git a/posts/next/utils/misc.mdx b/posts/dev/utils/misc.mdx similarity index 100% rename from posts/next/utils/misc.mdx rename to posts/dev/utils/misc.mdx diff --git a/posts/next/utils/pwa-utils.mdx b/posts/dev/utils/pwa-utils.mdx similarity index 100% rename from posts/next/utils/pwa-utils.mdx rename to posts/dev/utils/pwa-utils.mdx diff --git a/posts/main/utils/redirect.mdx b/posts/dev/utils/redirect.mdx similarity index 100% rename from posts/main/utils/redirect.mdx rename to posts/dev/utils/redirect.mdx diff --git a/posts/dev/utils/vite-config.mdx b/posts/dev/utils/vite-config.mdx new file mode 100644 index 0000000..a781cfa --- /dev/null +++ b/posts/dev/utils/vite-config.mdx @@ -0,0 +1,107 @@ +--- +title: vite.config.ts +description: "Remix PWA Vite plugin configurations" +alternateTitle: vite.config.ts +--- + +Remix PWA uses Vite to compile and bundle your service workers. The process isn't linear, so you are able to customize the process by utilising the configuration options exposed by the `remixPWA` plugin. + +## Remix PWA Vite Plugin Configuration + +```ts {{filename:'vite.config.ts'}} +import { vitePlugin as remix } from "@remix-run/dev"; +import { remixPWA } from "@remix-pwa/dev"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [ + remix(), // remix plugin is important! + remixPWA({ + workerBuildDirectory: "out", + scope: '/pwa', + // rest of your configurations here + }), + ], +}); +``` + +> The configuration is an object of type `PWAViteOptions`. + +### `injectSWRegister` + +The `injectSWRegister` option of type: `boolean` is used to set wether to automatically register the service worker or not via plugin injection. + +By default, the service worker is registered automatically. Alternatively, you can set this to `false` and manually register the service worker in your application via the [`PWAScripts`](/docs/next/pwa-scripts) component. + +### `workerBuildDirectory` + +The `workerBuildDirectory` option of type: `string` is used to set the directory where the service worker is built to. **Default**: `public` in dev and `build/client` in production. Note the lack of leading or trailing slashes. + +### `buildVariables` + +The `buildVariables` option of type: `Record` is used to inject build variables into the service worker. Do note that these variables are visible in the browser, so don't inject private keys! + +```ts +// vite.config.ts +export default defineConfig({ + plugins: [ + remixPWA({ + buildVariables: { + 'process.env.API_URL': 'https://api.example.com', + 'myVar': 'myValue', + }, + }), + ], +}); + +// entry.worker.ts +console.log(process.env.API_URL); // https://api.example.com +console.log(myVar); // myValue +``` + +### `scope` + +The scope of the service worker within your application, this is used by the internal registration injection to set the scope of the service worker. **Default**: `/`. + +### `entryWorkerFile` + +The user entry worker file, relative to the app directory. **Default**: `entry.worker.ts`. + +> Be keeping note of the lack of slashes in many. + +### `workerMinify` + +The `workerMinify` option of type: `boolean` is used to set wether to minify the service worker post-bundling or not. **Default**: `false`. + +### `workerName` + +The `workerName` option of type: `string` is used to set the name of the service worker file, without extensions. No extensions should be passed in (`js`, `mjs`, etc.). **Default**: `entry.worker`. + +### `ignoredSWRouteFiles` + +An array of route string patterns to ignore when generating the service worker. Note, this would mean that any worker route modules in those routes would not be included in the final build output. **Default**: `[]`. + +The `ignoredSWRouteFiles` now understands string globs/patterns. For example, to ignore all routes that start with `/admin`, you can use `['admin/**']`. This ignores routes starting with `admin` and all its children. You can also ignore routes based on middle patterns or routes ending with a pattern. + +```ts +[ + 'admin/**', // ignore all routes starting with admin + '*/admin', // ignore all routes ending with admin + '**/admin/**', // ignore all routes containing admin within (not at the start or end) + '*', // ignore all routes + 'admin/dashboard/**' // can also ignore based on two or more route segments +] +``` + +> One asterik (*) or two, it doesn't matter. Both work. + +### `workerSourceMap` + +The `workerSourceMap` option of type: `boolean` is used to set wether to generate source maps for the service worker or not. **Default**: `false`. + +### `workerEntryPoint` + +This is used to set the entry point of the service worker (also known as runtime in Remix PWA). **Default**: `@remix-pwa/worker-runtime`. + +To create your own runtime, check out the runtime guide. + diff --git a/posts/main/apis/default-fetch-handler.mdx b/posts/latest/apis/default-fetch-handler.mdx similarity index 100% rename from posts/main/apis/default-fetch-handler.mdx rename to posts/latest/apis/default-fetch-handler.mdx diff --git a/posts/main/apis/error-handler.mdx b/posts/latest/apis/error-handler.mdx similarity index 100% rename from posts/main/apis/error-handler.mdx rename to posts/latest/apis/error-handler.mdx diff --git a/posts/main/apis/get-load-context.mdx b/posts/latest/apis/get-load-context.mdx similarity index 100% rename from posts/main/apis/get-load-context.mdx rename to posts/latest/apis/get-load-context.mdx diff --git a/posts/main/apis/index.md b/posts/latest/apis/index.md similarity index 100% rename from posts/main/apis/index.md rename to posts/latest/apis/index.md diff --git a/posts/main/apis/worker-action.mdx b/posts/latest/apis/worker-action.mdx similarity index 100% rename from posts/main/apis/worker-action.mdx rename to posts/latest/apis/worker-action.mdx diff --git a/posts/main/apis/worker-loader.mdx b/posts/latest/apis/worker-loader.mdx similarity index 100% rename from posts/main/apis/worker-loader.mdx rename to posts/latest/apis/worker-loader.mdx diff --git a/posts/main/guides/background-sync.mdx b/posts/latest/guides/background-sync.mdx similarity index 100% rename from posts/main/guides/background-sync.mdx rename to posts/latest/guides/background-sync.mdx diff --git a/posts/next/guides/browser-support.mdx b/posts/latest/guides/browser-support.mdx similarity index 100% rename from posts/next/guides/browser-support.mdx rename to posts/latest/guides/browser-support.mdx diff --git a/posts/main/guides/cli.mdx b/posts/latest/guides/cli.mdx similarity index 100% rename from posts/main/guides/cli.mdx rename to posts/latest/guides/cli.mdx diff --git a/posts/main/guides/contributing.mdx b/posts/latest/guides/contributing.mdx similarity index 100% rename from posts/main/guides/contributing.mdx rename to posts/latest/guides/contributing.mdx diff --git a/posts/main/guides/deployment.mdx b/posts/latest/guides/deployment.mdx similarity index 100% rename from posts/main/guides/deployment.mdx rename to posts/latest/guides/deployment.mdx diff --git a/posts/main/guides/enhanced-cache.mdx b/posts/latest/guides/enhanced-cache.mdx similarity index 100% rename from posts/main/guides/enhanced-cache.mdx rename to posts/latest/guides/enhanced-cache.mdx diff --git a/posts/main/guides/env.mdx b/posts/latest/guides/env.mdx similarity index 100% rename from posts/main/guides/env.mdx rename to posts/latest/guides/env.mdx diff --git a/posts/main/guides/gotchas.mdx b/posts/latest/guides/gotchas.mdx similarity index 100% rename from posts/main/guides/gotchas.mdx rename to posts/latest/guides/gotchas.mdx diff --git a/posts/main/guides/index.md b/posts/latest/guides/index.md similarity index 100% rename from posts/main/guides/index.md rename to posts/latest/guides/index.md diff --git a/posts/main/guides/messaging.mdx b/posts/latest/guides/messaging.mdx similarity index 100% rename from posts/main/guides/messaging.mdx rename to posts/latest/guides/messaging.mdx diff --git a/posts/main/guides/offline.mdx b/posts/latest/guides/offline.mdx similarity index 100% rename from posts/main/guides/offline.mdx rename to posts/latest/guides/offline.mdx diff --git a/posts/main/guides/push-api.mdx b/posts/latest/guides/push-api.mdx similarity index 100% rename from posts/main/guides/push-api.mdx rename to posts/latest/guides/push-api.mdx diff --git a/posts/main/guides/runtimes.mdx b/posts/latest/guides/runtimes.mdx similarity index 100% rename from posts/main/guides/runtimes.mdx rename to posts/latest/guides/runtimes.mdx diff --git a/posts/main/guides/versioning.mdx b/posts/latest/guides/versioning.mdx similarity index 100% rename from posts/main/guides/versioning.mdx rename to posts/latest/guides/versioning.mdx diff --git a/posts/main/guides/web-manifest.mdx b/posts/latest/guides/web-manifest.mdx similarity index 100% rename from posts/main/guides/web-manifest.mdx rename to posts/latest/guides/web-manifest.mdx diff --git a/posts/main/hooks/index.md b/posts/latest/hooks/index.md similarity index 100% rename from posts/main/hooks/index.md rename to posts/latest/hooks/index.md diff --git a/posts/main/hooks/manifest-link.mdx b/posts/latest/hooks/manifest-link.mdx similarity index 100% rename from posts/main/hooks/manifest-link.mdx rename to posts/latest/hooks/manifest-link.mdx diff --git a/posts/main/hooks/use-badge-api.mdx b/posts/latest/hooks/use-badge-api.mdx similarity index 100% rename from posts/main/hooks/use-badge-api.mdx rename to posts/latest/hooks/use-badge-api.mdx diff --git a/posts/main/hooks/use-battery-manager.mdx b/posts/latest/hooks/use-battery-manager.mdx similarity index 100% rename from posts/main/hooks/use-battery-manager.mdx rename to posts/latest/hooks/use-battery-manager.mdx diff --git a/posts/main/hooks/use-network-connectivity.mdx b/posts/latest/hooks/use-network-connectivity.mdx similarity index 100% rename from posts/main/hooks/use-network-connectivity.mdx rename to posts/latest/hooks/use-network-connectivity.mdx diff --git a/posts/main/hooks/use-permission.mdx b/posts/latest/hooks/use-permission.mdx similarity index 100% rename from posts/main/hooks/use-permission.mdx rename to posts/latest/hooks/use-permission.mdx diff --git a/posts/main/hooks/use-push.mdx b/posts/latest/hooks/use-push.mdx similarity index 100% rename from posts/main/hooks/use-push.mdx rename to posts/latest/hooks/use-push.mdx diff --git a/posts/main/hooks/use-pwa-manager.mdx b/posts/latest/hooks/use-pwa-manager.mdx similarity index 100% rename from posts/main/hooks/use-pwa-manager.mdx rename to posts/latest/hooks/use-pwa-manager.mdx diff --git a/posts/main/hooks/use-sw-effect.mdx b/posts/latest/hooks/use-sw-effect.mdx similarity index 100% rename from posts/main/hooks/use-sw-effect.mdx rename to posts/latest/hooks/use-sw-effect.mdx diff --git a/posts/main/metadata.json b/posts/latest/metadata.json similarity index 100% rename from posts/main/metadata.json rename to posts/latest/metadata.json diff --git a/posts/main/started/changelog.mdx_ b/posts/latest/started/changelog.mdx_ similarity index 100% rename from posts/main/started/changelog.mdx_ rename to posts/latest/started/changelog.mdx_ diff --git a/posts/main/started/community.mdx b/posts/latest/started/community.mdx similarity index 100% rename from posts/main/started/community.mdx rename to posts/latest/started/community.mdx diff --git a/posts/next/getting-started/index.md b/posts/latest/started/index.md similarity index 100% rename from posts/next/getting-started/index.md rename to posts/latest/started/index.md diff --git a/posts/main/started/quick-start.mdx b/posts/latest/started/quick-start.mdx similarity index 100% rename from posts/main/started/quick-start.mdx rename to posts/latest/started/quick-start.mdx diff --git a/posts/main/started/technical-explanation.mdx_ b/posts/latest/started/technical-explanation.mdx_ similarity index 100% rename from posts/main/started/technical-explanation.mdx_ rename to posts/latest/started/technical-explanation.mdx_ diff --git a/posts/main/started/v4.mdx b/posts/latest/started/v4.mdx similarity index 100% rename from posts/main/started/v4.mdx rename to posts/latest/started/v4.mdx diff --git a/posts/main/utils/cache-api.mdx b/posts/latest/utils/cache-api.mdx similarity index 100% rename from posts/main/utils/cache-api.mdx rename to posts/latest/utils/cache-api.mdx diff --git a/posts/next/utils/defer.mdx b/posts/latest/utils/defer.mdx similarity index 100% rename from posts/next/utils/defer.mdx rename to posts/latest/utils/defer.mdx diff --git a/posts/main/utils/index.md b/posts/latest/utils/index.md similarity index 100% rename from posts/main/utils/index.md rename to posts/latest/utils/index.md diff --git a/posts/next/utils/json.mdx b/posts/latest/utils/json.mdx similarity index 100% rename from posts/next/utils/json.mdx rename to posts/latest/utils/json.mdx diff --git a/posts/main/utils/logger.mdx b/posts/latest/utils/logger.mdx similarity index 100% rename from posts/main/utils/logger.mdx rename to posts/latest/utils/logger.mdx diff --git a/posts/main/utils/misc.mdx b/posts/latest/utils/misc.mdx similarity index 100% rename from posts/main/utils/misc.mdx rename to posts/latest/utils/misc.mdx diff --git a/posts/main/utils/pwa-utils.mdx b/posts/latest/utils/pwa-utils.mdx similarity index 100% rename from posts/main/utils/pwa-utils.mdx rename to posts/latest/utils/pwa-utils.mdx diff --git a/posts/next/utils/redirect.mdx b/posts/latest/utils/redirect.mdx similarity index 100% rename from posts/next/utils/redirect.mdx rename to posts/latest/utils/redirect.mdx diff --git a/posts/main/utils/vite-config.mdx b/posts/latest/utils/vite-config.mdx similarity index 100% rename from posts/main/utils/vite-config.mdx rename to posts/latest/utils/vite-config.mdx diff --git a/posts/next/guides/env.mdx b/posts/next/guides/env.mdx deleted file mode 100644 index faca466..0000000 --- a/posts/next/guides/env.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Environment Variables -description: "Environment variables are a way to store app state and config data outside of your codebase. A guide to access them safely within Remix PWA" -alternateTitle: Environment Variables -stub: true ---- diff --git a/posts/next/guides/web-manifest.mdx b/posts/next/guides/web-manifest.mdx deleted file mode 100644 index 5f54db1..0000000 --- a/posts/next/guides/web-manifest.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Web Manifest -description: "Web Manifests are the heart of PWAs. Explore how to create a Web Manifest for your Remix PWA in this guide." -alternateTitle: Web Manifest -stub: true ---- diff --git a/posts/next/utils/logger.mdx b/posts/next/utils/logger.mdx deleted file mode 100644 index 04e62d6..0000000 --- a/posts/next/utils/logger.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Logger -description: "Logger is a logging utility build for better looking logs in the console." -alternateTitle: Logger -stub: true ---- diff --git a/posts/next/utils/vite-config.mdx b/posts/next/utils/vite-config.mdx deleted file mode 100644 index 095f2c2..0000000 --- a/posts/next/utils/vite-config.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: vite.config.ts -description: "Remix PWA Vite plugin configurations" -alternateTitle: vite.config.ts -stub: true ---- diff --git a/posts/versions.json b/posts/versions.json index 96a0ead..d7bef98 100644 --- a/posts/versions.json +++ b/posts/versions.json @@ -1,11 +1,11 @@ [ { "version": "4.0.0", - "tag": "main" + "tag": "latest" }, { "version": "5.0.0", - "tag": "next" + "tag": "dev" }, { "version": "3.0.0",