**chore: remove unused CLI and utility files**
- **Codebase Cleanup**:
- Removed `cli.ts` and `textEncoding.ts` from `cli-package/src`:
- Deleted outdated CLI logic and text encoding utilities no longer actively used or maintained.
- **Purpose**:
- Simplify the repository by eliminating unused and redundant code, reducing maintenance overhead.
This commit is contained in:
parent
b846342681
commit
a6ac8b791e
27 changed files with 6 additions and 13665 deletions
|
|
@ -1,75 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Script to build and publish both the main package and CLI package
|
||||
*
|
||||
* This script:
|
||||
* 1. Ensures versions are in sync by running generate-version.js
|
||||
* 2. Builds the main package
|
||||
* 3. Builds the CLI package
|
||||
* 4. Publishes the main package
|
||||
* 5. Publishes the CLI package
|
||||
* DEPRECATED: Script to build and publish both the main package and CLI package
|
||||
*
|
||||
* This ensures both packages are always published together with the same version.
|
||||
* This script is no longer functional as the CLI package has been removed.
|
||||
* Use 'npm publish' directly to publish the main package only.
|
||||
*/
|
||||
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
// Get the directory of the current module
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const rootDir = path.join(__dirname, '..')
|
||||
const cliPackageDir = path.join(rootDir, 'cli-package')
|
||||
|
||||
// Ensure the CLI package directory exists
|
||||
if (!fs.existsSync(cliPackageDir)) {
|
||||
console.error(`Error: CLI package directory not found at ${cliPackageDir}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
try {
|
||||
// Step 1: Ensure versions are in sync
|
||||
console.log('Ensuring versions are in sync...')
|
||||
execSync('node scripts/generate-version.js', { stdio: 'inherit', cwd: rootDir })
|
||||
|
||||
// Step 2: Build the main package
|
||||
console.log('Building main package...')
|
||||
execSync('npm run build', { stdio: 'inherit', cwd: rootDir })
|
||||
|
||||
// Step 3: Publish the main package
|
||||
console.log('Publishing main package...')
|
||||
execSync('npm publish', { stdio: 'inherit', cwd: rootDir })
|
||||
|
||||
// Step 4: Wait a moment to ensure the package is available
|
||||
console.log('Waiting for package to be available...')
|
||||
await new Promise(resolve => setTimeout(resolve, 5000))
|
||||
|
||||
// Step 5: Build the CLI package
|
||||
console.log('Building CLI package...')
|
||||
execSync('npm run build', { stdio: 'inherit', cwd: cliPackageDir })
|
||||
|
||||
// Step 6: Verify the CLI was built successfully
|
||||
const cliPath = path.join(cliPackageDir, 'dist', 'cli.js')
|
||||
if (!fs.existsSync(cliPath)) {
|
||||
console.error(`Error: CLI build failed. File not found at ${cliPath}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// Step 7: Publish the CLI package
|
||||
console.log('Publishing CLI package...')
|
||||
execSync('npm publish', { stdio: 'inherit', cwd: cliPackageDir })
|
||||
|
||||
console.log('Both packages published successfully!')
|
||||
|
||||
// Step 8: Create GitHub release
|
||||
console.log('Creating GitHub release...')
|
||||
execSync('node scripts/create-github-release.js', { stdio: 'inherit', cwd: rootDir })
|
||||
|
||||
console.log('Deployment complete!')
|
||||
} catch (error) {
|
||||
console.error('Error:', error.message)
|
||||
process.exit(1)
|
||||
}
|
||||
console.error('This script is deprecated. The CLI package has been removed.')
|
||||
console.error('To publish the main package only, use: npm publish')
|
||||
process.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue