From 884b7181b329c47e5565431a03f121789e391034 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Tue, 22 Apr 2025 20:32:28 -0700 Subject: [PATCH] fix(scripts): removed old script, removed redundant ts-nocheck from ts script, remove deprecated dalle-2 model --- scripts/generate-block-docs.ts | 3 +- sim/blocks/blocks/image_generator.ts | 1 - sim/scripts/release-npm.js | 102 --------------------------- 3 files changed, 1 insertion(+), 105 deletions(-) delete mode 100755 sim/scripts/release-npm.js diff --git a/scripts/generate-block-docs.ts b/scripts/generate-block-docs.ts index 3b4eaeb28..e4cf4c3e1 100644 --- a/scripts/generate-block-docs.ts +++ b/scripts/generate-block-docs.ts @@ -1,5 +1,4 @@ -#!/usr/bin/env node -// @ts-check +#!/usr/bin/env ts-node import fs from 'node:fs' import path from 'node:path' diff --git a/sim/blocks/blocks/image_generator.ts b/sim/blocks/blocks/image_generator.ts index 66d29d3b8..7c57ed2d7 100644 --- a/sim/blocks/blocks/image_generator.ts +++ b/sim/blocks/blocks/image_generator.ts @@ -33,7 +33,6 @@ export const ImageGeneratorBlock: BlockConfig = { type: 'dropdown', layout: 'half', options: [ - { label: 'DALL-E 2', id: 'dall-e-2' }, { label: 'DALL-E 3', id: 'dall-e-3' }, ], value: () => 'dall-e-3', diff --git a/sim/scripts/release-npm.js b/sim/scripts/release-npm.js deleted file mode 100755 index ad2913f4d..000000000 --- a/sim/scripts/release-npm.js +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env node - -/** - * Release NPM Package Script - * - * This script helps with the process of releasing the Sim Studio CLI to npm. - * It builds the standalone app, prepares the CLI package, and publishes it to npm. - */ - -const fs = require('fs') -const path = require('path') -const { execSync } = require('child_process') - -// Configuration -const ROOT_DIR = path.resolve(__dirname, '..') -const CLI_DIR = path.join(ROOT_DIR, 'packages/@simstudio/cli') -const STANDALONE_DIR = path.join(CLI_DIR, 'standalone') -const OUTPUT_TARBALL = path.join(ROOT_DIR, 'sim-standalone.tar.gz') - -// Ensure we're in the right directory -process.chdir(ROOT_DIR) - -// Helper function to run commands and log output -function runCommand(command, options = {}) { - console.log(`> ${command}`) - try { - execSync(command, { - stdio: 'inherit', - ...options, - }) - return true - } catch (error) { - console.error(`Error running command: ${command}`) - console.error(error) - return false - } -} - -// Main release process -async function release() { - console.log('=== Sim Studio CLI Release Process ===') - - // 1. Clean up any existing standalone files - console.log('\n1. Cleaning up existing standalone files...') - if (fs.existsSync(STANDALONE_DIR)) { - fs.rmSync(STANDALONE_DIR, { recursive: true, force: true }) - } - if (fs.existsSync(OUTPUT_TARBALL)) { - fs.unlinkSync(OUTPUT_TARBALL) - } - - // 2. Build the standalone app - console.log('\n2. Building standalone app...') - if (!runCommand('node scripts/build-standalone.js')) { - console.error('Failed to build standalone app') - process.exit(1) - } - - // 3. Prepare the CLI package - console.log('\n3. Preparing CLI package...') - process.chdir(CLI_DIR) - - // Clean and build - if (!runCommand('npm run clean && npm run build')) { - console.error('Failed to build CLI package') - process.exit(1) - } - - // 4. Create the standalone directory - console.log('\n4. Creating standalone directory...') - if (!fs.existsSync(STANDALONE_DIR)) { - fs.mkdirSync(STANDALONE_DIR, { recursive: true }) - } - - // 5. Publish to npm - console.log('\n5. Publishing to npm...') - console.log('Ready to publish to npm. Run the following commands:') - console.log(` - cd ${path.relative(process.cwd(), CLI_DIR)} - npm publish - `) - - // 6. Create GitHub release - console.log('\n6. Creating GitHub release...') - console.log('After publishing to npm, create a GitHub release with the standalone tarball:') - console.log(` - 1. Go to https://github.com/simstudioai/sim/releases/new - 2. Set the tag to v0.1.0 (or your current version) - 3. Set the title to "Sim Studio v0.1.0" - 4. Upload the tarball: ${path.relative(ROOT_DIR, OUTPUT_TARBALL)} - 5. Publish the release - `) - - console.log('\n=== Release Process Complete ===') - console.log('Follow the instructions above to publish to npm and create a GitHub release.') -} - -// Run the release process -release().catch((error) => { - console.error('Release process failed:', error) - process.exit(1) -})