{"_id":"@alternatefutures/next-on-af","_rev":"2-22dec31c5eeb7b501aed8355192ab0fa","name":"@alternatefutures/next-on-af","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alternatefutures/next-on-af","version":"0.1.0","keywords":["alternatefutures","edge","nextjs","next","serverless"],"license":"MIT","_id":"@alternatefutures/next-on-af@0.1.0","maintainers":[{"name":"system-af","email":"system@alternatefutures.ai"}],"homepage":"https://github.com/alternatefutures/next-on-alternatefutures#readme","bugs":{"url":"https://github.com/alternatefutures/next-on-alternatefutures/issues"},"dist":{"shasum":"40bcc01048d0cc677d29bf4376439cdc76d16fe2","tarball":"https://registry.npmjs.org/@alternatefutures/next-on-af/-/next-on-af-0.1.0.tgz","fileCount":144,"integrity":"sha512-rxAH7q++dk9mhdB4KzqtBZVe9g5UWMiFZK1qWXZxYo2lGfSo8K1mqvPK4uM0eNcOLxxbQI0qBDI/IZD21fASfQ==","signatures":[{"sig":"MEYCIQCfsrp0nD2ewfFEgeH7F9DrYrlnrEhPgcMw8PtJHsy3fAIhALROad/7QI2QH7mYrt5Y9ExfrS4FgioBcudDsw4vlQ6a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":564006},"main":"./dist/index.js","types":"./dist/src/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/index.js"},"./next-dev":{"types":"./dist/next-dev/index.d.ts","import":"./dist/next-dev/index.cjs","require":"./dist/next-dev/index.cjs"},"./fetch-handler":{"types":"./dist/fetch-handler/index.d.ts","import":"./dist/fetch-handler/index.js"}},"gitHead":"82cdb9c567a0595b238fb24570a1d97e4d4864dd","scripts":{"lint":"eslint src templates","build":"esbuild --bundle --platform=node ./src/index.ts ./src/api/index.ts --external:esbuild --external:chokidar --outdir=./dist","prepare":"npm run build","postbuild":"npm run build:types && npm run build:fetch-handler","test:unit":"npx vitest --config vitest.config.ts","build:types":"npm run build:types:index","build:watch":"npm run build -- --watch=forever","types-check":"tsc --noEmit","build:types:index":"tsc -p tsconfig.index.json","build:fetch-handler":"esbuild --bundle --platform=browser ./src/fetch-handler/index.ts --outdir=./dist/fetch-handler"},"_npmUser":{"name":"system-af","email":"system@alternatefutures.ai"},"repository":{"url":"git+https://github.com/alternatefutures/next-on-alternatefutures.git","type":"git"},"_npmVersion":"10.5.0","description":"`@alternatefutures/next-on-alternatefutures` is a CLI tool that you can use to build and develop [Next.js](https://nextjs.org/) applications so that they can run on [AlternateFutures Functions](https://fleek.xyz/docs/platform/fleek-functions/).","directories":{},"_nodeVersion":"20.12.2","dependencies":{"acorn":"^8.8.0","chalk":"^5.2.0","semver":"^7.5.2","esbuild":"^0.15.3","js-yaml":"^4.1.0","chokidar":"^3.5.3","ast-types":"^0.14.2","commander":"^11.1.0","miniflare":"^3.20231218.1","mime-types":"^2.1.35","multiformats":"^13.3.0","files-from-path":"^1.0.4","fleek-function-utils":"^0.1.3","parallel-transform-web":"^1.0.1","package-manager-manager":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.35.0","vitest":"^0.32.2","mock-fs":"^5.2.0","p-limit":"^4.0.0","prettier":"^2.8.4","typescript":"^5.0.4","@types/node":"^20.1.4","dedent-tabs":"^0.10.3","@types/cookie":"^0.5.1","@types/js-yaml":"^4.0.5","@types/mock-fs":"^4.13.1","@changesets/cli":"^2.26.0","image-to-base64":"^2.2.0","@tsconfig/strictest":"^2.0.0","vitest-environment-miniflare":"^2.13.0","@alternatefutures/next-on-alternatefutures-tsconfig":"*"},"peerDependencies":{"vercel":">=30.0.0","@cloudflare/workers-types":"^4.20240208.0"},"peerDependenciesMeta":{"@cloudflare/workers-types":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/next-on-af_0.1.0_1760032773712_0.6463871633099443","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-10-09T17:59:33.635Z","modified":"2026-04-07T01:26:08.959Z","0.1.0":"2025-10-09T17:59:33.933Z"},"bugs":{"url":"https://github.com/alternatefutures/next-on-alternatefutures/issues"},"license":"MIT","homepage":"https://github.com/alternatefutures/next-on-alternatefutures#readme","keywords":["alternatefutures","edge","nextjs","next","serverless"],"repository":{"url":"git+https://github.com/alternatefutures/next-on-alternatefutures.git","type":"git"},"description":"`@alternatefutures/next-on-alternatefutures` is a CLI tool that you can use to build and develop [Next.js](https://nextjs.org/) applications so that they can run on [AlternateFutures Functions](https://fleek.xyz/docs/platform/fleek-functions/).","maintainers":[{"email":"hayk@alternatefutures.ai","name":"alternatehayk"},{"email":"system@alternatefutures.ai","name":"system-af"}],"readme":"# `@alternatefutures/next-on-alternatefutures`\n\n`@alternatefutures/next-on-alternatefutures` is a CLI tool that you can use to build and develop [Next.js](https://nextjs.org/) applications so that they can run on [AlternateFutures Functions](https://fleek.xyz/docs/platform/fleek-functions/).\n\nThis tool is a best-effort library implemented by the AlternateFutures team, on the shoulders of the Cloudflare team and the community. As such, most, but not all, Next.js features are supported. See the [Supported Versions and Features document](https://github.com/alternatefutures/next-on-alternatefutures/blob/main/packages/next-on-alternatefutures/docs/supported.md) for more details.\n\n## Quick Start\n\nThis section describes how to bundle and deploy a (new or existing) Next.js application to [AlternateFutures Functions](https://fleek.xyz/docs/platform/fleek-functions/), using `@alternatefutures/next-on-alternatefutures`.\n\n### 1. Select your Next.js app\n\nTo start using `@alternatefutures/next-on-alternatefutures`, you must have a Next.js project that you wish to deploy. If you already have one, change to its directory. Otherwise, you can use the `create-next-app` command to start a new one.\n\n```sh\nnpx create-next-app@latest my-next-app\ncd my-next-app\n```\n\n<details>\n<summary>Note on the Next.js version</summary>\n\nWe have confirmed support for the current version of Next.js at the time of writing, `14.2.14`. Although we'll endeavor to keep support for newer versions, we cannot guarantee that we'll always be up-to-date with the latest version. If you experience any problems with `@alternatefutures/next-on-alternatefutures`, you may wish to try pinning to `14.2.14` while we work on supporting any recent breaking changes.\n\n</details>\n\n### 2. Configure the application to use the Edge Runtime\n\nFor your application to run on AlternateFutures Functions, it needs to opt in to use the Edge Runtime for routes containing server-side code (e.g. API Routes or pages that use `getServerSideProps`). To do this, export a `runtime` [route segment config](https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime) option from each file, specifying that it should use the Edge Runtime.\n\n```typescript\nexport const runtime = 'edge';\n```\n\n&NewLine;\n\nFor more examples of this and for Next.js versions prior to v14.2.14, take a look at our [examples document](https://github.com/alternatefutures/next-on-alternatefutures/blob/main/packages/next-on-alternatefutures/docs/examples.md). Additionally, ensure that your application is not using any unsupported [APIs](https://nextjs.org/docs/app/api-reference/edge#unsupported-apis) or [features](https://github.com/alternatefutures/next-on-alternatefutures/blob/main/packages/next-on-alternatefutures/docs/supported.md).\n\n### 3. Deploy your application to AlternateFutures Functions\n\nTo deploy your application to AlternateFutures Functions, you need to install the `@alternatefutures/next-on-alternatefutures` package.\n\n```sh\nnpm install -D @alternatefutures/next-on-alternatefutures\n```\n\nTODO\n\n## Recommended development workflow\n\nWhen developing a `next-on-alternatefutures` application, this is the development workflow that AlternateFutures recommends:\n\n### Deploy your application and iterate\n\nAfter you have previewed your application locally, you can deploy it to AlternateFutures (via [AlternateFutures Next CLI](https://github.com/fleekxyz/fleek-next)) and iterate over the process to make new changes.\n\n## Examples\n\nTo see some examples on how to use Next.js features with `@alternatefutures/next-on-alternatefutures`, see the [Examples document](https://github.com/alternatefutures/next-on-alternatefutures/blob/main/packages/next-on-alternatefutures/docs/examples.md).\n\n## Troubleshooting\n\nIf you find yourself hitting some issues with `@alternatefutures/next-on-alternatefutures` please check out our [official troubleshooting documentation](TODO).\n\n## More Information\n\nFor more information on the project please check out the [README](https://github.com/alternatefutures/next-on-alternatefutures/blob/main/README.md) in the next-on-pages github repository.\n","readmeFilename":"README.md"}