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.
@@ -0,0 +1,2 @@
1
+ export declare const NPX: string;
2
+ export declare const NPM: string;
@@ -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
+ }
@@ -1,7 +1,8 @@
1
1
  import { execa } from 'execa';
2
2
  import path from 'path';
3
+ import { NPX } from './bin-paths.js';
3
4
  export async function createNextApp(name) {
4
- await execa('npx', [
5
+ await execa(NPX, [
5
6
  'create-next-app@latest',
6
7
  name,
7
8
  '--typescript',
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
- await execa('npm', ['install', 'zod', 'zustand', 'luxon'], { cwd: projectPath });
22
- await execa('npm', ['install', '-D', '@types/luxon'], { cwd: projectPath });
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('1.0.1')
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('npm', ['install', ...allPackages], { cwd: projectPath });
47
+ await execa(NPM, ['install', ...allPackages], { cwd: projectPath });
47
48
  }
48
49
  if (allDevPackages.length > 0) {
49
- await execa('npm', ['install', '-D', ...allDevPackages], { cwd: projectPath });
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) {
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ import './bin-paths.js';
@@ -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
- const nodeBinDir = path.dirname(process.execPath);
7
- if (!process.env.PATH?.includes(nodeBinDir)) {
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: '1.0.1',
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 () => {
@@ -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
- // Initialize shadcn/ui with defaults
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
- // Add commonly used components
14
- await execa('npx', [
13
+ await execa(NPX, [
15
14
  'shadcn@latest',
16
15
  'add',
17
16
  'button',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-loadout",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Custom Next.js scaffolding CLI with optional SaaS integrations",
5
5
  "type": "module",
6
6
  "bin": {