Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/configurable-nodes/configurable-node-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export function extractInputsFromValue(
let val: ConfigurableValue = _val as any;

if (!isConfigurableValue(val)) {
console.warn(
`Value ${key} isn't a valid ConfigurableValue, converting to dynamic`
);
// console.warn(
// `Value ${key} isn't a valid ConfigurableValue, converting to dynamic`
// );
val = configurableValue("dynamic", `{{${key}}}`);
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/configurable-nodes/configurable-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ export function processConfigurableNode(node: CodeNode, secrets: Record<string,

let configValue = config[key];
if (!isConfigurableValue(configValue)) {
console.warn(
`Config value ${key} isn't a valid ConfigurableValue, converting to dynamic`
);
// console.warn(
// `Config value ${key} isn't a valid ConfigurableValue, converting to dynamic`
// );
configValue = configurableValue("dynamic", configValue);
}

Expand Down
1 change: 1 addition & 0 deletions create-flyde-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"start": "node dist/index.js",
"prepublishOnly": "npm run build"
},
"dependencies": {
Expand Down
190 changes: 159 additions & 31 deletions create-flyde-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ async function main() {
const userId = generateAnonymousId();
const systemInfo = getSystemInfo();

console.log(chalk.blue('🚀 Welcome to Flyde!'));
console.log(chalk.gray('Creating your visual flow project...\n'));
console.log();
console.log(chalk.cyan.bold(' 🚀 Welcome to Flyde!'));
console.log(chalk.dim(' Create visual flow-based programs with TypeScript'));
console.log();

// Get project name from args or prompt
let projectName = process.argv[2];
Expand All @@ -47,33 +49,72 @@ async function main() {
const response = await prompts({
type: 'text',
name: 'projectName',
message: 'Project name:',
message: 'Project name',
initial: 'my-flyde-project'
});

if (!response.projectName) {
console.log(chalk.red('❌ Project creation cancelled.'));
console.log(chalk.yellow('\n⚠ Project creation cancelled'));
process.exit(0);
}

projectName = response.projectName;
}

// Report project name selected
reportEvent(userId, 'create-project:name-selected', {
...systemInfo,
fromArgs: !!process.argv[2]
});

// IDE selection
const ideResponse = await prompts({
type: 'select',
name: 'ide',
message: 'Which editor are you using?',
choices: [
{ title: 'VS Code', value: 'vscode' },
{ title: 'Cursor', value: 'cursor' },
{ title: 'Windsurf', value: 'windsurf' },
{ title: 'Other', value: 'other' }
],
initial: 0
});

if (!ideResponse.ide) {
console.log(chalk.yellow('\n⚠ Project creation cancelled'));
process.exit(0);
}

const ide = ideResponse.ide;

// Report IDE selected
reportEvent(userId, 'create-project:ide-selected', {
...systemInfo,
ide
});

const projectPath = path.resolve(process.cwd(), projectName);

// Check if directory exists
if (fs.existsSync(projectPath)) {
console.log(chalk.red(`❌ Directory "${projectName}" already exists.`));
console.log(chalk.yellow(`\n⚠ Directory "${projectName}" already exists`));
process.exit(1);
}

try {
// Create project directory
console.log(chalk.blue('📁 Creating project directory...'));
console.log(chalk.dim('\n📁 Creating project directory...'));
fs.ensureDirSync(projectPath);

// Report directory created
reportEvent(userId, 'create-project:directory-created', {
...systemInfo,
ide
});

// Copy template files
console.log(chalk.blue('📋 Setting up project files...'));
console.log(chalk.dim('📋 Setting up project files...'));
const templatePath = path.join(__dirname, '..', 'templates', 'default');
fs.copySync(templatePath, projectPath);

Expand All @@ -84,40 +125,127 @@ async function main() {
fs.writeJsonSync(packageJsonPath, packageJson, { spaces: 2 });

// Install dependencies
console.log(chalk.blue('📦 Installing dependencies...'));
console.log(chalk.dim('📦 Installing dependencies...'));
const installStart = Date.now();
execSync('npm install', { cwd: projectPath, stdio: 'inherit' });

// Report dependencies installed
reportEvent(userId, 'create-project:dependencies-installed', {
...systemInfo,
ide,
installDuration: Date.now() - installStart
});

// Install VS Code extension
console.log(chalk.blue('🔧 Installing VS Code extension...'));
try {
execSync('code --install-extension flyde.flyde-vscode', { stdio: 'pipe' });
console.log(chalk.green('✅ VS Code extension installed!'));
} catch (error) {
console.log(chalk.yellow('⚠️ Could not install VS Code extension automatically.'));
console.log(chalk.gray(' Please install it manually from the VS Code marketplace.'));
// Install IDE extension based on selection
if (ide !== 'other') {
console.log(chalk.dim('\n🔧 Installing Flyde extension...'));

const commands = {
vscode: 'code',
cursor: 'cursor',
windsurf: 'windsurf'
};

const command = commands[ide as keyof typeof commands];

try {
// Check if IDE command is available
execSync(`${command} --version`, { stdio: 'pipe' });

try {
execSync(`${command} --install-extension flyde.flyde-vscode`, { stdio: 'pipe' });
console.log(chalk.green('✅ Flyde extension installed'));

// Report extension installed
reportEvent(userId, 'create-project:extension-installed', {
...systemInfo,
ide,
success: true
});
} catch (error) {
console.log(chalk.yellow(`\n⚠ Could not install extension automatically`));

// Report extension installation failed
reportEvent(userId, 'create-project:extension-installed', {
...systemInfo,
ide,
success: false,
reason: 'install-failed'
});
if (ide === 'vscode') {
console.log(chalk.dim(' Install from: https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode'));
} else {
console.log(chalk.dim(' Install from: https://open-vsx.org/extension/flyde/flyde-vscode'));
}
}
} catch (error) {
console.log(chalk.yellow(`\n⚠ ${command} command not found`));

// Report IDE not found
reportEvent(userId, 'create-project:extension-installed', {
...systemInfo,
ide,
success: false,
reason: 'ide-not-found'
});

if (ide === 'vscode') {
console.log(chalk.dim(' Install VS Code first, then install the extension from:'));
console.log(chalk.dim(' https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode'));
} else {
console.log(chalk.dim(` Install ${ide} first, then install the extension from:`))
console.log(chalk.dim(' https://open-vsx.org/extension/flyde/flyde-vscode'));
}
}
} else {
console.log(chalk.yellow('\n⚠ Please install the Flyde extension manually'));
console.log(chalk.dim(' VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode'));
console.log(chalk.dim(' Open VSX: https://open-vsx.org/extension/flyde/flyde-vscode'));
}

// Success message
console.log(chalk.green('\n🎉 Project created successfully!'));
console.log(chalk.gray('\nNext steps:'));
console.log(chalk.gray(` cd ${projectName}`));
console.log(chalk.gray(' code .'));
console.log(chalk.gray(' Open hello-world.flyde to get started\n'));

// Open VS Code automatically
try {
console.log(chalk.blue('🚀 Opening VS Code...'));
execSync(`code "${projectPath}" "${projectPath}/hello-world.flyde"`, { stdio: 'pipe' });
} catch (error) {
console.log(chalk.yellow('⚠️ Could not open VS Code automatically.'));
console.log(chalk.gray(` Please run: cd ${projectName} && code .`));
console.log(chalk.green.bold('\n✨ Project created successfully!'));
console.log(chalk.dim('\nNext steps:'));
console.log(chalk.white(` cd ${projectName}`));

if (ide !== 'other') {
const commands = {
vscode: 'code',
cursor: 'cursor',
windsurf: 'windsurf'
};
console.log(chalk.white(` ${commands[ide as keyof typeof commands]} .`));
}

console.log(chalk.white(' Open hello-world.flyde to start building'));
console.log();

// Open IDE automatically
if (ide !== 'other') {
const commands = {
vscode: 'code',
cursor: 'cursor',
windsurf: 'windsurf'
};

const command = commands[ide as keyof typeof commands];

try {
console.log(chalk.dim(`🚀 Opening ${ide}...`));
execSync(`${command} "${projectPath}" "${projectPath}/hello-world.flyde"`, { stdio: 'pipe' });
} catch (error) {
// Silently fail - user can open manually
}
}

// Report success
reportEvent(userId, 'create-project:success', systemInfo);
reportEvent(userId, 'create-project:success', {
...systemInfo,
ide
});

} catch (error) {
console.error(chalk.red('❌ Error creating project:'), error);
console.error(chalk.red('\n❌ Error creating project:'), error);

// Report error
reportEvent(userId, 'create-project:error', {
Expand Down
58 changes: 0 additions & 58 deletions create-flyde-app/templates/default/index.js

This file was deleted.

4 changes: 2 additions & 2 deletions create-flyde-app/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "my-flyde-project",
"version": "1.0.0",
"description": "A Flyde visual programming project",
"main": "index.js",
"main": "index.ts",
"scripts": {
"start": "node index.js",
"start": "tsx index.ts",
"dev": "tsx watch index.ts"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions main.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"path": "vscode"
},
{
"path": "create-flyde-app"
}
],
"settings": {
"search.useGlobalIgnoreFiles": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { CodeNode } from "@flyde/core";
export { Supabase } from "./supabase.flyde";
export { OpenAI } from "./openai.flyde";
export { OpenAIResponsesAPI } from "./openai-responses.flyde";
Expand Down
5 changes: 3 additions & 2 deletions nodes/src/ThirdParty/server.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./";
export { PostgreSQL } from "./postgres.flyde";
export * from "./browser";
export { PostgreSQL } from "./postgres.flyde";
export { GoogleSheets } from "./googlesheets.flyde";
2 changes: 1 addition & 1 deletion nodes/src/all-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export * from "./State";
export * from "./Timing";
export * from "./Values/index";
export * from "./Note/Note.flyde";
export * from "./ThirdParty";
export * from "./ThirdParty/browser";
2 changes: 1 addition & 1 deletion nodes/src/nodes-library-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
codeNodeToImportableEditorNode,
NodeLibraryData,
} from "@flyde/core";
import { Airtable, Anthropic, DiscordMessage, Firecrawl, GoogleSheets, LLMCondition, Notion, Resend, ScrapingBee, SendGrid, Slack, Supabase, Tavily } from "./ThirdParty";
import { Airtable, Anthropic, DiscordMessage, Firecrawl, GoogleSheets, LLMCondition, Notion, Resend, ScrapingBee, SendGrid, Slack, Supabase, Tavily } from "./ThirdParty/browser";
import { OpenAIResponsesAPI } from "./ThirdParty/openai-responses.flyde";

const nodesSource: CodeNodeSource = {
Expand Down
Loading