{"_id":"@async/web","_rev":"2-82066c058f453920b73fd23626562883","name":"@async/web","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@async/web","version":"0.2.0","license":"MIT","_id":"@async/web@0.2.0","maintainers":[{"name":"async-npm","email":"async.npm@gdi2290.com"},{"name":"patrickjs","email":"npm.patrickjs@gdi2290.com"}],"homepage":"https://github.com/async/web/tree/main/packages/web#readme","bugs":{"url":"https://github.com/async/web/issues"},"dist":{"shasum":"c52bd9800e601d2b021672caf2a80a58e9d19596","tarball":"https://registry.npmjs.org/@async/web/-/web-0.2.0.tgz","fileCount":299,"integrity":"sha512-T9lXZ6oWx30Ajx3Zkn/YxEbXCk1vIuqpQsfqE+Y+KbQYwy+pRUDlGmkt0NMuApCNCuS2dkfytFPMElziG9dMzw==","signatures":[{"sig":"MEUCIHXIRdHbPj0GNIWojLwmce3b7Idq8srB/w5/Kg4DgM8vAiEA7pW1S5U6YWv1ynFAAYxpTG+Za5RjI4Ga9ib8wS+Rz5g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@async%2fweb@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":532845},"type":"module","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./app":{"types":"./dist/app.d.ts","default":"./dist/app.js"},"./vite":{"types":"./dist/vite.d.ts","default":"./dist/vite.js"},"./config":{"types":"./dist/config.d.ts","default":"./dist/config.js"},"./router":{"types":"./dist/router/index.d.ts","default":"./dist/router/index.js"},"./routes":{"types":"./dist/routes.d.ts","default":"./dist/routes.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"./runtime/app":{"types":"./dist/runtime/app.d.ts","default":"./dist/runtime/app.js"},"./runtime/edge":{"types":"./dist/runtime/edge/index.d.ts","default":"./dist/runtime/edge/index.js"},"./runtime/node":{"types":"./dist/runtime/node/index.d.ts","default":"./dist/runtime/node/index.js"},"./runtime/vite":{"types":"./dist/runtime/vite/index.d.ts","default":"./dist/runtime/vite/index.js"},"./runtime/cache":{"types":"./dist/runtime/cache/index.d.ts","default":"./dist/runtime/cache/index.js"},"./runtime/routes":{"types":"./dist/runtime/routes.d.ts","default":"./dist/runtime/routes.js"},"./runtime/browser":{"types":"./dist/runtime/browser/index.d.ts","default":"./dist/runtime/browser/index.js"},"./runtime/testing":{"types":"./dist/runtime/testing/index.d.ts","default":"./dist/runtime/testing/index.js"},"./runtime/tracing":{"types":"./dist/runtime/tracing/index.d.ts","default":"./dist/runtime/tracing/index.js"},"./runtime/async-db":{"types":"./dist/runtime/async-db/index.d.ts","default":"./dist/runtime/async-db/index.js"},"./runtime/platform":{"types":"./dist/runtime/platform/index.d.ts","default":"./dist/runtime/platform/index.js"},"./runtime/providers":{"types":"./dist/runtime/providers/index.d.ts","default":"./dist/runtime/providers/index.js"},"./runtime/node/mini-cloudflare":{"types":"./dist/runtime/node/create-mini-cloudflare-preview-server.d.ts","default":"./dist/runtime/node/create-mini-cloudflare-preview-server.js"}},"gitHead":"6037451b930bbbbce15a62cf8baa9da444ca3ffc","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"node scripts/build.js","typecheck":"tsc --noEmit","pack:check":"npm pack --dry-run","test:watch":"vitest"},"_npmUser":{"name":"patrickjs","email":"npm.patrickjs@gdi2290.com"},"repository":{"url":"git+https://github.com/async/web.git","type":"git","directory":"packages/web"},"_npmVersion":"11.16.0","description":"Developer-facing Async app framework that lowers app conventions into WebRuntime configs.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.6","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/web_0.2.0_1781435637131_0.7805273643755997","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-14T11:13:56.991Z","modified":"2026-06-17T04:42:02.169Z","0.2.0":"2026-06-14T11:13:57.266Z"},"bugs":{"url":"https://github.com/async/web/issues"},"license":"MIT","homepage":"https://github.com/async/web/tree/main/packages/web#readme","repository":{"url":"git+https://github.com/async/web.git","type":"git","directory":"packages/web"},"description":"Developer-facing Async app framework that lowers app conventions into WebRuntime configs.","maintainers":[{"email":"me@jackshelton.com","name":"jackshelton"},{"email":"async.npm@gdi2290.com","name":"async-npm"},{"email":"npm.patrickjs@gdi2290.com","name":"patrickjs"}],"readme":"# @async/web\n\nDeveloper-facing app framework for Async Web.\n\n`defineApp()` records app topology and lowers it into `@async/web/runtime` config. Start with explicit `apps` and `routes` when the app is multiple systems wired together.\n\n```ts\nimport {\n  browserApp,\n  defineApp,\n  fetchApp,\n  mount,\n  toApp\n} from '@async/web';\n\nexport default defineApp({\n  origin: 'https://crm.acme.async.run',\n  apps: {\n    web: browserApp({\n      document: './apps/web/index.html',\n      basePath: '/',\n      fallback: 'spa'\n    }),\n    api: fetchApp({\n      runtime: 'origin',\n      basePath: '/api/',\n      fetch: apiFetch\n    })\n  },\n  routes: [\n    mount('/api', toApp('api')),\n    toApp('web')\n  ]\n});\n```\n\nApp names are arbitrary. `browserApp()` creates a static browser `FetchApp`, `fetchApp()` preserves raw Fetch handlers, and `asyncDbApp()` mounts the AsyncDB adapter when the DB app should be explicit in `apps`. Convention shortcuts such as `api: { dir: './src/api' }` and `db: dbConfig` are still supported for projects that want the defaults.\n\nThe framework defaults live in `asyncWebDefaultConfig`, exported from `@async/web`, so app authors and contributors can see the internal baseline that `defineApp()` merges user config against.\n\nConfigs compose recursively:\n\n```ts\nimport crm from '../crm/async.config';\nimport admin from '../admin/async.config';\nimport {\n  defineApp,\n  mount,\n  toApp\n} from '@async/web';\n\nexport default defineApp({\n  name: 'root',\n  apps: {\n    crm,\n    admin\n  },\n  routes: [\n    mount('/crm', toApp('crm')),\n    mount('/admin', toApp('admin'))\n  ]\n});\n```\n\nChild apps can declare local dev intent with `dev: { port, strictPort }`. Routes stay logical and never point at localhost ports directly.\n\nRoot apps can also compose remote apps by contract. `remoteApp()` records the\nremote endpoint and manifest path; `envValue()` selects topology values during\nbuild/dev orchestration, and `buildEnv()` marks values supplied by deploy\ninfrastructure.\n\n```ts\nimport {\n  buildEnv,\n  defineApp,\n  envValue,\n  remoteApp\n} from '@async/web';\n\nexport default defineApp({\n  apps: {\n    identity: remoteApp({\n      endpoint: envValue({\n        local: 'http://127.0.0.1:4102',\n        staging: buildEnv('IDENTITY_STAGING_URL'),\n        production: buildEnv('IDENTITY_PRODUCTION_URL')\n      }),\n      manifest: '/.well-known/async-app.json'\n    })\n  },\n\n  connections: {\n    data: {\n      'crm.users': envValue({\n        local: 'identityLocal.contracts.public.users',\n        production: 'identity.contracts.public.users'\n      })\n    },\n    auth: {\n      provider: 'identity'\n    },\n    api: {\n      'crm.identity': 'identity.contracts.public.operations'\n    },\n    events: {\n      'crm.customer.created': ['identity.contracts.internal.events.audit']\n    }\n  }\n});\n```\n\nUse `routes` for HTTP request flow. Use `connections` for app dependencies and\ncontract wiring. `envValue()` is for topology values such as endpoints,\ncontract refs, route targets, provider hints, and deployment names; keep\nsecrets in a separate binding model.\n","readmeFilename":"README.md"}