
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@hyperdrive.bot/serverless-plugin-manager
Advanced tools
Common utilities and patterns for serverless plugin CI/CD pipelines
Common utilities and patterns for serverless plugin CI/CD pipelines. This library abstracts common testing, deployment, and cleanup patterns to make serverless plugin development more consistent and reliable.
npm install @hyperdrive.bot/serverless-plugin-manager
# Run package validation tests
npx @hyperdrive.bot/serverless-plugin-manager test package-validation --plugin your-plugin-name
# Run feature tests
npx @hyperdrive.bot/serverless-plugin-manager test feature-tests --plugin your-plugin-name
# Run integration tests
npx @hyperdrive.bot/serverless-plugin-manager test integration-tests --plugin your-plugin-name
# Run all tests
npx @hyperdrive.bot/serverless-plugin-manager test all --plugin your-plugin-name
# Clean up resources
npx @hyperdrive.bot/serverless-plugin-manager cleanup all --stage test
Copy script templates to your project:
cp node_modules/@hyperdrive.bot/serverless-plugin-manager/templates/*.sh ./scripts/
chmod +x ./scripts/*.sh
Then use in package.json:
{
"scripts": {
"test:package-validation": "./scripts/package-validation-script.sh",
"test:features": "./scripts/feature-tests-script.sh",
"test:integration": "./scripts/integration-tests-script.sh",
"cleanup": "./scripts/cleanup-script.sh"
}
}
import {
TestManager,
createDefaultTestConfig,
getCleanupManager,
logger
} from '@hyperdrive.bot/serverless-plugin-manager'
// Set up automatic cleanup
const cleanupManager = getCleanupManager()
cleanupManager.trackDirectory('./test-project')
cleanupManager.addAwsPattern({
type: 'stack',
pattern: '*test*',
region: 'us-east-1'
})
// Run tests
const config = createDefaultTestConfig('your-plugin-name')
const testManager = new TestManager(config)
const result = await testManager.runAllTests()
if (result.success) {
logger.success('All tests passed!')
} else {
logger.error('Tests failed')
process.exit(1)
}
// Cleanup happens automatically on process exit
The cleanup manager provides "finally"-like behavior:
import { getCleanupManager, trackResource, trackFile } from '@hyperdrive.bot/serverless-plugin-manager'
// Track resources for cleanup
trackResource({ type: 'stack', identifier: 'my-test-stack', region: 'us-east-1' })
trackFile('./temporary-file.txt')
// Cleanup happens automatically on:
// - Normal process exit
// - SIGINT (Ctrl+C)
// - SIGTERM
// - Uncaught exceptions
// - Unhandled promise rejections
Clean up resources by naming patterns:
cleanupManager.addAwsPattern({
type: 'stack',
pattern: '*test*',
region: 'us-east-1'
})
import { logger } from '@hyperdrive.bot/serverless-plugin-manager'
logger.step('Starting deployment')
logger.info('Information message')
logger.success('Operation completed')
logger.error('Something failed')
logger.aws('deploy', 'my-stack', 'us-east-1')
logger.cleanup('delete', 'test-resource')
logger.progress(3, 10, 'Processing modules...')
logger.section('Test Results')
logger.testResults('My Test', true, 'Test passed', 1500)
const config = createDefaultTestConfig('your-plugin-name')
// Automatically sets up test modules, stages, and AWS regions
const config: PluginConfig = {
pluginName: 'your-plugin-name',
testProjectName: 'test-project',
deploymentStage: 'dev',
serverlessVersion: '4',
awsRegion: 'us-east-1',
testModules: [
{
name: 'auth',
categories: [
{
name: 'functions',
files: [
{
fileName: 'login.yml',
type: 'yaml',
content: '...'
}
]
}
],
expectedFunctions: ['login']
}
],
transformers: [
{
category: 'functions',
path: './transformers/functions.js',
expectedTransformations: { TRANSFORMED: 'true' }
}
]
}
# Package validation
sls-plugin-test package-validation --plugin <name> --stage <stage>
# Feature tests
sls-plugin-test feature-tests --plugin <name> --stage <stage>
# Integration tests
sls-plugin-test integration-tests --plugin <name> --stage <stage>
# All tests
sls-plugin-test all --plugin <name> --stage <stage>
# AWS resources
sls-plugin-cleanup aws --stage <stage> --region <region>
# Local artifacts
sls-plugin-cleanup local --path <path>
# Everything
sls-plugin-cleanup all --stage <stage> --region <region>
--plugin <name>: Plugin name--stage <stage>: Deployment stage (default: $CI_COMMIT_REF_SLUG or 'test')--region <region>: AWS region (default: 'us-east-1')--serverless-version <version>: Serverless Framework version (default: '4')test:package-validation:
script:
- npm run test:package-validation
test:features:
script:
- npm run test:features
test:integration:
script:
- npm run test:integration
after_script:
- npm run cleanup
- name: Package Validation
run: npm run test:package-validation
- name: Feature Tests
run: npm run test:features
- name: Integration Tests
run: npm run test:integration
- name: Cleanup
if: always()
run: npm run cleanup
CI_COMMIT_REF_SLUG: Branch name (used as deployment stage)AWS_DEFAULT_REGION: Default AWS regionSERVERLESS_VERSION: Serverless Framework versionPLUGIN_NAME: Plugin name for testingSKIP_INTEGRATION_TESTS: Skip integration tests if set to 'true'LOG_LEVEL: Logging level (debug, info, warn, error)Check out these examples in the wild:
MIT © DevSquad Team
FAQs
Common utilities and patterns for serverless plugin CI/CD pipelines
We found that @hyperdrive.bot/serverless-plugin-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.