Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-bootstrap-codemods

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-bootstrap-codemods - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

transforms/deprecated-attribute-arguments/__testfixtures__/button-group.input.hbs

4

bin/cli.js

@@ -7,5 +7,3 @@ #!/usr/bin/env node

process.argv[2] /* transform name */,
process.argv.slice(3) /* paths or globs */,
undefined,
'template'
process.argv.slice(3) /* paths or globs */
);
{
"name": "ember-bootstrap-codemods",
"description": "Codemods to ease upgrading of ember-bootstrap",
"version": "0.1.0",
"version": "0.1.1",
"author": "Simon Ihmig <simon.ihmig@kaliber5.de",

@@ -23,3 +23,3 @@ "license": "MIT",

"dependencies": {
"codemod-cli": "simonihmig/codemod-cli#template-support"
"codemod-cli": "rwjblue/codemod-cli#1e080835dd8ffecb1e0795a897e6b3b0d1da281d"
},

@@ -26,0 +26,0 @@ "devDependencies": {

@@ -61,18 +61,14 @@ // https://astexplorer.net/#/gist/c10a1686d9bb15c5135fc243e8667e08/2897125cac87f759ace2248d481d9d45ebb6e047

function isFormElement(node, elementStack) {
function componentYieldedBy(node, elementStack) {
if (node.type !== 'ElementNode') {
return false;
return null;
}
let [yieldName, propery] = node.tag.split('.');
let [yieldName, property] = node.tag.split('.');
if (propery !== 'element') {
return false;
}
if (elementStack.length < 2) {
return false;
return null;
}
const parentYield = elementStack
let parentYield = elementStack
.slice()

@@ -82,9 +78,13 @@ .reverse()

if (!parentYield || parentYield.tag !== 'BsForm') {
return false;
}
return parentYield ? `${parentYield.tag}::${property}` : null;
}
return true;
function isButtonInButtonGroup(node, elementStack) {
return componentYieldedBy(node, elementStack) === 'BsButtonGroup::button';
}
function isFormElement(node, elementStack) {
return componentYieldedBy(node, elementStack) === 'BsForm::element';
}
function visitor(env) {

@@ -99,4 +99,8 @@ const b = env.syntax.builders;

elementStack.push(node);
const deprecatedArguments = simpleDeprecations[node.tag];
let deprecatedArguments = simpleDeprecations[node.tag];
if (isButtonInButtonGroup(node, elementStack)) {
deprecatedArguments = simpleDeprecations.BsButton;
}
if (

@@ -172,1 +176,3 @@ deprecatedArguments &&

};
module.exports.type = 'hbs';

@@ -6,4 +6,3 @@ 'use strict';

runTransformTest({
type: 'template',
name: 'deprecated-attribute-arguments',
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc