create-loadout 1.0.4 → 1.0.5
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/dist/bin-paths.d.ts +2 -0
- package/dist/bin-paths.js +7 -0
- package/dist/create-next.js +2 -1
- package/dist/engine.js +3 -2
- package/dist/index.js +4 -1
- package/dist/integrations/index.js +3 -2
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.js +5 -5
- package/dist/setup-shadcn.js +3 -4
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
const nodeBinDir = path.dirname(process.execPath);
|
|
3
|
+
export const NPX = path.join(nodeBinDir, 'npx');
|
|
4
|
+
export const NPM = path.join(nodeBinDir, 'npm');
|
|
5
|
+
if (!process.env.PATH?.includes(nodeBinDir)) {
|
|
6
|
+
process.env.PATH = `${nodeBinDir}:${process.env.PATH || ''}`;
|
|
7
|
+
}
|
package/dist/create-next.js
CHANGED
package/dist/engine.js
CHANGED
|
@@ -18,8 +18,9 @@ export async function createProject(config, onProgress) {
|
|
|
18
18
|
await extendUtils(projectPath);
|
|
19
19
|
onProgress?.('Installing base packages...');
|
|
20
20
|
const { execa } = await import('execa');
|
|
21
|
-
|
|
22
|
-
await execa(
|
|
21
|
+
const { NPM } = await import('./bin-paths.js');
|
|
22
|
+
await execa(NPM, ['install', 'zod', 'zustand', 'luxon'], { cwd: projectPath });
|
|
23
|
+
await execa(NPM, ['install', '-D', '@types/luxon'], { cwd: projectPath });
|
|
23
24
|
await fs.mkdir(path.join(projectPath, 'lib/stores'), { recursive: true });
|
|
24
25
|
await fs.writeFile(path.join(projectPath, 'lib/stores/counter.store.ts'), zustandTemplates.exampleStore);
|
|
25
26
|
if (config.integrations.length > 0) {
|
package/dist/index.js
CHANGED
|
@@ -7,11 +7,14 @@ import { listIntegrations } from './metadata.js';
|
|
|
7
7
|
import { isExistingProject, getInstalledIntegrations } from './detect.js';
|
|
8
8
|
import fs from 'fs/promises';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
import { createRequire } from 'module';
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const { version } = require('../package.json');
|
|
10
13
|
const program = new Command();
|
|
11
14
|
program
|
|
12
15
|
.name('create-loadout')
|
|
13
16
|
.description('Custom Next.js scaffolding with SaaS integrations')
|
|
14
|
-
.version(
|
|
17
|
+
.version(version)
|
|
15
18
|
.argument('[name]', 'Project name')
|
|
16
19
|
.option('--clerk', 'Add Clerk authentication')
|
|
17
20
|
.option('--neon-drizzle', 'Add Neon + Drizzle database')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
|
+
import { NPM } from '../bin-paths.js';
|
|
2
3
|
import { clerkIntegration } from './clerk.js';
|
|
3
4
|
import { neonDrizzleIntegration } from './neon-drizzle.js';
|
|
4
5
|
import { createAiSdkIntegration } from './ai-sdk.js';
|
|
@@ -43,10 +44,10 @@ export async function installIntegrations(projectPath, config) {
|
|
|
43
44
|
}
|
|
44
45
|
// Install all packages at once
|
|
45
46
|
if (allPackages.length > 0) {
|
|
46
|
-
await execa(
|
|
47
|
+
await execa(NPM, ['install', ...allPackages], { cwd: projectPath });
|
|
47
48
|
}
|
|
48
49
|
if (allDevPackages.length > 0) {
|
|
49
|
-
await execa(
|
|
50
|
+
await execa(NPM, ['install', '-D', ...allDevPackages], { cwd: projectPath });
|
|
50
51
|
}
|
|
51
52
|
// Run setup for each integration
|
|
52
53
|
for (const id of config.integrations) {
|
package/dist/mcp-server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import './bin-paths.js';
|
package/dist/mcp-server.js
CHANGED
|
@@ -3,17 +3,17 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
process.env.PATH = `${nodeBinDir}:${process.env.PATH || ''}`;
|
|
9
|
-
}
|
|
6
|
+
import { createRequire } from 'module';
|
|
7
|
+
import './bin-paths.js';
|
|
10
8
|
import { createProject, addIntegrations } from './engine.js';
|
|
11
9
|
import { validateProjectConfig, validateIntegrationSelection, } from './validate.js';
|
|
12
10
|
import { listIntegrations } from './metadata.js';
|
|
13
11
|
import { isExistingProject, getInstalledIntegrations, getAvailableIntegrations, } from './detect.js';
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const { version } = require('../package.json');
|
|
14
14
|
const server = new McpServer({
|
|
15
15
|
name: 'create-loadout',
|
|
16
|
-
version
|
|
16
|
+
version,
|
|
17
17
|
});
|
|
18
18
|
// Tool: list_integrations
|
|
19
19
|
server.tool('list_integrations', 'List all available integrations with metadata, env vars, and constraints', {}, async () => {
|
package/dist/setup-shadcn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
|
+
import { NPX } from './bin-paths.js';
|
|
2
3
|
export async function setupShadcn(projectPath) {
|
|
3
|
-
|
|
4
|
-
await execa('npx', [
|
|
4
|
+
await execa(NPX, [
|
|
5
5
|
'shadcn@latest',
|
|
6
6
|
'init',
|
|
7
7
|
'-y',
|
|
@@ -10,8 +10,7 @@ export async function setupShadcn(projectPath) {
|
|
|
10
10
|
cwd: projectPath,
|
|
11
11
|
stdio: 'pipe',
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
await execa('npx', [
|
|
13
|
+
await execa(NPX, [
|
|
15
14
|
'shadcn@latest',
|
|
16
15
|
'add',
|
|
17
16
|
'button',
|