New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/codemod-utils

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/codemod-utils - npm Package Compare versions

Comparing version

to
4.2.4

56

CHANGELOG.md
# @atlaskit/codemod-utils
## 4.2.4
### Patch Changes
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
## 4.2.3

@@ -7,3 +13,3 @@

- [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies

@@ -14,3 +20,3 @@ ## 4.2.2

- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8

@@ -21,3 +27,3 @@ ## 4.2.1

- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`

@@ -28,3 +34,3 @@ ## 4.2.0

- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump

@@ -35,3 +41,3 @@ ## 4.1.3

- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`

@@ -42,3 +48,3 @@ ## 4.1.2

- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.

@@ -49,3 +55,3 @@ ## 4.1.1

- [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
- [#23836](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23836) [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values

@@ -56,3 +62,3 @@ ## 4.1.0

- [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
- [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570) [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists

@@ -63,3 +69,3 @@ ## 4.0.2

- [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
- [#21152](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21152) [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios

@@ -70,3 +76,3 @@ ## 4.0.1

- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4

@@ -77,3 +83,3 @@ ## 4.0.0

- [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
- [#20033](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20033) [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows

@@ -116,3 +122,3 @@ @atlaskit/adf-schema/schema-bitbucket for:

- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.
- [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319) [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.

@@ -123,3 +129,3 @@ ## 3.3.0

- [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
- [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864) [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.

@@ -130,3 +136,3 @@ ## 3.2.2

- [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore

@@ -137,3 +143,3 @@ ## 3.2.1

- [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support
- [#11911](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11911) [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support

@@ -144,3 +150,3 @@ ## 3.2.0

- [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
- [#10569](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10569) [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions

@@ -155,3 +161,3 @@ ### Patch Changes

- [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
- [#10787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10787) [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:

@@ -167,3 +173,3 @@ - Make the message prefix optional.

- [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
- [#10179](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10179) [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!

@@ -176,3 +182,3 @@ If you rely on this transformer, you can now depend on it via a new package `@af/skip-inconsistent-tests`.

- [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
- [#9756](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9756) [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
- [`1b6bf93be84`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b6bf93be84) - Migrate helper functions into codemod-utils

@@ -184,3 +190,3 @@

- [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
- [#9940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9940) [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test

@@ -191,3 +197,3 @@ ## 2.1.2

- [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
- [#9832](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9832) [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
- [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped @types/jscodeshift@^0.11.0

@@ -199,3 +205,3 @@

- [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
- [#8981](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8981) [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod

@@ -206,3 +212,3 @@ ## 2.1.0

- [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
- [#8169](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8169) [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:

@@ -224,3 +230,3 @@ - getDefaultSpecifier

- [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
- [#7012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/7012) [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils

@@ -231,2 +237,2 @@ ## 2.0.0

- [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
- [#6722](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6722) [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package

@@ -127,3 +127,3 @@ "use strict";

var _element$node$opening;
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 ? void 0 : _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 || _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
}

@@ -130,0 +130,0 @@ });

@@ -123,5 +123,5 @@ "use strict";

const imports = source.find(j.ImportDeclaration).filter(path => {
var _path$node, _path$node$source;
var _path$node;
return (// @ts-ignore
path === null || path === void 0 ? void 0 : (_path$node = path.node) === null || _path$node === void 0 ? void 0 : (_path$node$source = _path$node.source) === null || _path$node$source === void 0 ? void 0 : _path$node$source.value.toString().startsWith(packageName)
path === null || path === void 0 || (_path$node = path.node) === null || _path$node === void 0 || (_path$node = _path$node.source) === null || _path$node === void 0 ? void 0 : _path$node.value.toString().startsWith(packageName)
);

@@ -233,11 +233,11 @@ });

const testMethodVariantEach = (path, testMethods) => {
var _path$value, _path$value$callee, _path$value$callee$ca, _path$value2, _path$value2$callee, _path$value2$callee$c, _path$value2$callee$c2, _path$value3, _path$value3$callee, _path$value3$callee$c, _path$value3$callee$c2;
var _path$value, _path$value2, _path$value3;
const variants = new Set(['each']);
return (
// @ts-ignore
((_path$value = path.value) === null || _path$value === void 0 ? void 0 : (_path$value$callee = _path$value.callee) === null || _path$value$callee === void 0 ? void 0 : (_path$value$callee$ca = _path$value$callee.callee) === null || _path$value$callee$ca === void 0 ? void 0 : _path$value$callee$ca.type) === 'MemberExpression' &&
((_path$value = path.value) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 ? void 0 : _path$value.type) === 'MemberExpression' &&
// @ts-ignore
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 ? void 0 : (_path$value2$callee = _path$value2.callee) === null || _path$value2$callee === void 0 ? void 0 : (_path$value2$callee$c = _path$value2$callee.callee) === null || _path$value2$callee$c === void 0 ? void 0 : (_path$value2$callee$c2 = _path$value2$callee$c.object) === null || _path$value2$callee$c2 === void 0 ? void 0 : _path$value2$callee$c2.name) &&
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.object) === null || _path$value2 === void 0 ? void 0 : _path$value2.name) &&
// @ts-ignore
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 ? void 0 : (_path$value3$callee = _path$value3.callee) === null || _path$value3$callee === void 0 ? void 0 : (_path$value3$callee$c = _path$value3$callee.callee) === null || _path$value3$callee$c === void 0 ? void 0 : (_path$value3$callee$c2 = _path$value3$callee$c.property) === null || _path$value3$callee$c2 === void 0 ? void 0 : _path$value3$callee$c2.name)
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.property) === null || _path$value3 === void 0 ? void 0 : _path$value3.name)
);

@@ -244,0 +244,0 @@ };

@@ -113,3 +113,2 @@ function getNamedSpecifier(j, source, specifier, importName) {

};
export function placeholderStringMatches(placeholderStr, resolvedStr) {

@@ -116,0 +115,0 @@ if (placeholderStr === resolvedStr) {

@@ -144,3 +144,3 @@ import { addCommentToStartOfFile, addToImport, getDefaultSpecifier, getJSXAttributesByName, getNamedSpecifier, getSafeImportName, tryCreateImport } from './support';

var _element$node$opening;
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 ? void 0 : _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 || _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
}

@@ -147,0 +147,0 @@ });

@@ -112,5 +112,5 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";

var imports = source.find(j.ImportDeclaration).filter(function (path) {
var _path$node, _path$node$source;
var _path$node;
return (// @ts-ignore
path === null || path === void 0 ? void 0 : (_path$node = path.node) === null || _path$node === void 0 ? void 0 : (_path$node$source = _path$node.source) === null || _path$node$source === void 0 ? void 0 : _path$node$source.value.toString().startsWith(packageName)
path === null || path === void 0 || (_path$node = path.node) === null || _path$node === void 0 || (_path$node = _path$node.source) === null || _path$node === void 0 ? void 0 : _path$node.value.toString().startsWith(packageName)
);

@@ -131,3 +131,2 @@ });

};
export function placeholderStringMatches(placeholderStr, resolvedStr) {

@@ -225,11 +224,11 @@ if (placeholderStr === resolvedStr) {

var testMethodVariantEach = function testMethodVariantEach(path, testMethods) {
var _path$value, _path$value$callee, _path$value$callee$ca, _path$value2, _path$value2$callee, _path$value2$callee$c, _path$value2$callee$c2, _path$value3, _path$value3$callee, _path$value3$callee$c, _path$value3$callee$c2;
var _path$value, _path$value2, _path$value3;
var variants = new Set(['each']);
return (
// @ts-ignore
((_path$value = path.value) === null || _path$value === void 0 ? void 0 : (_path$value$callee = _path$value.callee) === null || _path$value$callee === void 0 ? void 0 : (_path$value$callee$ca = _path$value$callee.callee) === null || _path$value$callee$ca === void 0 ? void 0 : _path$value$callee$ca.type) === 'MemberExpression' &&
((_path$value = path.value) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 ? void 0 : _path$value.type) === 'MemberExpression' &&
// @ts-ignore
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 ? void 0 : (_path$value2$callee = _path$value2.callee) === null || _path$value2$callee === void 0 ? void 0 : (_path$value2$callee$c = _path$value2$callee.callee) === null || _path$value2$callee$c === void 0 ? void 0 : (_path$value2$callee$c2 = _path$value2$callee$c.object) === null || _path$value2$callee$c2 === void 0 ? void 0 : _path$value2$callee$c2.name) &&
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.object) === null || _path$value2 === void 0 ? void 0 : _path$value2.name) &&
// @ts-ignore
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 ? void 0 : (_path$value3$callee = _path$value3.callee) === null || _path$value3$callee === void 0 ? void 0 : (_path$value3$callee$c = _path$value3$callee.callee) === null || _path$value3$callee$c === void 0 ? void 0 : (_path$value3$callee$c2 = _path$value3$callee$c.property) === null || _path$value3$callee$c2 === void 0 ? void 0 : _path$value3$callee$c2.name)
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.property) === null || _path$value3 === void 0 ? void 0 : _path$value3.name)
);

@@ -236,0 +235,0 @@ };

{
"name": "@atlaskit/codemod-utils",
"version": "4.2.3",
"version": "4.2.4",
"author": "Atlassian Pty Ltd",

@@ -15,3 +15,3 @@ "license": "Apache-2.0",

},
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
"main": "dist/cjs/index.js",

@@ -41,3 +41,3 @@ "module": "dist/esm/index.js",

"jscodeshift": "^0.13.0",
"typescript": "~4.9.5"
"typescript": "~5.4.2"
},

@@ -72,2 +72,2 @@ "techstack": {

"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
}
}