spaps 0.1.0

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.
Files changed (3) hide show
  1. package/README.md +73 -0
  2. package/bin/spaps.js +128 -0
  3. package/package.json +49 -0
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # spaps
2
+
3
+ > Sweet Potato Authentication & Payment Service CLI
4
+
5
+ Zero-config local development for SPAPS authentication and payments.
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ npx spaps local
11
+ ```
12
+
13
+ That's it! Your local SPAPS server is running at http://localhost:3300 🚀
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install -g spaps
19
+ # or
20
+ yarn global add spaps
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ### `spaps local`
26
+ Start a local SPAPS development server with:
27
+ - No API keys required
28
+ - Auto-authentication enabled
29
+ - Test users (user/admin/premium)
30
+ - CORS configured for any frontend
31
+
32
+ ```bash
33
+ spaps local
34
+ # Server running at http://localhost:3300
35
+ ```
36
+
37
+ ### `spaps init`
38
+ Initialize SPAPS in an existing project:
39
+ ```bash
40
+ spaps init
41
+ # Creates .env.local with minimal config
42
+ # Adds SPAPS SDK to package.json
43
+ ```
44
+
45
+ ### `spaps create <name>` (Coming Soon)
46
+ Create a new project with SPAPS pre-configured:
47
+ ```bash
48
+ spaps create my-app
49
+ # Choose framework: Next.js, React, Node.js
50
+ # Includes authentication examples
51
+ ```
52
+
53
+ ### `spaps types` (Coming Soon)
54
+ Generate TypeScript types from your SPAPS setup:
55
+ ```bash
56
+ spaps types > types/spaps.d.ts
57
+ ```
58
+
59
+ ## Local Mode Features
60
+
61
+ - **Zero Configuration**: Just run and go
62
+ - **Auto Authentication**: No API keys needed
63
+ - **Test Users**: Switch between user/admin/premium
64
+ - **CORS Enabled**: Works with any frontend
65
+ - **Production Safe**: Can't accidentally run in production
66
+
67
+ ## Documentation
68
+
69
+ Full documentation at [sweetpotato.dev](https://sweetpotato.dev)
70
+
71
+ ## License
72
+
73
+ MIT
package/bin/spaps.js ADDED
@@ -0,0 +1,128 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SPAPS CLI - Sweet Potato Authentication & Payment Service
5
+ *
6
+ * This is a minimal implementation to secure the npm package name.
7
+ * Full implementation coming soon!
8
+ */
9
+
10
+ const chalk = require('chalk');
11
+ const { program } = require('commander');
12
+ const { spawn } = require('child_process');
13
+ const path = require('path');
14
+ const fs = require('fs');
15
+
16
+ const version = require('../package.json').version;
17
+
18
+ // ASCII Art Logo
19
+ const logo = `
20
+ ${chalk.yellow('🍠 SPAPS')} - Sweet Potato Authentication & Payment Service
21
+ `;
22
+
23
+ program
24
+ .name('spaps')
25
+ .description('CLI for Sweet Potato Authentication & Payment Service')
26
+ .version(version);
27
+
28
+ // Local command - Start local development server
29
+ program
30
+ .command('local')
31
+ .description('Start local SPAPS server (no API keys required!)')
32
+ .option('-p, --port <port>', 'Port to run on', '3300')
33
+ .action((options) => {
34
+ console.log(logo);
35
+ console.log(chalk.green('🚀 Starting SPAPS local development server...'));
36
+ console.log(chalk.dim(` Port: ${options.port}`));
37
+ console.log(chalk.dim(' Mode: Local Development (auto-auth enabled)'));
38
+ console.log();
39
+
40
+ // For now, just show instructions
41
+ // TODO: Actually spawn the server process
42
+ console.log(chalk.yellow('📦 Local mode coming soon!'));
43
+ console.log();
44
+ console.log('For now, run SPAPS locally with:');
45
+ console.log(chalk.cyan(' git clone https://github.com/yourusername/sweet-potato'));
46
+ console.log(chalk.cyan(' cd sweet-potato'));
47
+ console.log(chalk.cyan(' npm install'));
48
+ console.log(chalk.cyan(' npm run dev'));
49
+ console.log();
50
+ console.log('Full CLI functionality coming in v0.2.0! 🚀');
51
+ });
52
+
53
+ // Init command - Initialize SPAPS in existing project
54
+ program
55
+ .command('init')
56
+ .description('Initialize SPAPS in your project')
57
+ .action(() => {
58
+ console.log(logo);
59
+ console.log(chalk.green('🔧 Initializing SPAPS...'));
60
+ console.log();
61
+
62
+ // Create minimal .env.local
63
+ const envContent = `# SPAPS Local Development Configuration
64
+ # No API keys needed for local development!
65
+
66
+ SPAPS_API_URL=http://localhost:3300
67
+ NODE_ENV=development
68
+
69
+ # When you're ready for production:
70
+ # SPAPS_API_KEY=your-api-key-here
71
+ `;
72
+
73
+ if (!fs.existsSync('.env.local')) {
74
+ fs.writeFileSync('.env.local', envContent);
75
+ console.log(chalk.green('✅ Created .env.local'));
76
+ } else {
77
+ console.log(chalk.yellow('⚠️ .env.local already exists'));
78
+ }
79
+
80
+ console.log();
81
+ console.log(chalk.green('✨ SPAPS initialized!'));
82
+ console.log();
83
+ console.log('Next steps:');
84
+ console.log(chalk.cyan(' 1. Run: npx spaps local'));
85
+ console.log(chalk.cyan(' 2. Install SDK: npm install @spaps/sdk'));
86
+ console.log(chalk.cyan(' 3. Start coding!'));
87
+ });
88
+
89
+ // Create command (placeholder)
90
+ program
91
+ .command('create <name>')
92
+ .description('Create a new project with SPAPS (coming soon)')
93
+ .action((name) => {
94
+ console.log(logo);
95
+ console.log(chalk.yellow(`🚧 'spaps create' coming in v0.3.0!`));
96
+ console.log();
97
+ console.log('For now, check out our examples:');
98
+ console.log(chalk.cyan(' https://github.com/yourusername/sweet-potato/tree/main/examples'));
99
+ });
100
+
101
+ // Types command (placeholder)
102
+ program
103
+ .command('types')
104
+ .description('Generate TypeScript types (coming soon)')
105
+ .action(() => {
106
+ console.log(logo);
107
+ console.log(chalk.yellow(`🚧 'spaps types' coming in v0.4.0!`));
108
+ });
109
+
110
+ // Help command enhancement
111
+ program.on('--help', () => {
112
+ console.log();
113
+ console.log('Examples:');
114
+ console.log();
115
+ console.log(' $ spaps local # Start local dev server');
116
+ console.log(' $ spaps init # Initialize in current project');
117
+ console.log(' $ spaps create my-app # Create new project (soon)');
118
+ console.log();
119
+ console.log('Learn more at https://sweetpotato.dev');
120
+ });
121
+
122
+ // Show help if no command provided
123
+ if (!process.argv.slice(2).length) {
124
+ console.log(logo);
125
+ program.outputHelp();
126
+ }
127
+
128
+ program.parse(process.argv);
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "spaps",
3
+ "version": "0.1.0",
4
+ "description": "Sweet Potato Authentication & Payment Service CLI - Zero-config local development and project scaffolding",
5
+ "main": "bin/spaps.js",
6
+ "bin": {
7
+ "spaps": "./bin/spaps.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"No tests yet\""
11
+ },
12
+ "keywords": [
13
+ "authentication",
14
+ "payments",
15
+ "stripe",
16
+ "supabase",
17
+ "local-development",
18
+ "cli",
19
+ "spaps",
20
+ "sweet-potato",
21
+ "wallet-auth",
22
+ "solana",
23
+ "ethereum"
24
+ ],
25
+ "author": "buildooor",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/yourusername/sweet-potato"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/yourusername/sweet-potato/issues"
33
+ },
34
+ "homepage": "https://sweetpotato.dev",
35
+ "dependencies": {
36
+ "chalk": "^4.1.2",
37
+ "commander": "^11.1.0",
38
+ "ora": "^5.4.1",
39
+ "prompts": "^2.4.2",
40
+ "axios": "^1.6.0"
41
+ },
42
+ "engines": {
43
+ "node": ">=16.0.0"
44
+ },
45
+ "files": [
46
+ "bin",
47
+ "README.md"
48
+ ]
49
+ }