
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
can-migrate
Advanced tools
CLI & codemod scripts for upgrading to CanJS 3 to 6.
Check out the Using Codemods guide on canjs.com for an overview of this project, how to install can-migrate
, how to use the CLI, and recommendations for how to migrate your app.
There is now a quick and easy way to create a transform and the associated tests and diff files. Running:
./bin/can-migrate-generate.js <folder> <transform> --can-version=6
Will either add the files to an existing folder or create a folder and add the files. It will create transform.js
| transform-test.js
| transform-input.js
| transform-output.js
as well as adding the information into the transforms.json
.
There is one entry in the array per type of template/test required to generate the transforms. The current groups of transforms are:
[
{
"copy": [ // Copy these files from src
{
"input": "...", // Source filename
"output: "...", // Destination filename
"type": "fixture|test|transform" // Type of copy determines where the destination file ends up (more on that below)
}
],
"generate": [ // Generate output from the template in src using "transforms
{
"template": "...", // Source filename
"outputPath: "...", // Destination filename
"type": "fixture|test|transform" // Type of copy determines where the destination file ends up (more on that below)
}
],
"transforms": [
{
"shortName": "component", // Short name of the transform for debugging and template filename generation
"oldSourceValues": [ // List of ways this component could be imported/required. Used to replace these with newer component import
"can/component/",
"can/component/component",
"can/component/component.js"
],
"newSourceValue": "can-component", // The new value of the import/require
"exampleLocalName": "MyComponent" // The example local name to include in generate documentation
"oldObjectName": "can", // Object name to look for
"oldPropertyName": "addEvent", // Property name to look for
"newPropertyName": addEventListener, // What should replace the object.property (false for nothing, could be a complex replacement like mutate.appendChild)
"sourceValue": "can-construct" // Key to look up the configurable naming in config.json
}
]
}
]
lib
, file is added to test/test.js
.test/fixtures
lib/transforms
FAQs
Codemods to simplify upgrading CanJS.
We found that can-migrate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.