nuxt-backend 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/doctor.mjs +3 -3
- package/dist/chunks/email-previews.mjs +1 -1
- package/dist/chunks/health.mjs +2 -2
- package/dist/chunks/index.mjs +2 -2
- package/dist/chunks/install.mjs +4 -4
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +4 -4
- package/dist/cli.mjs +8 -8
- package/dist/devtools-client/index.html +1 -1
- package/dist/module.js +2 -2
- package/dist/module.json +1 -1
- package/dist/shared/{nuxt-backend.BqXAZChe.mjs → nuxt-backend.0r1vvS1c.mjs} +2 -2
- package/dist/shared/{nuxt-backend.CBvrM7pG.mjs → nuxt-backend.BvKvJ1mo.mjs} +1 -1
- package/dist/shared/{nuxt-backend.Dikfaocl.mjs → nuxt-backend.DRuHg-IQ.mjs} +128 -5
- package/dist/shared/{nuxt-backend.DbaXvH__.mjs → nuxt-backend.suXOnqOQ.mjs} +162 -3
- package/dist/shared/{nuxt-backend.DH1Ya3uB.mjs → nuxt-backend.zY6UDqDu.mjs} +1 -1
- package/package.json +2 -2
- package/skills/nuxt-backend/references/api.md +1 -1
- package/skills/nuxt-backend/references/install.md +8 -5
package/README.md
CHANGED
|
@@ -68,8 +68,9 @@ npx nuxt-backend dev --anonymous # or plain `npm run dev`, and pick "Start wit
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
In an app you already have, the first two lines are this one. Its install step installs `convex`, writes
|
|
71
|
-
the backend files, points the `dev` script at `nuxt-backend dev
|
|
72
|
-
`<NuxtPage />` (outside an interactive terminal,
|
|
71
|
+
the backend files, points the `dev` script at `nuxt-backend dev`, swaps `<NuxtWelcome />` for
|
|
72
|
+
`<NuxtPage />` and adds a home page when the app has none (outside an interactive terminal,
|
|
73
|
+
`npx nuxt-backend init` does the same):
|
|
73
74
|
|
|
74
75
|
```bash
|
|
75
76
|
npx nuxt module add nuxt-backend
|
package/dist/chunks/catalog.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { stat } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { pathToFileURL } from 'node:url';
|
|
5
|
-
import { j as resolveFunctionsDir } from '../shared/nuxt-backend.
|
|
5
|
+
import { j as resolveFunctionsDir } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:module';
|
|
8
8
|
import 'node:child_process';
|
package/dist/chunks/doctor.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { resolve, join, dirname, relative, sep } from 'node:path';
|
|
4
|
-
import { l as executeEnvPush, f as runConvex,
|
|
4
|
+
import { l as executeEnvPush, f as runConvex, a$ as envNames, a4 as REQUIRED_DEPLOYMENT_ENV, b0 as DEV_ONLY_DEPLOYMENT_ENV, m as generateAuthSecret, b1 as DEV_SITE_URL, g as deploymentFlags, b2 as finding, e as deployKeyType, r as readEnvFiles, aP as capabilityOfEnv, k as readTextIfPresent, aO as BACKEND_ENV, j as resolveFunctionsDir, b3 as parseBackendEnvironment, c as billingEnvironment, V as packageDir, b4 as proofKeys, b5 as TEST_CHALLENGE_SITE_KEYS, b6 as deploymentEnvId, b7 as protectionTakes, al as DEFAULT_AUTH_ROUTE, b8 as TEST_CHALLENGE_SECRET_KEYS, b9 as PROTECTED_AUTH_ROUTES, ba as PROOF_HEADER, bb as signProof, bc as proofAudience, b as deploymentBackendEnvironment, bd as deploymentSiteOrigin, p as isLoopbackUrl, ab as HEALTH_ROUTE, a8 as resolveSiteUrl, a5 as deriveDeploymentUrls, a as deploymentEnvNames, be as isLocalDeploymentId, q as configuredDeployment, J as computeDeployment, a2 as collectPreflightFindings, bf as capabilityOfGroup, bg as agentFilesFinding, U as installedVersion, a3 as OPTIONAL_DEPLOYMENT_ENV, bh as chosenRoutes, bi as chosenGateways, bj as pinnedRegion, bk as namedModels, bl as usesProvenance, bm as moderationProviders, bn as monitoringDsnFinding, bo as monitoringFindings, bp as usageAlertsFinding, bq as readUsageLimits, br as applyProductionPosture, bs as billingWebhookSecretHint, x as backendPathsOf, bt as BACKEND_PATH_KEYS, bu as pathOption, v as pathsSourceOf, bv as aiFeatures, bw as pathsFileFinding, bx as brandFileFinding, z as appBrandOf, by as labelsFileFinding, F as appLabelsOf, aQ as REMOVED_DEPLOYMENT_ENV, bz as checksImages, bA as namesModerationModel, bB as GATEWAY_ORDER_UNREAD, bC as routeKeyFor, bD as installableFinding, d as deploymentFunctionSpec, bE as gatewayKeyIsTheFix, bF as DEFAULT_MODERATION_MODEL, bG as mountsComponent, bH as GATEWAY_KEY_FIX } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
5
5
|
import { defineCommand } from 'citty';
|
|
6
|
-
import { w as withContract, f as finish, p as progress, r as renderEnvExample, b as devScriptFinding } from '../shared/nuxt-backend.
|
|
6
|
+
import { w as withContract, f as finish, p as progress, r as renderEnvExample, b as devScriptFinding } from '../shared/nuxt-backend.BvKvJ1mo.mjs';
|
|
7
7
|
import { pathToFileURL } from 'node:url';
|
|
8
8
|
import { Polar } from '@polar-sh/sdk';
|
|
9
9
|
import { benefitsList } from '@polar-sh/sdk/funcs/benefitsList.js';
|
|
@@ -26,7 +26,7 @@ import { customersGet } from '@polar-sh/sdk/funcs/customersGet.js';
|
|
|
26
26
|
import '@convex-dev/polar';
|
|
27
27
|
import { metricsLimits } from '@polar-sh/sdk/funcs/metricsLimits.js';
|
|
28
28
|
import { r as readLastRun, i as installChangedSince, a as formatSize } from './report.mjs';
|
|
29
|
-
import { c as convexConfigFinding } from '../shared/nuxt-backend.
|
|
29
|
+
import { c as convexConfigFinding } from '../shared/nuxt-backend.zY6UDqDu.mjs';
|
|
30
30
|
|
|
31
31
|
const ENV_DEFAULT_TYPES = ["preview", "dev"];
|
|
32
32
|
const ENV_DEFAULT_NAMES = [...REQUIRED_DEPLOYMENT_ENV, "BACKEND_ENVIRONMENT"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as runConvex, q as configuredDeployment,
|
|
1
|
+
import { f as runConvex, q as configuredDeployment, aX as isDevDeployment } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
2
2
|
import { n as normalizeLocale, f as forceColorScheme } from '../shared/nuxt-backend.C62dpRH3.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
package/dist/chunks/health.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as readConvexConfigDrift } from '../shared/nuxt-backend.
|
|
2
|
-
import { q as configuredDeployment,
|
|
1
|
+
import { r as readConvexConfigDrift } from '../shared/nuxt-backend.zY6UDqDu.mjs';
|
|
2
|
+
import { q as configuredDeployment, aX as isDevDeployment, f as runConvex } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:module';
|
|
5
5
|
import 'node:path';
|
package/dist/chunks/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { stat, readFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, sep, extname } from 'node:path';
|
|
4
4
|
import { runWithNuxtContext, addDevServerHandler } from '@nuxt/kit';
|
|
5
|
-
import { q as configuredDeployment,
|
|
6
|
-
import { r as resolveBackendSource, e as envTier } from '../shared/nuxt-backend.
|
|
5
|
+
import { q as configuredDeployment, aX as isDevDeployment, P as CAPABILITY_NAMES, Z as doctorReport, a as deploymentEnvNames, aY as RPC_NAMESPACE, aZ as DEVTOOLS_UI_ROUTE, a_ as DEVTOOLS_UI_LOCAL_PORT } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
6
|
+
import { r as resolveBackendSource, e as envTier } from '../shared/nuxt-backend.0r1vvS1c.mjs';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:crypto';
|
|
9
9
|
import 'node:module';
|
package/dist/chunks/install.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useTerminal, getAddDependencyCommand } from '@nuxt/kit';
|
|
2
2
|
import { relative, isAbsolute } from 'node:path';
|
|
3
3
|
import { isCI } from 'std-env';
|
|
4
|
-
import { e as execBinary, p as packageManagerOf, s as setUpProject, b as addedDependencies, f as formatNextSteps, c as installDeclaredDependencies } from '../shared/nuxt-backend.
|
|
5
|
-
import { V as packageDir } from '../shared/nuxt-backend.
|
|
6
|
-
import { l as logger } from '../shared/nuxt-backend.
|
|
4
|
+
import { e as execBinary, p as packageManagerOf, s as setUpProject, b as addedDependencies, f as formatNextSteps, c as installDeclaredDependencies } from '../shared/nuxt-backend.DRuHg-IQ.mjs';
|
|
5
|
+
import { V as packageDir } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
6
|
+
import { l as logger } from '../shared/nuxt-backend.0r1vvS1c.mjs';
|
|
7
7
|
import 'node:child_process';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:module';
|
|
10
|
-
import '../shared/nuxt-backend.
|
|
10
|
+
import '../shared/nuxt-backend.BvKvJ1mo.mjs';
|
|
11
11
|
import 'citty';
|
|
12
12
|
import 'node:url';
|
|
13
13
|
import 'node:crypto';
|
package/dist/chunks/run.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, mkdtempSync, rmSync, mkdirSync, writeFileSync
|
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import { join, dirname } from 'node:path';
|
|
5
5
|
import { stripVTControlCharacters } from 'node:util';
|
|
6
|
-
import { j as resolveFunctionsDir, V as packageDir } from '../shared/nuxt-backend.
|
|
6
|
+
import { j as resolveFunctionsDir, V as packageDir } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
7
7
|
import { tmpdir } from 'node:os';
|
|
8
8
|
import { a as formatSize, r as readLastRun, c as checkBudgets, s as saveLastRun, B as BUDGET_FLAGS } from './report.mjs';
|
|
9
9
|
import 'node:url';
|
package/dist/chunks/server.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
-
import { r as readEnvFiles, aM as resolveConvexCli, U as installedVersion, b as deploymentBackendEnvironment, aN as RECENT_SIGN_IN_SECONDS, P as CAPABILITY_NAMES, Z as doctorReport, a as deploymentEnvNames, aO as BACKEND_ENV, aP as capabilityOfEnv, aQ as REMOVED_DEPLOYMENT_ENV, d as deploymentFunctionSpec, Y as packageVersion } from '../shared/nuxt-backend.
|
|
4
|
+
import { r as readEnvFiles, aM as resolveConvexCli, U as installedVersion, b as deploymentBackendEnvironment, aN as RECENT_SIGN_IN_SECONDS, P as CAPABILITY_NAMES, Z as doctorReport, a as deploymentEnvNames, aO as BACKEND_ENV, aP as capabilityOfEnv, aQ as REMOVED_DEPLOYMENT_ENV, d as deploymentFunctionSpec, Y as packageVersion } from '../shared/nuxt-backend.suXOnqOQ.mjs';
|
|
5
5
|
import { Polar } from '@polar-sh/sdk';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { z as providerClientOptions, a9 as runDoctorChecks, af as REQUIRED_FUNCTION_EXPORTS } from './doctor.mjs';
|
|
@@ -20,7 +20,7 @@ import 'node:util';
|
|
|
20
20
|
import 'dedent';
|
|
21
21
|
import 'defu';
|
|
22
22
|
import 'citty';
|
|
23
|
-
import '../shared/nuxt-backend.
|
|
23
|
+
import '../shared/nuxt-backend.BvKvJ1mo.mjs';
|
|
24
24
|
import '@polar-sh/sdk/funcs/benefitsList.js';
|
|
25
25
|
import '@polar-sh/sdk/funcs/checkoutLinksList.js';
|
|
26
26
|
import '@polar-sh/sdk/funcs/membersListMembers.js';
|
|
@@ -41,8 +41,8 @@ import '@polar-sh/sdk/funcs/customersGet.js';
|
|
|
41
41
|
import '@convex-dev/polar';
|
|
42
42
|
import '@polar-sh/sdk/funcs/metricsLimits.js';
|
|
43
43
|
import './report.mjs';
|
|
44
|
-
import '../shared/nuxt-backend.
|
|
45
|
-
import '../shared/nuxt-backend.
|
|
44
|
+
import '../shared/nuxt-backend.zY6UDqDu.mjs';
|
|
45
|
+
import '../shared/nuxt-backend.DRuHg-IQ.mjs';
|
|
46
46
|
import 'node:readline';
|
|
47
47
|
import '@polar-sh/sdk/funcs/webhooksResetWebhookEndpointSecret.js';
|
|
48
48
|
import './run.mjs';
|
package/dist/cli.mjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { defineCommand, parseArgs, runMain } from 'citty';
|
|
3
3
|
import { mkdtempSync, writeFileSync, rmSync, existsSync, readFileSync, readdirSync, mkdirSync, cpSync, symlinkSync } from 'node:fs';
|
|
4
4
|
import { join, resolve, posix, relative, dirname, isAbsolute, sep } from 'node:path';
|
|
5
|
-
import { C as CAPABILITY_STATES, d as deploymentFunctionSpec, a as deploymentEnvNames, i as isHttpUrl, b as deploymentBackendEnvironment, c as billingEnvironment, s as siteFromCloudUrl, e as deployKeyType, r as readEnvFiles, f as runConvex, R as RESYNC_ENTITLEMENTS_FUNCTION, g as deploymentFlags, h as ConvexCliError, n as nonProductionDeployKey, j as resolveFunctionsDir, k as readTextIfPresent, l as executeEnvPush, m as generateAuthSecret, o as setDeploymentEnv, p as isLoopbackUrl, q as configuredDeployment, t as spawnConvex, B as BACKEND_ENV_NAMES, D as DERIVED_DEPLOYMENT_ENV, u as scaffoldBackendFiles, v as pathsSourceOf, w as syncPathsFile, x as backendPathsOf, y as pathsFileLocation, z as appBrandOf, A as syncBrandFile, E as brandFileLocation, F as appLabelsOf, G as syncLabelsFile, H as labelsFileLocation, I as isDevDeploymentId, M as MCP_SDK, J as computeDeployment, K as appMonitoringDsn, L as monitoringSdkInstalled, N as detectCapabilities, O as DEPLOYMENT_KIND_LABEL, P as CAPABILITY_NAMES, Q as REGISTERED_UI, S as uiPath, T as BACKEND_PAGE_DEFS, U as installedVersion, V as packageDir, W as uiEntry, X as agentsMdVersion, Y as packageVersion, Z as doctorReport, _ as formatPreflightSummary, $ as runEnvPush, a0 as devPushRefusal } from './shared/nuxt-backend.
|
|
6
|
-
import { e as execBinary, r as runScript, p as packageManagerOf, s as setUpProject, n as nextCommands$1, f as formatNextSteps, a as setUpAgentFiles, i as installCommand } from './shared/nuxt-backend.
|
|
5
|
+
import { C as CAPABILITY_STATES, d as deploymentFunctionSpec, a as deploymentEnvNames, i as isHttpUrl, b as deploymentBackendEnvironment, c as billingEnvironment, s as siteFromCloudUrl, e as deployKeyType, r as readEnvFiles, f as runConvex, R as RESYNC_ENTITLEMENTS_FUNCTION, g as deploymentFlags, h as ConvexCliError, n as nonProductionDeployKey, j as resolveFunctionsDir, k as readTextIfPresent, l as executeEnvPush, m as generateAuthSecret, o as setDeploymentEnv, p as isLoopbackUrl, q as configuredDeployment, t as spawnConvex, B as BACKEND_ENV_NAMES, D as DERIVED_DEPLOYMENT_ENV, u as scaffoldBackendFiles, v as pathsSourceOf, w as syncPathsFile, x as backendPathsOf, y as pathsFileLocation, z as appBrandOf, A as syncBrandFile, E as brandFileLocation, F as appLabelsOf, G as syncLabelsFile, H as labelsFileLocation, I as isDevDeploymentId, M as MCP_SDK, J as computeDeployment, K as appMonitoringDsn, L as monitoringSdkInstalled, N as detectCapabilities, O as DEPLOYMENT_KIND_LABEL, P as CAPABILITY_NAMES, Q as REGISTERED_UI, S as uiPath, T as BACKEND_PAGE_DEFS, U as installedVersion, V as packageDir, W as uiEntry, X as agentsMdVersion, Y as packageVersion, Z as doctorReport, _ as formatPreflightSummary, $ as runEnvPush, a0 as devPushRefusal } from './shared/nuxt-backend.suXOnqOQ.mjs';
|
|
6
|
+
import { e as execBinary, r as runScript, p as packageManagerOf, s as setUpProject, n as nextCommands$1, f as formatNextSteps, a as setUpAgentFiles, i as installCommand } from './shared/nuxt-backend.DRuHg-IQ.mjs';
|
|
7
7
|
import { P as PROVIDER_COMPONENT, l as loadCatalog, f as freePlanOf, M as MANAGED_BY, i as isManaged, r as refuseUnpricedPlans, a as refuseInvalidPrices, b as refuseOnceCredits, c as refuseInvalidGifts, d as refuseInvalidQuotas, e as refuseInvalidDiscounts, g as listAllPages, h as refuseMissingDefaultCurrency, j as refuseMissingOrganizationCurrency, k as refuseUnpricedDiscounts, m as ensurePlanQuotas, n as retirePlan, p as pricedIntervals, o as attachRetiredPlanQuotas, q as recordQuotaKeys, s as packPricesByCurrency, t as syncPassProducts, u as syncDiscounts, v as planQuotasKeys, w as derivedPassKeys, x as droppedQuotasKeys, y as unpricedPlanProducts, z as providerClientOptions, A as planQuotasKey, B as planPricesByCurrency, C as findPlanProduct, D as isUntaggedPlanProduct, E as planCreditUnits, F as planQuotasBenefits, G as isFreePlan, H as zeroPrices, I as providerTrialOf, J as pushPlanTrial, K as attachPlanQuotas, L as BILLING_WEBHOOK_PROVISION_EVENTS, N as planProductKey, O as recordPlanProduct, Q as loadGenerated, R as renderGenerated, S as runEmailSync, T as runInboundSync, U as emailSyncLines, V as runEmailSyncCommand, W as probeWebhookRoute, X as emailSyncRefusal, Y as inboundSyncLines, Z as planSettingChanges, _ as planEndpointChanges, $ as applyProviderChanges, a0 as billingProviderTarget, a1 as providerClient, a2 as readProviderOrganization, a3 as readProviderEndpoint, a4 as ADMISSION_DAYS, a5 as CLI_ADMISSION_LABEL, a6 as admitInputRefusal, a7 as admitRefused, a8 as admitCleaned, a9 as runDoctorChecks, aa as readProductionPosture, ab as email, ac as runEnvDefaults, ad as firstAdministratorOnFix, ae as ENV_DEFAULT_TYPES } from './chunks/doctor.mjs';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
9
9
|
import { webhooksResetWebhookEndpointSecret } from '@polar-sh/sdk/funcs/webhooksResetWebhookEndpointSecret.js';
|
|
10
|
-
import { w as withContract, p as progress, f as finish, a as adoptBackendDevScript, d as dev } from './shared/nuxt-backend.
|
|
10
|
+
import { w as withContract, p as progress, f as finish, a as adoptBackendDevScript, d as dev } from './shared/nuxt-backend.BvKvJ1mo.mjs';
|
|
11
11
|
import { runAnalyze, halvesOf } from './chunks/run.mjs';
|
|
12
12
|
import { f as formatReport, b as budgetFailures, a as formatSize, p as parseSize, B as BUDGET_FLAGS } from './chunks/report.mjs';
|
|
13
13
|
import { tmpdir } from 'node:os';
|
|
@@ -29,7 +29,7 @@ import { randomBytes } from 'node:crypto';
|
|
|
29
29
|
import { spawn } from 'node:child_process';
|
|
30
30
|
import { Resend } from 'resend';
|
|
31
31
|
import { setTimeout } from 'node:timers/promises';
|
|
32
|
-
import { f as fixConvexConfig } from './shared/nuxt-backend.
|
|
32
|
+
import { f as fixConvexConfig } from './shared/nuxt-backend.zY6UDqDu.mjs';
|
|
33
33
|
import { isSandboxAddress, findCode } from '../dist/runtime/vue/utils/sandbox-code.js';
|
|
34
34
|
import { styleText } from 'node:util';
|
|
35
35
|
import { v } from 'convex/values';
|
|
@@ -3810,18 +3810,18 @@ async function addModuleToNuxtConfig(rootDir) {
|
|
|
3810
3810
|
}
|
|
3811
3811
|
}
|
|
3812
3812
|
function refreshAgentFiles(rootDir, json, print) {
|
|
3813
|
-
const { agentsMd, mcpJson, skills, messages, mcpSdkDependency } = setUpAgentFiles(rootDir, true, print);
|
|
3813
|
+
const { agentsMd, mcpJson, skills, messages, mcpSdkDependency, pnpmWorkspace } = setUpAgentFiles(rootDir, true, print);
|
|
3814
3814
|
if (agentsMd === "malformed") process.exitCode = 1;
|
|
3815
|
-
if (messages.length === 0 && !mcpSdkDependency) print(`[nuxt-backend] AGENTS.md, .mcp.json and the agent skills are current for nuxt-backend ${installedVersion(rootDir)}`);
|
|
3815
|
+
if (messages.length === 0 && !mcpSdkDependency && (pnpmWorkspace === null || pnpmWorkspace === "unchanged")) print(`[nuxt-backend] AGENTS.md, .mcp.json and the agent skills are current for nuxt-backend ${installedVersion(rootDir)}`);
|
|
3816
3816
|
if (mcpSdkDependency) print(`[nuxt-backend] Run \`${installCommand(packageManagerOf(rootDir))}\` to link it, then restart your agent.`);
|
|
3817
3817
|
if (json) {
|
|
3818
|
-
const report = { agentsMd, mcpJson, skills, mcpSdkDependency };
|
|
3818
|
+
const report = { agentsMd, mcpJson, skills, mcpSdkDependency, pnpmWorkspace };
|
|
3819
3819
|
console.log(JSON.stringify(report, null, 2));
|
|
3820
3820
|
}
|
|
3821
3821
|
}
|
|
3822
3822
|
const init = withContract("init", {
|
|
3823
3823
|
sideEffects: ["writes project files"],
|
|
3824
|
-
json: "`{ created, agentsMd, mcpJson, skills, appComponent, devScript, convexDependency, mcpSdkDependency, nuxtConfig, next }`, or `{ agentsMd, mcpJson, skills, mcpSdkDependency }` with `--agents`, where `skills` is `{ installed, refreshed, removed, stale }`, each a list of skill names; progress goes to stderr",
|
|
3824
|
+
json: "`{ created, agentsMd, mcpJson, skills, pnpmWorkspace, appComponent, devScript, convexDependency, mcpSdkDependency, nuxtConfig, next }`, or `{ agentsMd, mcpJson, skills, mcpSdkDependency, pnpmWorkspace }` with `--agents`, where `skills` is `{ installed, refreshed, removed, stale }`, each a list of skill names, and `pnpmWorkspace` is `created`, `added`, `unchanged`, `manual` or null; progress goes to stderr",
|
|
3825
3825
|
exitCodes: {
|
|
3826
3826
|
0: "done: every file written, or already in place",
|
|
3827
3827
|
1: "a file could not be written, or AGENTS.md was refused: its nuxt-backend markers don't pair up"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-backend/_nuxt/CiCAOwUc.js"}}</script><link rel="stylesheet" href="/__nuxt-backend/_nuxt/entry.DsMplBp-.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-backend/_nuxt/CiCAOwUc.js"><script type="module" src="/__nuxt-backend/_nuxt/CiCAOwUc.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-backend",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-backend/_nuxt/CiCAOwUc.js"}}</script><link rel="stylesheet" href="/__nuxt-backend/_nuxt/entry.DsMplBp-.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-backend/_nuxt/CiCAOwUc.js"><script type="module" src="/__nuxt-backend/_nuxt/CiCAOwUc.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-backend",buildId:"c3c605d8-4aba-4097-ad99-9590688ab812",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1794596760125,false]</script></body></html>
|
package/dist/module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@nuxt/kit';
|
|
2
2
|
import 'defu';
|
|
3
|
-
import './shared/nuxt-backend.
|
|
3
|
+
import './shared/nuxt-backend.suXOnqOQ.mjs';
|
|
4
4
|
import '../dist/runtime/config.js';
|
|
5
|
-
export { m as default } from './shared/nuxt-backend.
|
|
5
|
+
export { m as default } from './shared/nuxt-backend.0r1vvS1c.mjs';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:url';
|
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLogger, addPlugin, hasNuxtModule, addVitePlugin, addServerHandler, addNitroPlugin, extendRouteRules, extendPages, addTypeTemplate, addPluginTemplate, updateTemplates, addImports, addComponent, addServerImports, addRouteMiddleware, addTemplate, resolveModule, defineNuxtModule, createResolver } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
|
-
import { j as resolveFunctionsDir, T as BACKEND_PAGE_DEFS, a1 as pagePathShape, J as computeDeployment, a2 as collectPreflightFindings, N as detectCapabilities, K as appMonitoringDsn, L as monitoringSdkInstalled, a3 as OPTIONAL_DEPLOYMENT_ENV, a4 as REQUIRED_DEPLOYMENT_ENV, a5 as deriveDeploymentUrls, a6 as provisionedEnvNames, a7 as appComponentIsStarter, r as readEnvFiles, a8 as resolveSiteUrl, _ as formatPreflightSummary, a9 as needsSetup, aa as AGENT_HINT, ab as HEALTH_ROUTE, ac as LOCAL_LOG_ROUTE, ad as monitoringSdkVersion, ae as MONITORING_SDK, af as TUNNEL_SDK_VERSION, ag as SOURCE_MAP_ENV, ah as sdkServesTunnel, ai as installableProblems, aj as pagesOptionProblems, ak as resolvedBackendPages, al as DEFAULT_AUTH_ROUTE, Q as REGISTERED_UI, am as publishedBackendPages, an as isPageOff, ao as privatePagePaths, ap as collectExistingPagePaths, aq as adoptChildPages, ar as pageRouteRules, as as cachingRulesOver, V as packageDir, z as appBrandOf, A as syncBrandFile, E as brandFileLocation, F as appLabelsOf, G as syncLabelsFile, H as labelsFileLocation, at as PUSH_WORKER_URL, au as ownsManifest, av as MANIFEST_MODULES, aw as namedIconWarnings, ax as installableGaps, ay as installIcons, az as webAppManifest, aA as maskableIcons, aB as MANIFEST_ROUTE, aC as APPLE_TOUCH_ICON, aD as themeColorMeta, w as syncPathsFile, x as backendPathsOf, y as pathsFileLocation, S as uiPath, aE as UI_SHARED_STYLES, aF as UI_ENTRIES, aG as UI_INTERNALS, aH as moduleDir, aI as VISITOR_IP_ROUTE, aJ as resolvePagePath, aK as dependencyRange, aL as runsFromSource, Y as packageVersion } from './nuxt-backend.
|
|
3
|
+
import { j as resolveFunctionsDir, T as BACKEND_PAGE_DEFS, a1 as pagePathShape, J as computeDeployment, a2 as collectPreflightFindings, N as detectCapabilities, K as appMonitoringDsn, L as monitoringSdkInstalled, a3 as OPTIONAL_DEPLOYMENT_ENV, a4 as REQUIRED_DEPLOYMENT_ENV, a5 as deriveDeploymentUrls, a6 as provisionedEnvNames, a7 as appComponentIsStarter, r as readEnvFiles, a8 as resolveSiteUrl, _ as formatPreflightSummary, a9 as needsSetup, aa as AGENT_HINT, ab as HEALTH_ROUTE, ac as LOCAL_LOG_ROUTE, ad as monitoringSdkVersion, ae as MONITORING_SDK, af as TUNNEL_SDK_VERSION, ag as SOURCE_MAP_ENV, ah as sdkServesTunnel, ai as installableProblems, aj as pagesOptionProblems, ak as resolvedBackendPages, al as DEFAULT_AUTH_ROUTE, Q as REGISTERED_UI, am as publishedBackendPages, an as isPageOff, ao as privatePagePaths, ap as collectExistingPagePaths, aq as adoptChildPages, ar as pageRouteRules, as as cachingRulesOver, V as packageDir, z as appBrandOf, A as syncBrandFile, E as brandFileLocation, F as appLabelsOf, G as syncLabelsFile, H as labelsFileLocation, at as PUSH_WORKER_URL, au as ownsManifest, av as MANIFEST_MODULES, aw as namedIconWarnings, ax as installableGaps, ay as installIcons, az as webAppManifest, aA as maskableIcons, aB as MANIFEST_ROUTE, aC as APPLE_TOUCH_ICON, aD as themeColorMeta, w as syncPathsFile, x as backendPathsOf, y as pathsFileLocation, S as uiPath, aE as UI_SHARED_STYLES, aF as UI_ENTRIES, aG as UI_INTERNALS, aH as moduleDir, aI as VISITOR_IP_ROUTE, aJ as resolvePagePath, aK as dependencyRange, aL as runsFromSource, Y as packageVersion } from './nuxt-backend.suXOnqOQ.mjs';
|
|
4
4
|
import { backendAppConfigDefaults } from '../../dist/runtime/config.js';
|
|
5
5
|
import { readFileSync, existsSync, readdirSync, realpathSync } from 'node:fs';
|
|
6
6
|
import { join, resolve, extname, dirname } from 'node:path';
|
|
@@ -204,7 +204,7 @@ function runPreflight(options, nuxt) {
|
|
|
204
204
|
});
|
|
205
205
|
if (appComponentIsStarter(nuxt.options.rootDir)) {
|
|
206
206
|
logger.warn(
|
|
207
|
-
"app.vue still renders <NuxtWelcome /> and no <NuxtPage />, so the pages this module registers (/login, /pricing, \u2026) will not render. Replace <NuxtWelcome /> with <NuxtLayout><NuxtPage /></NuxtLayout> \u2014 `npx nuxt-backend init` does it for you, and adds the app shell as the default layout
|
|
207
|
+
"app.vue still renders <NuxtWelcome /> and no <NuxtPage />, so the pages this module registers (/login, /pricing, \u2026) will not render. Replace <NuxtWelcome /> with <NuxtLayout><NuxtPage /></NuxtLayout> \u2014 `npx nuxt-backend init` does it for you, and adds the app shell as the default layout and a home page at /."
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
reportPreflight(findings);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bI as CAPABILITIES, aO as BACKEND_ENV, j as resolveFunctionsDir, u as scaffoldBackendFiles, q as configuredDeployment, I as isDevDeploymentId, bJ as isEnvProvisioned, a0 as devPushRefusal, bK as markEnvProvisioned, b2 as finding, $ as runEnvPush, t as spawnConvex } from './nuxt-backend.suXOnqOQ.mjs';
|
|
2
2
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { resolve, join, delimiter } from 'node:path';
|
|
4
4
|
import { defineCommand } from 'citty';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
-
import { join, dirname } from 'node:path';
|
|
5
|
-
import { u as scaffoldBackendFiles,
|
|
6
|
-
import { a as adoptBackendDevScript, r as renderEnvExample } from './nuxt-backend.
|
|
4
|
+
import { join, dirname, relative } from 'node:path';
|
|
5
|
+
import { aR as PROJECT_SKILLS, aS as CORE_SKILL, k as readTextIfPresent, u as scaffoldBackendFiles, aT as mountPagesInAppComponent, aU as ensureDefaultLayout, aV as ensureIndexPage, aW as writeAgentFiles, U as installedVersion, M as MCP_SDK, V as packageDir } from './nuxt-backend.suXOnqOQ.mjs';
|
|
6
|
+
import { a as adoptBackendDevScript, r as renderEnvExample } from './nuxt-backend.BvKvJ1mo.mjs';
|
|
7
7
|
|
|
8
8
|
const LOCKFILES = [
|
|
9
9
|
["pnpm-lock.yaml", "pnpm"],
|
|
@@ -48,6 +48,121 @@ function execBinary(manager, binary) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const PNPM_WORKSPACE = "pnpm-workspace.yaml";
|
|
52
|
+
const PERMISSIONS_SINCE = { major: 12, minor: 11 };
|
|
53
|
+
const ENTRY_COMMENT = "# The nuxt-backend agent skills are in .agents/skills, where `npx nuxt-backend init` copies them";
|
|
54
|
+
function pinnedPnpm(rootDir) {
|
|
55
|
+
try {
|
|
56
|
+
const field = JSON.parse(readFileSync(join(rootDir, "package.json"), "utf8")).packageManager;
|
|
57
|
+
return typeof field === "string" ? /^pnpm@(\d+\.\d+\.\d+)/.exec(field)?.[1] : void 0;
|
|
58
|
+
} catch {
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function pnpmVersionIn(rootDir) {
|
|
63
|
+
const known = pinnedPnpm(rootDir) ?? /^pnpm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent ?? "")?.[1];
|
|
64
|
+
if (known) return known;
|
|
65
|
+
const result = spawnSync("pnpm", ["--version"], { cwd: rootDir, encoding: "utf8", shell: process.platform === "win32", timeout: 1e4 });
|
|
66
|
+
return result.status === 0 ? /\d+\.\d+\.\d+/.exec(result.stdout)?.[0] : void 0;
|
|
67
|
+
}
|
|
68
|
+
function pnpmReadsPermissions(version) {
|
|
69
|
+
const [major = 0, minor = 0] = (version ?? "").split(".").map(Number);
|
|
70
|
+
return major > PERMISSIONS_SINCE.major || major === PERMISSIONS_SINCE.major && minor >= PERMISSIONS_SINCE.minor;
|
|
71
|
+
}
|
|
72
|
+
function pnpmWorkspaceFile(rootDir) {
|
|
73
|
+
for (let dir = rootDir; ; dir = dirname(dir)) {
|
|
74
|
+
const path = join(dir, PNPM_WORKSPACE);
|
|
75
|
+
const source = readTextIfPresent(path);
|
|
76
|
+
if (source !== void 0) return { path, source };
|
|
77
|
+
if (dir === dirname(dir)) return { path: join(rootDir, PNPM_WORKSPACE) };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function keyAt(line, indent) {
|
|
81
|
+
const rest = line.startsWith(indent) ? line.slice(indent.length) : "";
|
|
82
|
+
const colon = rest.search(/:(?:\s|$)/);
|
|
83
|
+
if (colon <= 0 || /^[\s#\-{[!&*?|>]/.test(rest)) return void 0;
|
|
84
|
+
return rest.slice(0, colon).trim().replace(/^(["'])(.*)\1$/, "$2");
|
|
85
|
+
}
|
|
86
|
+
const indentOf = (line) => /^ */.exec(line)[0];
|
|
87
|
+
const isContent = (line) => line.trim() !== "" && !line.trimStart().startsWith("#");
|
|
88
|
+
function blockAfter(lines, index, indent) {
|
|
89
|
+
const block = [];
|
|
90
|
+
for (let at = index + 1; at < lines.length; at++) {
|
|
91
|
+
const line = lines[at];
|
|
92
|
+
if (isContent(line) && indentOf(line).length <= indent.length) break;
|
|
93
|
+
block.push(at);
|
|
94
|
+
}
|
|
95
|
+
return block;
|
|
96
|
+
}
|
|
97
|
+
function isBlockMapping(lines) {
|
|
98
|
+
const content = lines.filter(isContent).filter((line) => !line.startsWith("%"));
|
|
99
|
+
if (/^---\s*(?:#.*)?$/.test(content[0] ?? "")) content.shift();
|
|
100
|
+
if (content.some((line) => /^(?:---|\.\.\.)(?:\s|$)/.test(line))) return false;
|
|
101
|
+
return content.length === 0 || keyAt(content[0], "") !== void 0;
|
|
102
|
+
}
|
|
103
|
+
const inlineValue = (line) => line.slice(line.indexOf(":") + 1).replace(/\s#.*$/, "").trim();
|
|
104
|
+
const entryLines = (indent, step) => [`${indent}${ENTRY_COMMENT}`, `${indent}${CORE_SKILL.name}:`, `${indent}${step}skills: false`];
|
|
105
|
+
function denyPnpmSkills(source) {
|
|
106
|
+
if (source === void 0) return { action: "created", content: ["permissions:", ...entryLines(" ", " "), ""].join("\n") };
|
|
107
|
+
const eol = source.includes("\r\n") ? "\r\n" : "\n";
|
|
108
|
+
const lines = source.split(/\r?\n/);
|
|
109
|
+
if (!isBlockMapping(lines)) return { action: "manual" };
|
|
110
|
+
const top = lines.findIndex((line) => keyAt(line, "") === "permissions");
|
|
111
|
+
if (top === -1) {
|
|
112
|
+
const end = lines.at(-1) === "" ? lines.length - 1 : lines.length;
|
|
113
|
+
lines.splice(end, 0, "permissions:", ...entryLines(" ", " "));
|
|
114
|
+
if (lines.at(-1) !== "") lines.push("");
|
|
115
|
+
return { action: "added", content: lines.join(eol) };
|
|
116
|
+
}
|
|
117
|
+
const action = denyUnderPermissions(lines, top);
|
|
118
|
+
return action === "added" ? { action, content: lines.join(eol) } : { action };
|
|
119
|
+
}
|
|
120
|
+
function blockKeys(lines, at, indent, fallback) {
|
|
121
|
+
const keys = blockAfter(lines, at, indent).filter((index) => isContent(lines[index]));
|
|
122
|
+
if (keys.length === 0) return { keys, indent: fallback };
|
|
123
|
+
const inner = indentOf(lines[keys[0]]);
|
|
124
|
+
return keyAt(lines[keys[0]], inner) === void 0 ? void 0 : { keys, indent: inner };
|
|
125
|
+
}
|
|
126
|
+
function denyUnderPermissions(lines, top) {
|
|
127
|
+
if (inlineValue(lines[top]) !== "") return "manual";
|
|
128
|
+
const packages = blockKeys(lines, top, "", " ");
|
|
129
|
+
if (!packages) return "manual";
|
|
130
|
+
const own = packages.keys.find((at) => keyAt(lines[at], packages.indent) === CORE_SKILL.name);
|
|
131
|
+
if (own === void 0) {
|
|
132
|
+
lines.splice(top + 1, 0, ...entryLines(packages.indent, packages.indent));
|
|
133
|
+
return "added";
|
|
134
|
+
}
|
|
135
|
+
const value = inlineValue(lines[own]);
|
|
136
|
+
if (value !== "") return /\bskills\s*:/.test(value) ? "unchanged" : "manual";
|
|
137
|
+
const settings = blockKeys(lines, own, packages.indent, packages.indent.repeat(2));
|
|
138
|
+
if (!settings) return "manual";
|
|
139
|
+
if (settings.keys.some((at) => keyAt(lines[at], settings.indent) === "skills")) return "unchanged";
|
|
140
|
+
lines.splice(own + 1, 0, `${settings.indent}skills: false`);
|
|
141
|
+
return "added";
|
|
142
|
+
}
|
|
143
|
+
function recordPnpmSkillsDenial(rootDir, { version = pnpmVersionIn } = {}) {
|
|
144
|
+
if (packageManagerOf(rootDir) !== "pnpm") return null;
|
|
145
|
+
if (!existsSync(join(rootDir, PROJECT_SKILLS, CORE_SKILL.name, "SKILL.md"))) return null;
|
|
146
|
+
if (!pnpmReadsPermissions(version(rootDir))) return null;
|
|
147
|
+
const { path, source } = pnpmWorkspaceFile(rootDir);
|
|
148
|
+
const { action, content } = denyPnpmSkills(source);
|
|
149
|
+
if (content !== void 0) writeFileSync(path, content, { flag: source === void 0 ? "wx" : "w" });
|
|
150
|
+
return { action, file: relative(rootDir, path).replace(/\\/g, "/") };
|
|
151
|
+
}
|
|
152
|
+
function pnpmWorkspaceMessage({ action, file }) {
|
|
153
|
+
const why = `its agent skills are in ${PROJECT_SKILLS} already, so pnpm links no second copy and stops listing it as awaiting approval`;
|
|
154
|
+
switch (action) {
|
|
155
|
+
case "created":
|
|
156
|
+
return `Created ${file} with skills: false for nuxt-backend under permissions: ${why}`;
|
|
157
|
+
case "added":
|
|
158
|
+
return `Added skills: false for nuxt-backend under permissions in ${file}: ${why}`;
|
|
159
|
+
case "manual":
|
|
160
|
+
return `${file} is written in a form init does not edit line by line (a flow mapping, or more than one document), so it was left alone. Run \`pnpm approve '!nuxt-backend'\`: the agent skills are in ${PROJECT_SKILLS} already`;
|
|
161
|
+
default:
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
51
166
|
const ENV_EXAMPLE = renderEnvExample();
|
|
52
167
|
function declareConvexDependency(rootDir) {
|
|
53
168
|
return declarePeer(rootDir, "convex", "dependencies");
|
|
@@ -93,8 +208,13 @@ function setUpProject(rootDir, { force = false, agents = true, print }) {
|
|
|
93
208
|
created.push(layout);
|
|
94
209
|
print(`[nuxt-backend] Created ${layout}: <AppShell> around your pages, with the brand, the workspace switcher and the account menu`);
|
|
95
210
|
}
|
|
211
|
+
const indexPage = ensureIndexPage(rootDir);
|
|
212
|
+
if (indexPage) {
|
|
213
|
+
created.push(indexPage);
|
|
214
|
+
print(`[nuxt-backend] Created ${indexPage}: the home page, with the app's name and a link to sign in, since nothing answered at /`);
|
|
215
|
+
}
|
|
96
216
|
const agentFiles = agents ? setUpAgentFiles(rootDir, force, print) : null;
|
|
97
|
-
return { created, agentsMd: agentFiles?.agentsMd ?? null, mcpJson: agentFiles?.mcpJson ?? null, skills: agentFiles?.skills ?? null, appComponent, ...adoptProjectFiles(rootDir, print), mcpSdkDependency: agentFiles?.mcpSdkDependency ?? null };
|
|
217
|
+
return { created, agentsMd: agentFiles?.agentsMd ?? null, mcpJson: agentFiles?.mcpJson ?? null, skills: agentFiles?.skills ?? null, pnpmWorkspace: agentFiles?.pnpmWorkspace ?? null, appComponent, ...adoptProjectFiles(rootDir, print), mcpSdkDependency: agentFiles?.mcpSdkDependency ?? null };
|
|
98
218
|
}
|
|
99
219
|
function writeEnvExample(rootDir, force, print) {
|
|
100
220
|
const envExamplePath = join(rootDir, ".env.example");
|
|
@@ -108,7 +228,10 @@ function setUpAgentFiles(rootDir, force, print) {
|
|
|
108
228
|
for (const message of agentFiles.messages) print(`[nuxt-backend] ${message}`);
|
|
109
229
|
const mcpSdkDependency = declareMcpSdkDependency(rootDir) ?? null;
|
|
110
230
|
if (mcpSdkDependency) print(`[nuxt-backend] Added ${MCP_SDK}@${mcpSdkDependency} to devDependencies (the nuxt-backend server in .mcp.json runs on it)`);
|
|
111
|
-
|
|
231
|
+
const pnpmWorkspace = recordPnpmSkillsDenial(rootDir);
|
|
232
|
+
const pnpmMessage = pnpmWorkspace && pnpmWorkspaceMessage(pnpmWorkspace);
|
|
233
|
+
if (pnpmMessage) print(`[nuxt-backend] ${pnpmMessage}`);
|
|
234
|
+
return { ...agentFiles, mcpSdkDependency, pnpmWorkspace: pnpmWorkspace?.action ?? null };
|
|
112
235
|
}
|
|
113
236
|
function adoptProjectFiles(rootDir, print) {
|
|
114
237
|
const devScript = adoptBackendDevScript(rootDir);
|
|
@@ -2253,7 +2253,7 @@ function parsePathsFile(text) {
|
|
|
2253
2253
|
var __freeze = Object.freeze;
|
|
2254
2254
|
var __defProp = Object.defineProperty;
|
|
2255
2255
|
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
2256
|
-
var _a;
|
|
2256
|
+
var _a, _b;
|
|
2257
2257
|
const AUTH_CONFIG_TEMPLATE = dedent`
|
|
2258
2258
|
import { defineBackendAuthConfig } from 'nuxt-backend/auth.config'
|
|
2259
2259
|
import { paths } from './paths.generated'
|
|
@@ -2832,6 +2832,63 @@ const BACKEND_FILE_TEMPLATES = {
|
|
|
2832
2832
|
[LABELS_FILE]: renderLabelsFile({})
|
|
2833
2833
|
};
|
|
2834
2834
|
const DEFAULT_LAYOUT_TEMPLATE = dedent(_a || (_a = __template(['\n <script setup lang="ts">\n // The frame of the app: the header with your brand, the workspace switcher,\n // the notification bell and the account menu, then the app-wide notices and\n // your page. Put your links in the `nav` slot, and your buttons before the\n // account menu in `actions`. `<AppShell :switcher="false">` hides the\n // switcher for an app whose people never share a workspace.\n const { brand } = useBackendConfig()\n <\/script>\n\n <template>\n <AppShell>\n <template #brand>\n <NuxtLink to="/">\n {{ brand.name || \'Your app\' }}\n </NuxtLink>\n </template>\n <slot />\n </AppShell>\n </template>\n '], ['\n <script setup lang="ts">\n // The frame of the app: the header with your brand, the workspace switcher,\n // the notification bell and the account menu, then the app-wide notices and\n // your page. Put your links in the \\`nav\\` slot, and your buttons before the\n // account menu in \\`actions\\`. \\`<AppShell :switcher="false">\\` hides the\n // switcher for an app whose people never share a workspace.\n const { brand } = useBackendConfig()\n <\/script>\n\n <template>\n <AppShell>\n <template #brand>\n <NuxtLink to="/">\n {{ brand.name || \'Your app\' }}\n </NuxtLink>\n </template>\n <slot />\n </AppShell>\n </template>\n ']))) + "\n";
|
|
2835
|
+
const DEFAULT_INDEX_PAGE_TEMPLATE = dedent(_b || (_b = __template([`
|
|
2836
|
+
<script setup lang="ts">
|
|
2837
|
+
// The app's home page, which \`npx nuxt-backend init\` wrote because nothing
|
|
2838
|
+
// answered at /: make it yours. It names the app, and links to the sign-in
|
|
2839
|
+
// page, or to the account once signed in.
|
|
2840
|
+
const { brand } = useBackendConfig()
|
|
2841
|
+
const { isSignedIn } = useAuth()
|
|
2842
|
+
const login = useBackendPagePath('login')
|
|
2843
|
+
const profile = useBackendPagePath('profile')
|
|
2844
|
+
<\/script>
|
|
2845
|
+
|
|
2846
|
+
<template>
|
|
2847
|
+
<div>
|
|
2848
|
+
<h1>{{ brand.name || 'Your app' }}</h1>
|
|
2849
|
+
<NuxtLink
|
|
2850
|
+
v-if="isSignedIn && profile"
|
|
2851
|
+
:to="profile"
|
|
2852
|
+
>
|
|
2853
|
+
Your account
|
|
2854
|
+
</NuxtLink>
|
|
2855
|
+
<NuxtLink
|
|
2856
|
+
v-else-if="!isSignedIn && login"
|
|
2857
|
+
:to="login"
|
|
2858
|
+
>
|
|
2859
|
+
Sign in
|
|
2860
|
+
</NuxtLink>
|
|
2861
|
+
</div>
|
|
2862
|
+
</template>
|
|
2863
|
+
`], [`
|
|
2864
|
+
<script setup lang="ts">
|
|
2865
|
+
// The app's home page, which \\\`npx nuxt-backend init\\\` wrote because nothing
|
|
2866
|
+
// answered at /: make it yours. It names the app, and links to the sign-in
|
|
2867
|
+
// page, or to the account once signed in.
|
|
2868
|
+
const { brand } = useBackendConfig()
|
|
2869
|
+
const { isSignedIn } = useAuth()
|
|
2870
|
+
const login = useBackendPagePath('login')
|
|
2871
|
+
const profile = useBackendPagePath('profile')
|
|
2872
|
+
<\/script>
|
|
2873
|
+
|
|
2874
|
+
<template>
|
|
2875
|
+
<div>
|
|
2876
|
+
<h1>{{ brand.name || 'Your app' }}</h1>
|
|
2877
|
+
<NuxtLink
|
|
2878
|
+
v-if="isSignedIn && profile"
|
|
2879
|
+
:to="profile"
|
|
2880
|
+
>
|
|
2881
|
+
Your account
|
|
2882
|
+
</NuxtLink>
|
|
2883
|
+
<NuxtLink
|
|
2884
|
+
v-else-if="!isSignedIn && login"
|
|
2885
|
+
:to="login"
|
|
2886
|
+
>
|
|
2887
|
+
Sign in
|
|
2888
|
+
</NuxtLink>
|
|
2889
|
+
</div>
|
|
2890
|
+
</template>
|
|
2891
|
+
`]))) + "\n";
|
|
2835
2892
|
|
|
2836
2893
|
const DEFAULT_FUNCTIONS_DIR = "backend";
|
|
2837
2894
|
const STANDARD_FUNCTIONS_DIR = "convex";
|
|
@@ -2905,8 +2962,71 @@ function normalizeFunctionsDir(functionsDir) {
|
|
|
2905
2962
|
const normalized = functionsDir.replace(/^\.?\//, "").replace(/\/+$/, "");
|
|
2906
2963
|
return normalized || void 0;
|
|
2907
2964
|
}
|
|
2965
|
+
const NUXT_CONFIG_FILES = ["nuxt.config.ts", "nuxt.config.js", "nuxt.config.mjs", "nuxt.config.mts"];
|
|
2966
|
+
const withoutComments = (code) => code.replace(/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\/[^\n]*|\/\*[\s\S]*?\*\//g, (match) => match.startsWith("/") ? " " : match);
|
|
2967
|
+
function closingQuote(code, open) {
|
|
2968
|
+
let at = open + 1;
|
|
2969
|
+
while (at < code.length && code[at] !== code[open]) at += code[at] === "\\" ? 2 : 1;
|
|
2970
|
+
return at;
|
|
2971
|
+
}
|
|
2972
|
+
function objectProperties(code, open) {
|
|
2973
|
+
const properties = /* @__PURE__ */ new Map();
|
|
2974
|
+
const add = (entry) => {
|
|
2975
|
+
if (entry.trim().startsWith("...")) properties.set("...", entry.trim());
|
|
2976
|
+
const match = /^(?:(["'])([^"']+)\1|([\w$]+))\s*:([\s\S]*)$/.exec(entry.trim());
|
|
2977
|
+
if (match) properties.set(match[2] ?? match[3], match[4].trim());
|
|
2978
|
+
};
|
|
2979
|
+
let depth = 0;
|
|
2980
|
+
let start = open + 1;
|
|
2981
|
+
for (let at = open; at < code.length; at++) {
|
|
2982
|
+
const char = code[at];
|
|
2983
|
+
if ("\"'`".includes(char)) {
|
|
2984
|
+
at = closingQuote(code, at);
|
|
2985
|
+
} else if ("{[(".includes(char)) {
|
|
2986
|
+
depth++;
|
|
2987
|
+
} else if ("}])".includes(char) && --depth === 0) {
|
|
2988
|
+
add(code.slice(start, at));
|
|
2989
|
+
break;
|
|
2990
|
+
} else if (char === "," && depth === 1) {
|
|
2991
|
+
add(code.slice(start, at));
|
|
2992
|
+
start = at + 1;
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
return properties;
|
|
2996
|
+
}
|
|
2997
|
+
const stringValue = (value) => /^(["'`])([^"'`$\\]+)\1$/.exec(value ?? "")?.[2];
|
|
2998
|
+
function readSourceConfig(dir) {
|
|
2999
|
+
const source = NUXT_CONFIG_FILES.map((name) => readTextIfPresent(join(dir, name))).find((text) => text !== void 0) ?? "";
|
|
3000
|
+
const code = withoutComments(source);
|
|
3001
|
+
const open = /\bdefineNuxtConfig\s*\(\s*\{|\bexport\s+default\s*\{/.exec(code);
|
|
3002
|
+
const config = open ? objectProperties(code, open.index + open[0].length - 1) : /* @__PURE__ */ new Map();
|
|
3003
|
+
const folders = config.get("dir");
|
|
3004
|
+
const unread = code.trim() !== "" && (!open || config.has("..."));
|
|
3005
|
+
return {
|
|
3006
|
+
srcDir: stringValue(config.get("srcDir")),
|
|
3007
|
+
pages: folders?.startsWith("{") ? stringValue(objectProperties(folders, 0).get("pages")) : void 0,
|
|
3008
|
+
extendsLayer: unread || config.has("extends")
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
function sourceDir(dir, config = readSourceConfig(dir)) {
|
|
3012
|
+
if (config.srcDir) return resolve(dir, config.srcDir);
|
|
3013
|
+
const app = join(dir, "app");
|
|
3014
|
+
let files;
|
|
3015
|
+
try {
|
|
3016
|
+
files = readdirSync(app);
|
|
3017
|
+
} catch {
|
|
3018
|
+
return dir;
|
|
3019
|
+
}
|
|
3020
|
+
if (files.some((file) => file !== "spa-loading-template.html" && !file.startsWith("router.options"))) return app;
|
|
3021
|
+
const legacy = ["app.vue", "App.vue", "assets", "layouts", "middleware", config.pages ?? "pages", "plugins"];
|
|
3022
|
+
return legacy.some((name) => existsSync(resolve(dir, name))) ? dir : app;
|
|
3023
|
+
}
|
|
3024
|
+
function pagesDir(dir, config = readSourceConfig(dir)) {
|
|
3025
|
+
return resolve(sourceDir(dir, config), config.pages ?? "pages");
|
|
3026
|
+
}
|
|
2908
3027
|
function resolveAppComponent(rootDir) {
|
|
2909
|
-
|
|
3028
|
+
const folder = sourceDir(rootDir);
|
|
3029
|
+
return ["app.vue", "App.vue"].map((file) => join(folder, file)).filter(existsSync).map((path) => ({ name: relative(rootDir, path).replace(/\\/g, "/"), path }))[0];
|
|
2910
3030
|
}
|
|
2911
3031
|
function appComponentIsStarter(rootDir) {
|
|
2912
3032
|
const component = resolveAppComponent(rootDir);
|
|
@@ -2934,6 +3054,45 @@ function ensureDefaultLayout(rootDir) {
|
|
|
2934
3054
|
writeFileSync(join(folder, "default.vue"), DEFAULT_LAYOUT_TEMPLATE);
|
|
2935
3055
|
return join(dirname(component.name), "layouts/default.vue").replace(/\\/g, "/").replace(/^\.\//, "");
|
|
2936
3056
|
}
|
|
3057
|
+
const ROOT_PAGE_FILE = /^(?:index|\[\[[^\]]+\]\]|\[\.\.\.[^\]]+\])(?:\.(?:client|server))?\.(?:vue|[cm]?[jt]sx?)$/;
|
|
3058
|
+
const ROOT_PAGE_FOLDER = /^(?:index|\(.+\)|\[\[[^\]]+\]\]|\[\.\.\.[^\]]+\])$/;
|
|
3059
|
+
const PAGE_FILE = /\.(?:vue|[cm]?[jt]sx?)$/;
|
|
3060
|
+
const withoutStrings = (code) => code.replace(/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/g, (match) => `${match[0]}${" ".repeat(match.length - 2)}${match[0]}`);
|
|
3061
|
+
function declaresRootPath(path) {
|
|
3062
|
+
const source = readTextIfPresent(path) ?? "";
|
|
3063
|
+
const script = path.endsWith(".vue") ? [...source.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\b[^>]*>/gi)].map((match) => match[1]).join("\n") : source;
|
|
3064
|
+
const code = withoutComments(script);
|
|
3065
|
+
const call = /\bdefinePageMeta\s*\(\s*\{/.exec(withoutStrings(code));
|
|
3066
|
+
return call !== null && stringValue(objectProperties(code, call.index + call[0].length - 1).get("path")) === "/";
|
|
3067
|
+
}
|
|
3068
|
+
function pagesServeRoot(dir, atRoot = true) {
|
|
3069
|
+
let entries;
|
|
3070
|
+
try {
|
|
3071
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
3072
|
+
} catch {
|
|
3073
|
+
return false;
|
|
3074
|
+
}
|
|
3075
|
+
return entries.some((entry) => {
|
|
3076
|
+
const path = join(dir, entry.name);
|
|
3077
|
+
if (entry.isDirectory()) return pagesServeRoot(path, atRoot && ROOT_PAGE_FOLDER.test(entry.name));
|
|
3078
|
+
return atRoot && ROOT_PAGE_FILE.test(entry.name) || PAGE_FILE.test(entry.name) && declaresRootPath(path);
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
function localLayerPages(rootDir) {
|
|
3082
|
+
const layers = join(rootDir, "layers");
|
|
3083
|
+
if (!existsSync(layers)) return [];
|
|
3084
|
+
return readdirSync(layers, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => pagesDir(join(layers, entry.name)));
|
|
3085
|
+
}
|
|
3086
|
+
function ensureIndexPage(rootDir) {
|
|
3087
|
+
const component = resolveAppComponent(rootDir);
|
|
3088
|
+
if (!component || !readFileSync(component.path, "utf-8").includes("<NuxtPage")) return void 0;
|
|
3089
|
+
const config = readSourceConfig(rootDir);
|
|
3090
|
+
if (config.extendsLayer) return void 0;
|
|
3091
|
+
const pages = pagesDir(rootDir, config);
|
|
3092
|
+
if ([pages, ...localLayerPages(rootDir)].some((folder) => pagesServeRoot(folder))) return void 0;
|
|
3093
|
+
const page = join(pages, "index.vue");
|
|
3094
|
+
return writeUnlessPresent(page, DEFAULT_INDEX_PAGE_TEMPLATE) ? relative(rootDir, page).replace(/\\/g, "/") : void 0;
|
|
3095
|
+
}
|
|
2937
3096
|
|
|
2938
3097
|
const STRINGS_AND_COMMENTS = /(['"`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*[\s\S]*?\*\/|\/\/[^\n]*/g;
|
|
2939
3098
|
function sourceFiles(dir) {
|
|
@@ -4122,4 +4281,4 @@ const UI_SHARED_STYLES = [
|
|
|
4122
4281
|
{ file: "admin/admin.css", capability: "auth" }
|
|
4123
4282
|
];
|
|
4124
4283
|
|
|
4125
|
-
export { runEnvPush as $, syncBrandFile as A, BACKEND_ENV_NAMES as B, CAPABILITY_STATES as C, DERIVED_DEPLOYMENT_ENV as D, brandFileLocation as E, appLabelsOf as F, syncLabelsFile as G, labelsFileLocation as H, isDevDeploymentId as I, computeDeployment as J, appMonitoringDsn as K, monitoringSdkInstalled as L, MCP_SDK as M, detectCapabilities as N, DEPLOYMENT_KIND_LABEL as O, CAPABILITY_NAMES as P, REGISTERED_UI as Q, RESYNC_ENTITLEMENTS_FUNCTION as R, uiPath as S, BACKEND_PAGE_DEFS as T, installedVersion as U, packageDir as V, uiEntry as W, agentsMdVersion as X, packageVersion as Y, doctorReport as Z, formatPreflightSummary as _, deploymentEnvNames as a,
|
|
4284
|
+
export { runEnvPush as $, syncBrandFile as A, BACKEND_ENV_NAMES as B, CAPABILITY_STATES as C, DERIVED_DEPLOYMENT_ENV as D, brandFileLocation as E, appLabelsOf as F, syncLabelsFile as G, labelsFileLocation as H, isDevDeploymentId as I, computeDeployment as J, appMonitoringDsn as K, monitoringSdkInstalled as L, MCP_SDK as M, detectCapabilities as N, DEPLOYMENT_KIND_LABEL as O, CAPABILITY_NAMES as P, REGISTERED_UI as Q, RESYNC_ENTITLEMENTS_FUNCTION as R, uiPath as S, BACKEND_PAGE_DEFS as T, installedVersion as U, packageDir as V, uiEntry as W, agentsMdVersion as X, packageVersion as Y, doctorReport as Z, formatPreflightSummary as _, deploymentEnvNames as a, envNames as a$, devPushRefusal as a0, pagePathShape as a1, collectPreflightFindings as a2, OPTIONAL_DEPLOYMENT_ENV as a3, REQUIRED_DEPLOYMENT_ENV as a4, deriveDeploymentUrls as a5, provisionedEnvNames as a6, appComponentIsStarter as a7, resolveSiteUrl as a8, needsSetup as a9, maskableIcons as aA, MANIFEST_ROUTE as aB, APPLE_TOUCH_ICON as aC, themeColorMeta as aD, UI_SHARED_STYLES as aE, UI_ENTRIES as aF, UI_INTERNALS as aG, moduleDir as aH, VISITOR_IP_ROUTE as aI, resolvePagePath as aJ, dependencyRange as aK, runsFromSource as aL, resolveConvexCli as aM, RECENT_SIGN_IN_SECONDS as aN, BACKEND_ENV as aO, capabilityOfEnv as aP, REMOVED_DEPLOYMENT_ENV as aQ, PROJECT_SKILLS as aR, CORE_SKILL as aS, mountPagesInAppComponent as aT, ensureDefaultLayout as aU, ensureIndexPage as aV, writeAgentFiles as aW, isDevDeployment as aX, RPC_NAMESPACE as aY, DEVTOOLS_UI_ROUTE as aZ, DEVTOOLS_UI_LOCAL_PORT as a_, AGENT_HINT as aa, HEALTH_ROUTE as ab, LOCAL_LOG_ROUTE as ac, monitoringSdkVersion as ad, MONITORING_SDK as ae, TUNNEL_SDK_VERSION as af, SOURCE_MAP_ENV as ag, sdkServesTunnel as ah, installableProblems as ai, pagesOptionProblems as aj, resolvedBackendPages as ak, DEFAULT_AUTH_ROUTE as al, publishedBackendPages as am, isPageOff as an, privatePagePaths as ao, collectExistingPagePaths as ap, adoptChildPages as aq, pageRouteRules as ar, cachingRulesOver as as, PUSH_WORKER_URL as at, ownsManifest as au, MANIFEST_MODULES as av, namedIconWarnings as aw, installableGaps as ax, installIcons as ay, webAppManifest as az, deploymentBackendEnvironment as b, DEV_ONLY_DEPLOYMENT_ENV as b0, DEV_SITE_URL as b1, finding as b2, parseBackendEnvironment as b3, proofKeys as b4, TEST_CHALLENGE_SITE_KEYS as b5, deploymentEnvId as b6, protectionTakes as b7, TEST_CHALLENGE_SECRET_KEYS as b8, PROTECTED_AUTH_ROUTES as b9, namesModerationModel as bA, GATEWAY_ORDER_UNREAD as bB, routeKeyFor as bC, installableFinding as bD, gatewayKeyIsTheFix as bE, DEFAULT_MODERATION_MODEL as bF, mountsComponent as bG, GATEWAY_KEY_FIX as bH, CAPABILITIES as bI, isEnvProvisioned as bJ, markEnvProvisioned as bK, readSource as bL, parse as bM, keyOf$1 as bN, writeSource as bO, REMOVED_ENV as bP, applyEdits as bQ, walk as bR, BACKEND_FILE_TEMPLATES as bS, PROOF_HEADER as ba, signProof as bb, proofAudience as bc, deploymentSiteOrigin as bd, isLocalDeploymentId as be, capabilityOfGroup as bf, agentFilesFinding as bg, chosenRoutes as bh, chosenGateways as bi, pinnedRegion as bj, namedModels as bk, usesProvenance as bl, moderationProviders as bm, monitoringDsnFinding as bn, monitoringFindings as bo, usageAlertsFinding as bp, readUsageLimits as bq, applyProductionPosture as br, billingWebhookSecretHint as bs, BACKEND_PATH_KEYS as bt, pathOption as bu, aiFeatures as bv, pathsFileFinding as bw, brandFileFinding as bx, labelsFileFinding as by, checksImages as bz, billingEnvironment as c, deploymentFunctionSpec as d, deployKeyType as e, runConvex as f, deploymentFlags as g, ConvexCliError as h, isHttpUrl as i, resolveFunctionsDir as j, readTextIfPresent as k, executeEnvPush as l, generateAuthSecret as m, nonProductionDeployKey as n, setDeploymentEnv as o, isLoopbackUrl as p, configuredDeployment as q, readEnvFiles as r, siteFromCloudUrl as s, spawnConvex as t, scaffoldBackendFiles as u, pathsSourceOf as v, syncPathsFile as w, backendPathsOf as x, pathsFileLocation as y, appBrandOf as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
import { b2 as finding, j as resolveFunctionsDir, bL as readSource, bM as parse, bN as keyOf, bO as writeSource, bP as REMOVED_ENV, bQ as applyEdits, bR as walk, bS as BACKEND_FILE_TEMPLATES } from './nuxt-backend.suXOnqOQ.mjs';
|
|
5
5
|
|
|
6
6
|
const LAST_SCAFFOLD_MOUNT = "@convex-dev/workpool/convex.config";
|
|
7
7
|
const OPTIONAL_MOUNTS = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "nuxt-backend",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"description": "The complete backend for a Nuxt app on Convex: passwordless sign-in with passkeys, workspaces, plans and credits, email, notifications and metered AI, with the pages that use them, in one module.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"fflate": "^0.8.3",
|
|
192
192
|
"magicast": "^0.5.4",
|
|
193
193
|
"nanostores": "^1.5.5",
|
|
194
|
-
"nuxt-convex-module": "^0.14.
|
|
194
|
+
"nuxt-convex-module": "^0.14.3",
|
|
195
195
|
"nuxt-security": "^2.7.0",
|
|
196
196
|
"resend": "^6.35.0",
|
|
197
197
|
"standardwebhooks": "^1.1.1",
|
|
@@ -467,7 +467,7 @@ Scaffold the backend files, .env.example, and nuxt.config wiring (re-run to rest
|
|
|
467
467
|
- `--no-agents`: Coding-agent files: --agents rewrites only AGENTS.md's nuxt-backend section, .mcp.json and the agent skills in .agents/skills for the installed version, and adds the MCP SDK to devDependencies when missing; --no-agents skips them all
|
|
468
468
|
- `--json`: Machine-readable output
|
|
469
469
|
|
|
470
|
-
`--json`: `{ created, agentsMd, mcpJson, skills, appComponent, devScript, convexDependency, mcpSdkDependency, nuxtConfig, next }`, or `{ agentsMd, mcpJson, skills, mcpSdkDependency }` with `--agents`, where `skills` is `{ installed, refreshed, removed, stale }`, each a list of skill names; progress goes to stderr.
|
|
470
|
+
`--json`: `{ created, agentsMd, mcpJson, skills, pnpmWorkspace, appComponent, devScript, convexDependency, mcpSdkDependency, nuxtConfig, next }`, or `{ agentsMd, mcpJson, skills, mcpSdkDependency, pnpmWorkspace }` with `--agents`, where `skills` is `{ installed, refreshed, removed, stale }`, each a list of skill names, and `pnpmWorkspace` is `created`, `added`, `unchanged`, `manual` or null; progress goes to stderr.
|
|
471
471
|
|
|
472
472
|
### `npx nuxt-backend dev`
|
|
473
473
|
|
|
@@ -70,8 +70,9 @@ npx nuxt-backend init
|
|
|
70
70
|
and the CLI that runs them. `init` writes the backend files (`backend/`, or into the existing
|
|
71
71
|
functions folder), `convex.json` when that folder is not `convex/`, `.env.example`, an
|
|
72
72
|
`AGENTS.md` section, `.mcp.json` and the agent skills in `.agents/skills/` for agents, adds `'nuxt-backend'` to `modules`, points the
|
|
73
|
-
`dev` script at `nuxt-backend dev`,
|
|
74
|
-
`app/app.vue` so the module's pages render
|
|
73
|
+
`dev` script at `nuxt-backend dev`, swaps `<NuxtWelcome />` for `<NuxtPage />` in an untouched
|
|
74
|
+
`app/app.vue` so the module's pages render, and writes `app/pages/index.vue` when no page answers
|
|
75
|
+
`/` and the app extends no layer. It never replaces a file that exists.
|
|
75
76
|
|
|
76
77
|
Check what `init` printed:
|
|
77
78
|
|
|
@@ -110,9 +111,11 @@ pnpm notes:
|
|
|
110
111
|
- pnpm's default layout hides the Convex components nuxt-backend brings, and Convex needs to
|
|
111
112
|
resolve them: add `publicHoistPattern: ['@convex-dev/*']` to `pnpm-workspace.yaml`, then install
|
|
112
113
|
again. (Apps made from the starter carry both settings in `.pnpmfile.mjs`.)
|
|
113
|
-
- pnpm 12 lists nuxt-backend under "Agent skills awaiting approval"
|
|
114
|
-
those skills in `.agents/skills`, and approving links a
|
|
115
|
-
|
|
114
|
+
- pnpm 12 lists nuxt-backend under "Agent skills awaiting approval" until its skills are approved
|
|
115
|
+
or denied. `init` already installed those skills in `.agents/skills`, and approving links a
|
|
116
|
+
second copy of each, so under pnpm 12.11 or later `init` denies them in `pnpm-workspace.yaml`
|
|
117
|
+
(`skills: false` under `permissions`). When pnpm still lists nuxt-backend (an app set up under
|
|
118
|
+
pnpm 11), run `npx nuxt-backend init --agents`, or suggest `pnpm approve '!nuxt-backend'`.
|
|
116
119
|
|
|
117
120
|
## 2. Start it: the deployment, its env, the generated code
|
|
118
121
|
|