nuxt-backend 0.4.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 +5 -2
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/doctor.mjs +4 -4
- 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 +8 -8
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +4 -4
- package/dist/cli.mjs +13 -56
- package/dist/devtools-client/index.html +1 -1
- package/dist/module.js +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/vue/components/auth/InviteRedeem.vue +4 -22
- package/dist/runtime/vue/components/auth/WaitlistStatus.vue +7 -17
- package/dist/runtime/vue/components/billing/PricingTable.vue +17 -51
- package/dist/runtime/vue/components/billing/ReferralLanding.vue +1 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +15 -18
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +1 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +2 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +9 -22
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +2 -2
- package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +12 -16
- package/dist/runtime/vue/components/workspaces/workspace-billing.js +22 -37
- package/dist/runtime/vue/composables/use-access.d.ts +18 -0
- package/dist/runtime/vue/composables/use-access.js +33 -6
- package/dist/runtime/vue/composables/use-billing-section.d.ts +115 -0
- package/dist/runtime/vue/composables/use-billing-section.js +76 -0
- package/dist/runtime/vue/composables/use-gift-form.js +7 -24
- package/dist/runtime/vue/composables/use-gift-list.d.ts +18 -1
- package/dist/runtime/vue/composables/use-gift-list.js +6 -1
- package/dist/runtime/vue/composables/use-plan-change.d.ts +148 -0
- package/dist/runtime/vue/composables/use-plan-change.js +130 -0
- package/dist/runtime/vue/composables/use-pricing.d.ts +29 -0
- package/dist/runtime/vue/composables/use-pricing.js +53 -14
- package/dist/runtime/vue/composables/use-referral-invite.d.ts +7 -0
- package/dist/runtime/vue/composables/use-referral-invite.js +4 -1
- package/dist/runtime/vue/composables/use-waitlist.d.ts +18 -0
- package/dist/runtime/vue/composables/use-waitlist.js +24 -0
- package/dist/runtime/vue/pages/pricing.vue +1 -2
- package/dist/runtime/vue/plugins/checkout-return.js +9 -2
- package/dist/runtime/vue/utils/checkout-return.d.ts +11 -1
- package/dist/runtime/vue/utils/checkout-return.js +6 -2
- package/dist/runtime/vue/utils/gift-days.d.ts +20 -0
- package/dist/runtime/vue/utils/gift-days.js +32 -0
- package/dist/runtime/vue/utils/namespace.js +7 -2
- package/dist/runtime/vue/utils/page-open.d.ts +1 -0
- package/dist/runtime/vue/utils/page-open.js +12 -0
- package/dist/runtime/vue/utils/plan-change-confirm.d.ts +38 -26
- package/dist/runtime/vue/utils/plan-change-confirm.js +25 -16
- package/dist/runtime/vue/utils/pricing-checkout.d.ts +39 -0
- package/dist/runtime/vue/utils/pricing-checkout.js +22 -0
- package/dist/runtime/vue/utils/tab-keep.d.ts +3 -1
- package/dist/runtime/vue/utils/tab-keep.js +1 -1
- package/dist/shared/{nuxt-backend.CbR37s_c.mjs → nuxt-backend.0r1vvS1c.mjs} +24 -4
- package/dist/shared/{nuxt-backend.BjQoqNIu.mjs → nuxt-backend.BvKvJ1mo.mjs} +1 -1
- package/dist/shared/nuxt-backend.DRuHg-IQ.mjs +290 -0
- package/dist/shared/{nuxt-backend.9IVxzzft.mjs → nuxt-backend.suXOnqOQ.mjs} +163 -4
- package/dist/shared/{nuxt-backend.Baxb382E.mjs → nuxt-backend.zY6UDqDu.mjs} +1 -1
- package/package.json +2 -2
- package/skills/nuxt-backend/references/api.md +3 -1
- package/skills/nuxt-backend/references/install.md +9 -3
- package/skills/nuxt-backend/references/renames.json +8 -0
- package/skills/nuxt-backend/references/surface.json +2 -0
- package/skills/nuxt-backend-billing/SKILL.md +9 -0
- package/skills/nuxt-backend-billing/references/api.md +2 -0
- package/skills/nuxt-backend-upgrade/references/upgrade.md +6 -0
- package/src/runtime/vue/components/auth/InviteRedeem.vue +5 -26
- package/src/runtime/vue/components/auth/WaitlistStatus.vue +11 -20
- package/src/runtime/vue/components/billing/PricingTable.vue +25 -82
- package/src/runtime/vue/components/billing/ReferralLanding.vue +1 -2
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +21 -25
- package/src/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +1 -2
- package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +16 -29
- package/src/runtime/vue/pages/pricing.vue +1 -4
- package/dist/shared/nuxt-backend.BCjeoX0x.mjs +0 -119
|
@@ -3,7 +3,6 @@ import { useHead, useRuntimeConfig, useSeoMeta } from '#imports'
|
|
|
3
3
|
import PageFrame from '../components/shell/PageFrame.vue'
|
|
4
4
|
import { useLabels } from '../composables/use-labels'
|
|
5
5
|
import { usePricing } from '../composables/use-pricing'
|
|
6
|
-
import { pricingStructuredData } from '../utils/pricing-seo'
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* The ready-made public pricing page, registered by the module at `/pricing`
|
|
@@ -31,9 +30,7 @@ if (seo) {
|
|
|
31
30
|
key: 'backend-pricing',
|
|
32
31
|
type: 'application/ld+json',
|
|
33
32
|
// An object: the head manager serializes it, and escapes what could end the script early.
|
|
34
|
-
innerHTML: () =>
|
|
35
|
-
? pricingStructuredData({ plans: pricing.plans.value, packs: pricing.packs.value })
|
|
36
|
-
: ''),
|
|
33
|
+
innerHTML: () => pricing.structuredData.value ?? '',
|
|
37
34
|
}],
|
|
38
35
|
})
|
|
39
36
|
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
3
|
-
import { createRequire } from 'node:module';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { u as scaffoldBackendFiles, aR as mountPagesInAppComponent, aS as ensureDefaultLayout, aT as writeAgentFiles, U as installedVersion, M as MCP_SDK, V as packageDir } from './nuxt-backend.9IVxzzft.mjs';
|
|
6
|
-
import { a as adoptBackendDevScript, r as renderEnvExample } from './nuxt-backend.BjQoqNIu.mjs';
|
|
7
|
-
|
|
8
|
-
const ENV_EXAMPLE = renderEnvExample();
|
|
9
|
-
function declareConvexDependency(rootDir) {
|
|
10
|
-
return declarePeer(rootDir, "convex", "dependencies");
|
|
11
|
-
}
|
|
12
|
-
function declareMcpSdkDependency(rootDir) {
|
|
13
|
-
return declarePeer(rootDir, MCP_SDK, "devDependencies");
|
|
14
|
-
}
|
|
15
|
-
function declarePeer(rootDir, name, field) {
|
|
16
|
-
const manifestPath = join(rootDir, "package.json");
|
|
17
|
-
let source;
|
|
18
|
-
let manifest;
|
|
19
|
-
try {
|
|
20
|
-
source = readFileSync(manifestPath, "utf-8");
|
|
21
|
-
manifest = JSON.parse(source);
|
|
22
|
-
} catch {
|
|
23
|
-
return void 0;
|
|
24
|
-
}
|
|
25
|
-
if (manifest.dependencies?.[name] || manifest.devDependencies?.[name]) return void 0;
|
|
26
|
-
let range;
|
|
27
|
-
try {
|
|
28
|
-
const installed = JSON.parse(readFileSync(createRequire(manifestPath).resolve(`${name}/package.json`), "utf-8"));
|
|
29
|
-
range = `^${installed.version}`;
|
|
30
|
-
} catch {
|
|
31
|
-
const own = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf-8"));
|
|
32
|
-
range = own.peerDependencies?.[name];
|
|
33
|
-
}
|
|
34
|
-
if (!range) return void 0;
|
|
35
|
-
const entries = Object.fromEntries(
|
|
36
|
-
Object.entries({ ...manifest[field], [name]: range }).sort(([a], [b]) => a.localeCompare(b))
|
|
37
|
-
);
|
|
38
|
-
const indent = /^(\s+)"/m.exec(source)?.[1] ?? " ";
|
|
39
|
-
const eol = source.endsWith("\n") ? "\n" : "";
|
|
40
|
-
writeFileSync(manifestPath, JSON.stringify({ ...manifest, [field]: entries }, null, indent) + eol);
|
|
41
|
-
return range;
|
|
42
|
-
}
|
|
43
|
-
function setUpProject(rootDir, { force = false, agents = true, print }) {
|
|
44
|
-
const created = scaffoldBackendFiles(rootDir, { force, log: print });
|
|
45
|
-
if (writeEnvExample(rootDir, force, print)) created.push(".env.example");
|
|
46
|
-
const appComponent = mountPagesInAppComponent(rootDir) ?? null;
|
|
47
|
-
if (appComponent) print(`[nuxt-backend] Replaced <NuxtWelcome /> with <NuxtLayout><NuxtPage /></NuxtLayout> in ${appComponent} so the module's pages render`);
|
|
48
|
-
const layout = ensureDefaultLayout(rootDir);
|
|
49
|
-
if (layout) {
|
|
50
|
-
created.push(layout);
|
|
51
|
-
print(`[nuxt-backend] Created ${layout}: <AppShell> around your pages, with the brand, the workspace switcher and the account menu`);
|
|
52
|
-
}
|
|
53
|
-
const agentFiles = agents ? setUpAgentFiles(rootDir, force, print) : null;
|
|
54
|
-
return { created, agentsMd: agentFiles?.agentsMd ?? null, mcpJson: agentFiles?.mcpJson ?? null, skills: agentFiles?.skills ?? null, appComponent, ...adoptProjectFiles(rootDir, print), mcpSdkDependency: agentFiles?.mcpSdkDependency ?? null };
|
|
55
|
-
}
|
|
56
|
-
function writeEnvExample(rootDir, force, print) {
|
|
57
|
-
const envExamplePath = join(rootDir, ".env.example");
|
|
58
|
-
if (!force && existsSync(envExamplePath)) return false;
|
|
59
|
-
writeFileSync(envExamplePath, ENV_EXAMPLE);
|
|
60
|
-
print("[nuxt-backend] Created .env.example");
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
function setUpAgentFiles(rootDir, force, print) {
|
|
64
|
-
const agentFiles = writeAgentFiles(rootDir, { force, version: installedVersion(rootDir) });
|
|
65
|
-
for (const message of agentFiles.messages) print(`[nuxt-backend] ${message}`);
|
|
66
|
-
const mcpSdkDependency = declareMcpSdkDependency(rootDir) ?? null;
|
|
67
|
-
if (mcpSdkDependency) print(`[nuxt-backend] Added ${MCP_SDK}@${mcpSdkDependency} to devDependencies (the nuxt-backend server in .mcp.json runs on it)`);
|
|
68
|
-
return { ...agentFiles, mcpSdkDependency };
|
|
69
|
-
}
|
|
70
|
-
function adoptProjectFiles(rootDir, print) {
|
|
71
|
-
const devScript = adoptBackendDevScript(rootDir);
|
|
72
|
-
if (devScript?.changed) {
|
|
73
|
-
print(`[nuxt-backend] Set scripts.dev to \`${devScript.script}\`: one command sets up the deployment, provisions its env and runs Convex beside Nuxt`);
|
|
74
|
-
}
|
|
75
|
-
const convexDependency = declareConvexDependency(rootDir) ?? null;
|
|
76
|
-
if (convexDependency) {
|
|
77
|
-
print(`[nuxt-backend] Added convex@${convexDependency} to dependencies (\`npx convex dev\` needs the app itself to declare it)`);
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
devScript: devScript?.changed ? devScript.script : null,
|
|
81
|
-
convexDependency,
|
|
82
|
-
start: devScript ? "npm run dev" : "npx nuxt-backend dev"
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function addedDependencies(setup) {
|
|
86
|
-
return Boolean(setup.convexDependency || setup.mcpSdkDependency);
|
|
87
|
-
}
|
|
88
|
-
function nextCommands(setup, { installed = false } = {}) {
|
|
89
|
-
return [...addedDependencies(setup) && !installed ? ["npm install"] : [], setup.start];
|
|
90
|
-
}
|
|
91
|
-
function formatNextSteps(setup, { installed = false } = {}) {
|
|
92
|
-
const comment = (command, text) => ` ${command.padEnd(27)}# ${text}`;
|
|
93
|
-
const added = setup.convexDependency && setup.mcpSdkDependency ? "convex and the MCP SDK, added above" : setup.convexDependency ? "the convex dependency added above" : "the MCP SDK added above";
|
|
94
|
-
const install = addedDependencies(setup) && !installed ? [comment("npm install", `links ${added}`)] : [];
|
|
95
|
-
return [
|
|
96
|
-
"Next steps:",
|
|
97
|
-
...install,
|
|
98
|
-
comment(setup.start, "the first run sets up your Convex dev deployment (log in"),
|
|
99
|
-
comment("", "when asked) and provisions its env, then runs Convex and Nuxt"),
|
|
100
|
-
" Sign in at /login: in development, the sign-in code prints in the same terminal."
|
|
101
|
-
].join("\n");
|
|
102
|
-
}
|
|
103
|
-
function installDeclaredDependencies(rootDir, packageManager) {
|
|
104
|
-
const options = { cwd: rootDir, shell: process.platform === "win32", stdio: "inherit" };
|
|
105
|
-
switch (packageManager) {
|
|
106
|
-
case "npm":
|
|
107
|
-
return spawnSync("npm", ["install"], options).status === 0;
|
|
108
|
-
case "pnpm":
|
|
109
|
-
return spawnSync("pnpm", ["install"], options).status === 0;
|
|
110
|
-
case "yarn":
|
|
111
|
-
return spawnSync("yarn", ["install"], options).status === 0;
|
|
112
|
-
case "bun":
|
|
113
|
-
return spawnSync("bun", ["install"], options).status === 0;
|
|
114
|
-
default:
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export { setUpAgentFiles as a, addedDependencies as b, formatNextSteps as f, installDeclaredDependencies as i, nextCommands as n, setUpProject as s };
|