babel-plugin-transform-cx-imports
Advanced tools
Comparing version 16.12.1 to 16.12.2
@@ -40,2 +40,5 @@ "use strict"; | ||
} | ||
else { | ||
throw new Error(`Cx import ${s.imported.name} not found in package ${remainder}.`) | ||
} | ||
}); | ||
@@ -42,0 +45,0 @@ |
{ | ||
"name": "babel-plugin-transform-cx-imports", | ||
"version": "16.12.1", | ||
"version": "16.12.2", | ||
"description": "Rewrite imports from Cx for simplicity and optimal output size.", | ||
@@ -10,7 +10,4 @@ "repository": "https://github.com/codaxy/cx", | ||
"dependencies": { | ||
"babel-plugin-syntax-jsx": "^6.3.13" | ||
"babel-plugin-syntax-jsx": "^6.18.0" | ||
}, | ||
"peerDependencies": { | ||
"cx-core": "*" | ||
}, | ||
"devDependencies": { | ||
@@ -17,0 +14,0 @@ "babel-core": "^6.4.5", |
20
test.js
@@ -59,3 +59,3 @@ "use strict"; | ||
assert.equal(unwrap(output), 'import { TextField } from "cx-core/src/ui/form/TextField.js"'); | ||
assert.equal(unwrap(output), 'import { TextField } from "cx-core/src/widgets/form/TextField.js"'); | ||
}); | ||
@@ -72,6 +72,20 @@ | ||
assert.deepEqual(lines(output), [ | ||
'import { TextField } from "cx-core/src/ui/form/TextField.js";', | ||
'import "cx-core/src/ui/form/TextField.scss"' | ||
'import { TextField } from "cx-core/src/widgets/form/TextField.js";', | ||
'import "cx-core/src/widgets/form/TextField.scss"' | ||
]); | ||
}); | ||
it("imports multiple things from source", function () { | ||
let code = `import { Text, TextField } from "cx/widgets"`; | ||
let output = babel.transform(code, { | ||
plugins: [[plugin, { useSrc: true }]] | ||
}).code; | ||
assert.deepEqual(lines(output), [ | ||
'import { Text } from "cx-core/src/ui/Text.js";', | ||
'import { TextField } from "cx-core/src/widgets/form/TextField.js"' | ||
]); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7164
1
106
- Removed@types/prop-types@15.7.13(transitive)
- Removed@types/react@16.14.62(transitive)
- Removed@types/scheduler@0.16.8(transitive)
- Removedcsstype@3.1.3(transitive)
- Removedcx@17.12.7(transitive)
- Removedcx-core@17.4.0(transitive)
- Removedintl-io@0.2.12(transitive)
- Removedroute-parser@0.0.5(transitive)