diff --git a/.changeset/angry-ties-explain.md b/.changeset/angry-ties-explain.md new file mode 100644 index 000000000..2476a0c13 --- /dev/null +++ b/.changeset/angry-ties-explain.md @@ -0,0 +1,33 @@ +--- +'@hypermod/mod-atlaskit__progress-indicator': minor +'@hypermod/mod-atlaskit__section-message': minor +'@hypermod/mod-atlaskit__side-navigation': minor +'@hypermod/mod-atlaskit__breadcrumbs': minor +'@hypermod/mod-atlaskit__textfield': minor +'@hypermod/mod-atlaskit__calendar': minor +'@hypermod/mod-atlaskit__checkbox': minor +'@hypermod/mod-atlaskit__textarea': minor +'@hypermod/mod-atlaskit__spinner': minor +'@hypermod/mod-emotion__monorepo': minor +'@hypermod/mod-atlaskit__avatar': minor +'@hypermod/mod-atlaskit__button': minor +'@hypermod/mod-atlaskit__popper': minor +'@hypermod/mod-atlaskit__toggle': minor +'@hypermod/mod-atlaskit__popup': minor +'@hypermod/mod-atlaskit__range': minor +'@hypermod/mod-atlaskit__icon': minor +'@hypermod/mod-atlaskit__menu': minor +'@hypermod/mod-atlaskit__tag': minor +'@hypermod/mod-memoize-one': minor +'@hypermod/mod-javascript': minor +'@hypermod/initializer': minor +'@hypermod/validator': minor +'@hypermod/fetcher': minor +'@hypermod/mod-react': minor +'@hypermod/types': minor +'@hypermod/utils': minor +'@hypermod/core': minor +'@hypermod/cli': minor +--- + +This package has moved scopes from `@codeshift` to `@hypermod`. All internal `@codeshift` dependencies and references have been updated as a result. diff --git a/.changeset/config.json b/.changeset/config.json index d0affc91d..1539ac858 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -3,5 +3,6 @@ "changelog": "@changesets/cli/changelog", "commit": false, "access": "public", - "baseBranch": "main" + "baseBranch": "main", + "fixed": [["@hypermod/cli", "@codeshift/cli"]] } diff --git a/.changeset/gentle-insects-fry.md b/.changeset/gentle-insects-fry.md new file mode 100644 index 000000000..7046b22e4 --- /dev/null +++ b/.changeset/gentle-insects-fry.md @@ -0,0 +1,12 @@ +--- +'@hypermod/cli': minor +'@codeshift/cli': minor +--- + +This package has been renamed to `@hypermod/cli`. + +No API changes were performed as part of this change, use `@hypermod/cli` as a direct replacement the package has simply been renamed. + +It can now be run via `$ hypermod` or `$ hypermod-cli` or `$ npx @hypermod/cli`. + +The alias package `@codeshift/cli` will continue to exist as a way for existing users to continue to receive updates **but will be removed in the future**. diff --git a/LICENSE b/LICENSE index 721ca4c8e..2da4018be 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 CodeshiftCommunity +Copyright (c) 2023 Hypermod Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6a2798f86..e4e42af68 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- CodeshiftCommunity Logo + Hypermod Logo

# Hypermod Community @@ -36,30 +36,29 @@ The community-owned global registry and documentation hub for codemods. Providin [The registry](https://www.codeshiftcommunity.com/docs/registry) contains all community contributed codemods, hosted and published directly from the CodeshiftCommunity repository. -Source for these packages are located in the [/community folder](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community). +Source for these packages are located in the [/community folder](https://github.com/hypermod-io/hypermod-community/tree/main/community). - [Registry homepage](https://www.codeshiftcommunity.com/docs/contribution) - [Contributing to the registry](https://www.codeshiftcommunity.com/docs/contribution) -- [Registry source files](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community) +- [Registry source files](https://github.com/hypermod-io/hypermod-community/tree/main/community) -## CLI +## CLI -Downloading and running codemods as well as initialising and maintaining codemod packages can all be done via the Codeshift CLI (`@codeshift/cli`). +Downloading and running codemods as well as initialising and maintaining codemod packages can all be done via the Hypermod CLI (`@hypermod/cli`). [Please see the docs for more information and examples](https://www.codeshiftcommunity.com/docs/cli) We recommend running the CLI with $ npx to ensure you always have the latest version. -`$ npx @codeshift/cli --packages mylib@1.0.0 /project/src` +`$ npx @hypermod/cli --packages mylib@1.0.0 /project/src` But it can also be installed globally: -`$ npm install -g @codeshift/cli or yarn global add @codeshift/cli` +`$ npm install -g @hypermod/cli or yarn global add @hypermod/cli` and run with: -`$ codeshift or $ codeshift-cli` - +`$ hypermod or $ hypermod-cli` ## Sponsors @@ -95,4 +94,3 @@ Huge thanks for all of the support from our sponsors! alt="@PreciselyAlyss" />

- diff --git a/community/@atlaskit__avatar/CHANGELOG.md b/community/@atlaskit__avatar/CHANGELOG.md index 19a1e6c2f..b4388b497 100644 --- a/community/@atlaskit__avatar/CHANGELOG.md +++ b/community/@atlaskit__avatar/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_avatar +# @hypermod/mod-atlaskit\_\_avatar ## 0.2.0 diff --git a/community/@atlaskit__avatar/package.json b/community/@atlaskit__avatar/package.json index b5a8cb427..fd87e72b0 100644 --- a/community/@atlaskit__avatar/package.json +++ b/community/@atlaskit__avatar/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__avatar", + "name": "@hypermod/mod-atlaskit__avatar", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__avatar" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__avatar" } diff --git a/community/@atlaskit__avatar/src/18.0.0/__tests__/transform.spec.ts b/community/@atlaskit__avatar/src/18.0.0/__tests__/transform.spec.ts index bb6ea9956..c1a40e473 100644 --- a/community/@atlaskit__avatar/src/18.0.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__avatar/src/18.0.0/__tests__/transform.spec.ts @@ -1,6 +1,6 @@ jest.autoMockOff(); -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from '../transform'; const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest; diff --git a/community/@atlaskit__avatar/src/18.0.0/transform.ts b/community/@atlaskit__avatar/src/18.0.0/transform.ts index 48d4e34bd..5e4bc1415 100644 --- a/community/@atlaskit__avatar/src/18.0.0/transform.ts +++ b/community/@atlaskit__avatar/src/18.0.0/transform.ts @@ -12,7 +12,7 @@ import { getImportSpecifierName, getImportDeclaration, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function updateAvatarProps(j: core.JSCodeshift, source: ReturnType) { const defaultSpecifier = getDefaultImportSpecifierName( diff --git a/community/@atlaskit__avatar/src/19.0.0/transform.ts b/community/@atlaskit__avatar/src/19.0.0/transform.ts index 3875bfc24..12555585c 100644 --- a/community/@atlaskit__avatar/src/19.0.0/transform.ts +++ b/community/@atlaskit__avatar/src/19.0.0/transform.ts @@ -5,7 +5,7 @@ import { getJSXAttributes, hasImportDeclaration, getDefaultImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function wrapChildrenProp( j: core.JSCodeshift, diff --git a/community/@atlaskit__avatar/src/codeshift.config.js b/community/@atlaskit__avatar/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__avatar/src/codeshift.config.js rename to community/@atlaskit__avatar/src/hypermod.config.js diff --git a/community/@atlaskit__breadcrumbs/CHANGELOG.md b/community/@atlaskit__breadcrumbs/CHANGELOG.md index 59e057ad9..0ad173586 100644 --- a/community/@atlaskit__breadcrumbs/CHANGELOG.md +++ b/community/@atlaskit__breadcrumbs/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_breadcrumbs +# @hypermod/mod-atlaskit\_\_breadcrumbs ## 0.2.0 diff --git a/community/@atlaskit__breadcrumbs/package.json b/community/@atlaskit__breadcrumbs/package.json index 84a7b5917..65442e8f3 100644 --- a/community/@atlaskit__breadcrumbs/package.json +++ b/community/@atlaskit__breadcrumbs/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__breadcrumbs", + "name": "@hypermod/mod-atlaskit__breadcrumbs", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__breadcrumbs" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__breadcrumbs" } diff --git a/community/@atlaskit__breadcrumbs/src/11.0.0/__tests__/remove-has-separator.spec.ts b/community/@atlaskit__breadcrumbs/src/11.0.0/__tests__/remove-has-separator.spec.ts index ff28b78b8..b0523bc7d 100644 --- a/community/@atlaskit__breadcrumbs/src/11.0.0/__tests__/remove-has-separator.spec.ts +++ b/community/@atlaskit__breadcrumbs/src/11.0.0/__tests__/remove-has-separator.spec.ts @@ -148,7 +148,7 @@ describe('@atlaskit/breadcrumbs@11.0.0 motion: delete hasSeparator prop', () => ); `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/breadcrumbs \`hasSeparator\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/breadcrumbs \`hasSeparator\` prop which has now been removed due to its poor performance characteristics. From version 11.0.0, we changed to \`css\` pseudo element for the separator and consumer should not use hasSeparator directly anymore. */ import React from "react"; @@ -186,7 +186,7 @@ describe('@atlaskit/breadcrumbs@11.0.0 motion: delete hasSeparator prop', () => ); `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/breadcrumbs \`hasSeparator\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/breadcrumbs \`hasSeparator\` prop which has now been removed due to its poor performance characteristics. From version 11.0.0, we changed to \`css\` pseudo element for the separator and consumer should not use hasSeparator directly anymore. */ import React from "react"; diff --git a/community/@atlaskit__breadcrumbs/src/11.0.0/motions/remove-has-separator.ts b/community/@atlaskit__breadcrumbs/src/11.0.0/motions/remove-has-separator.ts index b91c5e50f..e3d3ebcfa 100644 --- a/community/@atlaskit__breadcrumbs/src/11.0.0/motions/remove-has-separator.ts +++ b/community/@atlaskit__breadcrumbs/src/11.0.0/motions/remove-has-separator.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getJSXAttributes, getImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const createRemoveFuncFor = ( diff --git a/community/@atlaskit__breadcrumbs/src/11.0.0/motions/rename-breadcrumbs.ts b/community/@atlaskit__breadcrumbs/src/11.0.0/motions/rename-breadcrumbs.ts index ab82c07c0..68876103c 100644 --- a/community/@atlaskit__breadcrumbs/src/11.0.0/motions/rename-breadcrumbs.ts +++ b/community/@atlaskit__breadcrumbs/src/11.0.0/motions/rename-breadcrumbs.ts @@ -4,7 +4,7 @@ import core, { Collection, Identifier, } from 'jscodeshift'; -import { getDefaultImportSpecifierName } from '@codeshift/utils'; +import { getDefaultImportSpecifierName } from '@hypermod/utils'; function doesIdentifierExist( j: core.JSCodeshift, diff --git a/community/@atlaskit__breadcrumbs/src/11.0.0/transform.ts b/community/@atlaskit__breadcrumbs/src/11.0.0/transform.ts index 400263f18..08216b784 100644 --- a/community/@atlaskit__breadcrumbs/src/11.0.0/transform.ts +++ b/community/@atlaskit__breadcrumbs/src/11.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { hasImportDeclaration, applyMotions } from '@codeshift/utils'; +import { hasImportDeclaration, applyMotions } from '@hypermod/utils'; import elevateStatelessToDefault from './motions/elevate-stateless-to-default'; import removeHasSeparator from './motions/remove-has-separator'; diff --git a/community/@atlaskit__breadcrumbs/src/codeshift.config.js b/community/@atlaskit__breadcrumbs/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__breadcrumbs/src/codeshift.config.js rename to community/@atlaskit__breadcrumbs/src/hypermod.config.js diff --git a/community/@atlaskit__button/CHANGELOG.md b/community/@atlaskit__button/CHANGELOG.md index ce9a99363..169cacefc 100644 --- a/community/@atlaskit__button/CHANGELOG.md +++ b/community/@atlaskit__button/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_button +# @hypermod/mod-atlaskit\_\_button ## 0.2.0 diff --git a/community/@atlaskit__button/package.json b/community/@atlaskit__button/package.json index 2679a3471..6326813cb 100644 --- a/community/@atlaskit__button/package.json +++ b/community/@atlaskit__button/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__button", + "name": "@hypermod/mod-atlaskit__button", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__button" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__button" } diff --git a/community/@atlaskit__button/src/15.0.0/transform.ts b/community/@atlaskit__button/src/15.0.0/transform.ts index 99106a0ba..b4ceca324 100644 --- a/community/@atlaskit__button/src/15.0.0/transform.ts +++ b/community/@atlaskit__button/src/15.0.0/transform.ts @@ -12,7 +12,7 @@ import { insertImportSpecifier, getDefaultImportSpecifierName, removeDefaultImportSpecifier, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function tryCreateImport( j: core.JSCodeshift, diff --git a/community/@atlaskit__button/src/15.1.1/__tests__/transform.spec.ts b/community/@atlaskit__button/src/15.1.1/__tests__/transform.spec.ts index 26b90cc6d..aba281baf 100644 --- a/community/@atlaskit__button/src/15.1.1/__tests__/transform.spec.ts +++ b/community/@atlaskit__button/src/15.1.1/__tests__/transform.spec.ts @@ -185,7 +185,7 @@ describe('@atlaskit/button@15.1.1 transform', () => { } `, expected: ` - /* TODO: (@codeshift) Cannot rename data-testid to testId on StandardButton. + /* TODO: (@hypermod) Cannot rename data-testid to testId on StandardButton. A StandardButton was detected with both data-testid and testId props. Please remove the data-testid prop and check your tests */ import StandardButton from '@atlaskit/button'; diff --git a/community/@atlaskit__button/src/15.1.1/transform.ts b/community/@atlaskit__button/src/15.1.1/transform.ts index d85fddd35..a1a6d433e 100644 --- a/community/@atlaskit__button/src/15.1.1/transform.ts +++ b/community/@atlaskit__button/src/15.1.1/transform.ts @@ -10,7 +10,7 @@ import { hasImportDeclaration, insertCommentToStartOfFile, getDefaultImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const relevantEntryPoints = [ '@atlaskit/button', diff --git a/community/@atlaskit__button/src/codeshift.config.js b/community/@atlaskit__button/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__button/src/codeshift.config.js rename to community/@atlaskit__button/src/hypermod.config.js diff --git a/community/@atlaskit__calendar/CHANGELOG.md b/community/@atlaskit__calendar/CHANGELOG.md index 512d368d9..2a9417e59 100644 --- a/community/@atlaskit__calendar/CHANGELOG.md +++ b/community/@atlaskit__calendar/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_calendar +# @hypermod/mod-atlaskit\_\_calendar ## 0.2.0 diff --git a/community/@atlaskit__calendar/package.json b/community/@atlaskit__calendar/package.json index 371eabcc6..62c70c490 100644 --- a/community/@atlaskit__calendar/package.json +++ b/community/@atlaskit__calendar/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__calendar", + "name": "@hypermod/mod-atlaskit__calendar", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__calendar" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__calendar" } diff --git a/community/@atlaskit__calendar/src/11.0.0/__tests__/remove-inner-props.spec.tsx b/community/@atlaskit__calendar/src/11.0.0/__tests__/remove-inner-props.spec.tsx index e4ac3e6c6..52bcf1dad 100644 --- a/community/@atlaskit__calendar/src/11.0.0/__tests__/remove-inner-props.spec.tsx +++ b/community/@atlaskit__calendar/src/11.0.0/__tests__/remove-inner-props.spec.tsx @@ -37,7 +37,7 @@ describe('Remove innerProps', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, @@ -73,7 +73,7 @@ describe('Remove innerProps', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, @@ -112,7 +112,7 @@ describe('Remove innerProps', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, diff --git a/community/@atlaskit__calendar/src/11.0.0/__tests__/transform.spec.ts b/community/@atlaskit__calendar/src/11.0.0/__tests__/transform.spec.ts index 40349c79f..39d76200a 100644 --- a/community/@atlaskit__calendar/src/11.0.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__calendar/src/11.0.0/__tests__/transform.spec.ts @@ -30,7 +30,7 @@ describe('@atlaskit/calendar@11.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, @@ -87,7 +87,7 @@ describe('@atlaskit/calendar@11.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, @@ -138,7 +138,7 @@ describe('@atlaskit/calendar@11.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/calendar \`innerProps\` which + /* TODO: (@hypermod) This file uses the @atlaskit/calendar \`innerProps\` which has now been removed due to its poor performance characteristics. Codemod has auto flattened 'className' & 'style' properties inside it if present as a standalone props to calendar. Rest other properties if any inside innerProps will get auto-removed along with it, diff --git a/community/@atlaskit__calendar/src/11.0.0/motions/flatten-certain-inner-props.ts b/community/@atlaskit__calendar/src/11.0.0/motions/flatten-certain-inner-props.ts index 74d19ae25..97f97d82e 100644 --- a/community/@atlaskit__calendar/src/11.0.0/motions/flatten-certain-inner-props.ts +++ b/community/@atlaskit__calendar/src/11.0.0/motions/flatten-certain-inner-props.ts @@ -2,7 +2,7 @@ import core, { Collection, Node, ObjectExpression } from 'jscodeshift'; import { getJSXAttributes, getDefaultImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const flattenCertainChildProps = ( j: core.JSCodeshift, diff --git a/community/@atlaskit__calendar/src/11.0.0/motions/remove-inner-props.ts b/community/@atlaskit__calendar/src/11.0.0/motions/remove-inner-props.ts index 5fd9bfc93..ae300f960 100644 --- a/community/@atlaskit__calendar/src/11.0.0/motions/remove-inner-props.ts +++ b/community/@atlaskit__calendar/src/11.0.0/motions/remove-inner-props.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const removeInnerProps = (j: core.JSCodeshift, source: Collection) => { const defaultSpecifier = getDefaultImportSpecifierName( diff --git a/community/@atlaskit__calendar/src/11.0.0/transform.ts b/community/@atlaskit__calendar/src/11.0.0/transform.ts index 5108ff375..82ffc5b04 100644 --- a/community/@atlaskit__calendar/src/11.0.0/transform.ts +++ b/community/@atlaskit__calendar/src/11.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { applyMotions, hasImportDeclaration } from '@codeshift/utils'; +import { applyMotions, hasImportDeclaration } from '@hypermod/utils'; import flattenCertainInnerProps from './motions/flatten-certain-inner-props'; import removeInnerProps from './motions/remove-inner-props'; diff --git a/community/@atlaskit__calendar/src/codeshift.config.js b/community/@atlaskit__calendar/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__calendar/src/codeshift.config.js rename to community/@atlaskit__calendar/src/hypermod.config.js diff --git a/community/@atlaskit__checkbox/CHANGELOG.md b/community/@atlaskit__checkbox/CHANGELOG.md index 721e40ae2..cd208f67b 100644 --- a/community/@atlaskit__checkbox/CHANGELOG.md +++ b/community/@atlaskit__checkbox/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_checkbox +# @hypermod/mod-atlaskit\_\_checkbox ## 0.2.0 diff --git a/community/@atlaskit__checkbox/package.json b/community/@atlaskit__checkbox/package.json index a740ade69..b630aa52c 100644 --- a/community/@atlaskit__checkbox/package.json +++ b/community/@atlaskit__checkbox/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__checkbox", + "name": "@hypermod/mod-atlaskit__checkbox", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__checkbox" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__checkbox" } diff --git a/community/@atlaskit__checkbox/src/12.0.0/__tests__/transform.spec.ts b/community/@atlaskit__checkbox/src/12.0.0/__tests__/transform.spec.ts index 89eb00bad..9e575e837 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/__tests__/transform.spec.ts @@ -93,7 +93,7 @@ describe('@atlaskit/checkbox@12.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/checkbox which + /* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/checkbox which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the theming. The appearance of Checkbox will have likely changed. */ @@ -122,7 +122,7 @@ describe('@atlaskit/checkbox@12.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/checkbox which + /* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/checkbox which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the theming. The appearance of Checkbox will have likely changed. */ @@ -293,7 +293,7 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`overrides\` prop + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`overrides\` prop which has now been removed due to its poor performance characteristics. We have not replaced overrides with an equivalent API and the overrides pattern exposes internal implementation detail as public API and makes it harder for you to upgrade. The appearance @@ -326,7 +326,7 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. However if you were using theme to customise the size of the checkbox there is now a \`size\` prop. @@ -371,12 +371,12 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`overrides\` prop + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`overrides\` prop which has now been removed due to its poor performance characteristics. We have not replaced overrides with an equivalent API and the overrides pattern exposes internal implementation detail as public API and makes it harder for you to upgrade. The appearance of Checkbox will have likely changed. */ - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. However if you were using theme to customise the size of the checkbox there is now a \`size\` prop. @@ -424,16 +424,16 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/checkbox which + /* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/checkbox which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the theming. The appearance of Checkbox will have likely changed. */ - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`overrides\` prop + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`overrides\` prop which has now been removed due to its poor performance characteristics. We have not replaced overrides with an equivalent API and the overrides pattern exposes internal implementation detail as public API and makes it harder for you to upgrade. The appearance of Checkbox will have likely changed. */ - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. However if you were using theme to customise the size of the checkbox there is now a \`size\` prop. @@ -472,7 +472,7 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. However if you were using theme to customise the size of the checkbox there is now a \`size\` prop. @@ -522,12 +522,12 @@ describe('Remove props', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`overrides\` prop + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`overrides\` prop which has now been removed due to its poor performance characteristics. We have not replaced overrides with an equivalent API and the overrides pattern exposes internal implementation detail as public API and makes it harder for you to upgrade. The appearance of Checkbox will have likely changed. */ - /* TODO: (@codeshift) This file uses the @atlaskit/checkbox \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/checkbox \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. However if you were using theme to customise the size of the checkbox there is now a \`size\` prop. diff --git a/community/@atlaskit__checkbox/src/12.0.0/motions/remove-imports.ts b/community/@atlaskit__checkbox/src/12.0.0/motions/remove-imports.ts index f7f602031..871288c48 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/motions/remove-imports.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/motions/remove-imports.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getImportDeclaration, hasImportDeclaration, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const createRemoveImportsFor = ({ diff --git a/community/@atlaskit__checkbox/src/12.0.0/motions/remove-props.ts b/community/@atlaskit__checkbox/src/12.0.0/motions/remove-props.ts index 806f47d67..5dbc23d17 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/motions/remove-props.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/motions/remove-props.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getJSXAttributes, getImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; const createRemoveFuncFor = (importPath: string, importName: string, prop: string, comment?: string) => diff --git a/community/@atlaskit__checkbox/src/12.0.0/motions/rename-import.ts b/community/@atlaskit__checkbox/src/12.0.0/motions/rename-import.ts index e6fb006f5..6a05e9c59 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/motions/rename-import.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/motions/rename-import.ts @@ -5,7 +5,7 @@ import core, { Collection, } from 'jscodeshift'; -import { hasImportDeclaration, getImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration, getImportDeclaration } from '@hypermod/utils'; function addToImport({ j, diff --git a/community/@atlaskit__checkbox/src/12.0.0/motions/rename-inputRef.ts b/community/@atlaskit__checkbox/src/12.0.0/motions/rename-inputRef.ts index b26e8b3a7..ad53da092 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/motions/rename-inputRef.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/motions/rename-inputRef.ts @@ -1,5 +1,5 @@ import core, { Node, Collection } from 'jscodeshift'; -import { getImportSpecifierName, getJSXAttributes } from '@codeshift/utils'; +import { getImportSpecifierName, getJSXAttributes } from '@hypermod/utils'; function hasVariableAssignment( j: core.JSCodeshift, diff --git a/community/@atlaskit__checkbox/src/12.0.0/transform.ts b/community/@atlaskit__checkbox/src/12.0.0/transform.ts index 8e9928702..b0fa3d7ca 100644 --- a/community/@atlaskit__checkbox/src/12.0.0/transform.ts +++ b/community/@atlaskit__checkbox/src/12.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { applyMotions, hasImportDeclaration } from '@codeshift/utils'; +import { applyMotions, hasImportDeclaration } from '@hypermod/utils'; import { removeThemeImports } from './motions/remove-imports'; import { diff --git a/community/@atlaskit__checkbox/src/codeshift.config.js b/community/@atlaskit__checkbox/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__checkbox/src/codeshift.config.js rename to community/@atlaskit__checkbox/src/hypermod.config.js diff --git a/community/@atlaskit__icon/CHANGELOG.md b/community/@atlaskit__icon/CHANGELOG.md index 7fb1b8115..c31cc15c0 100644 --- a/community/@atlaskit__icon/CHANGELOG.md +++ b/community/@atlaskit__icon/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_icon +# @hypermod/mod-atlaskit\_\_icon ## 0.2.0 diff --git a/community/@atlaskit__icon/package.json b/community/@atlaskit__icon/package.json index 0f975b42c..c9e68925d 100644 --- a/community/@atlaskit__icon/package.json +++ b/community/@atlaskit__icon/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__icon", + "name": "@hypermod/mod-atlaskit__icon", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__icon" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__icon" } diff --git a/community/@atlaskit__icon/src/21.2.0/transform.ts b/community/@atlaskit__icon/src/21.2.0/transform.ts index 0962f5023..9956d1d5f 100644 --- a/community/@atlaskit__icon/src/21.2.0/transform.ts +++ b/community/@atlaskit__icon/src/21.2.0/transform.ts @@ -7,7 +7,7 @@ import core, { ImportDefaultSpecifier, ASTPath, } from 'jscodeshift'; -import { hasImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration } from '@hypermod/utils'; const packageName = '@atlaskit/icon'; diff --git a/community/@atlaskit__icon/src/codeshift.config.js b/community/@atlaskit__icon/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__icon/src/codeshift.config.js rename to community/@atlaskit__icon/src/hypermod.config.js diff --git a/community/@atlaskit__menu/CHANGELOG.md b/community/@atlaskit__menu/CHANGELOG.md index 2db7777ed..3ce61d95d 100644 --- a/community/@atlaskit__menu/CHANGELOG.md +++ b/community/@atlaskit__menu/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_menu +# @hypermod/mod-atlaskit\_\_menu ## 0.2.0 diff --git a/community/@atlaskit__menu/package.json b/community/@atlaskit__menu/package.json index 5cfa551fa..648448310 100644 --- a/community/@atlaskit__menu/package.json +++ b/community/@atlaskit__menu/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__menu", + "name": "@hypermod/mod-atlaskit__menu", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__menu" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__menu" } diff --git a/community/@atlaskit__menu/src/0.7.0/__tests__/transform.spec.ts b/community/@atlaskit__menu/src/0.7.0/__tests__/transform.spec.ts index bf3bc1693..2850efd1d 100644 --- a/community/@atlaskit__menu/src/0.7.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__menu/src/0.7.0/__tests__/transform.spec.ts @@ -172,7 +172,7 @@ describe('@atlaskit/menu@0.7.0 transform', () => { return ( { return ( { return ( { )}; `, ` - /* TODO: (@codeshift) Popper.js has been upgraded from 1.14.1 to 2.4.2, + /* TODO: (@hypermod) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the modifier prop has changed significantly. The format has been changed from object of objects, to array of objects, with the key for each modifier replaced with a name key:value pair inside the modifier object, and an options:object @@ -307,7 +307,7 @@ describe('@atlaskit/popper@5.0.0 transform', () => { ); `, ` - /* TODO: (@codeshift) Popper.js has been upgraded from 1.14.1 to 2.4.2, + /* TODO: (@hypermod) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset prop has changed to be an array. e.g '0px 8px' -> [0, 8] Along with this change you cannot use vw, vh or % units or addition or multiplication Change the offset value to use pixel values @@ -352,7 +352,7 @@ describe('@atlaskit/popper@5.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset + /* TODO: (@hypermod) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset prop has changed to be an array. e.g '0px 8px' -> [0, 8] As you are using a variable, you will have change the offset prop manually Further details can be found in the popper docs https://popper.js.org/docs/v2/modifiers/offset/ */ diff --git a/community/@atlaskit__popper/src/5.0.0/motions/update-modifier-prop.ts b/community/@atlaskit__popper/src/5.0.0/motions/update-modifier-prop.ts index 1b650cce1..090d12d96 100644 --- a/community/@atlaskit__popper/src/5.0.0/motions/update-modifier-prop.ts +++ b/community/@atlaskit__popper/src/5.0.0/motions/update-modifier-prop.ts @@ -1,5 +1,5 @@ import core, { Collection, JSXElement } from 'jscodeshift'; -import { insertCommentToStartOfFile, hasJSXAttributes } from '@codeshift/utils'; +import { insertCommentToStartOfFile, hasJSXAttributes } from '@hypermod/utils'; import { NodePath } from 'ast-types/lib/node-path'; import { messageForModifierProps } from '../constants'; diff --git a/community/@atlaskit__popper/src/5.0.0/motions/update-offset.ts b/community/@atlaskit__popper/src/5.0.0/motions/update-offset.ts index 739138450..13277d9e4 100644 --- a/community/@atlaskit__popper/src/5.0.0/motions/update-offset.ts +++ b/community/@atlaskit__popper/src/5.0.0/motions/update-offset.ts @@ -6,7 +6,7 @@ import core, { Literal, Collection, } from 'jscodeshift'; -import { getJSXAttributes, insertCommentToStartOfFile } from '@codeshift/utils'; +import { getJSXAttributes, insertCommentToStartOfFile } from '@hypermod/utils'; import { messageForUsingExpression, diff --git a/community/@atlaskit__popper/src/5.0.0/transform.ts b/community/@atlaskit__popper/src/5.0.0/transform.ts index 8319931e4..35ea09183 100644 --- a/community/@atlaskit__popper/src/5.0.0/transform.ts +++ b/community/@atlaskit__popper/src/5.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { hasImportDeclaration, getImportSpecifierName } from '@codeshift/utils'; +import { hasImportDeclaration, getImportSpecifierName } from '@hypermod/utils'; import updateRenderProps from './motions/update-render-props'; import updateOffset from './motions/update-offset'; diff --git a/community/@atlaskit__popper/src/codeshift.config.js b/community/@atlaskit__popper/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__popper/src/codeshift.config.js rename to community/@atlaskit__popper/src/hypermod.config.js diff --git a/community/@atlaskit__popup/CHANGELOG.md b/community/@atlaskit__popup/CHANGELOG.md index ecf336d96..8c4664f64 100644 --- a/community/@atlaskit__popup/CHANGELOG.md +++ b/community/@atlaskit__popup/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_popup +# @hypermod/mod-atlaskit\_\_popup ## 0.2.0 diff --git a/community/@atlaskit__popup/package.json b/community/@atlaskit__popup/package.json index c1d0449c7..6cb8ae620 100644 --- a/community/@atlaskit__popup/package.json +++ b/community/@atlaskit__popup/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__popup", + "name": "@hypermod/mod-atlaskit__popup", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__popup" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__popup" } diff --git a/community/@atlaskit__popup/src/1.0.0/__tests__/transform.spec.ts b/community/@atlaskit__popup/src/1.0.0/__tests__/transform.spec.ts index 19860301c..c489c0a88 100644 --- a/community/@atlaskit__popup/src/1.0.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__popup/src/1.0.0/__tests__/transform.spec.ts @@ -323,7 +323,7 @@ describe('Convert offset props', () => { ); `, expected: ` - /* TODO: (@codeshift) Popper.js has been upgraded from 1.14.1 to 2.4.2, + /* TODO: (@hypermod) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset prop has changed to be an array. e.g '0px 8px' -> [0, 8] Along with this change you cannot use vw, vh or % units or addition or multiplication Change the offset value to use pixel values @@ -372,7 +372,7 @@ describe('Convert offset props', () => { } `, expected: ` - /* TODO: (@codeshift) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset + /* TODO: (@hypermod) Popper.js has been upgraded from 1.14.1 to 2.4.2, and as a result the offset prop has changed to be an array. e.g '0px 8px' -> [0, 8] As you are using a variable, you will have change the offset prop manually Further details can be found in the popper docs https://popper.js.org/docs/v2/modifiers/offset/ */ diff --git a/community/@atlaskit__popup/src/1.0.0/motions/update-boundaries-props.ts b/community/@atlaskit__popup/src/1.0.0/motions/update-boundaries-props.ts index 88f8cdb2a..03d2fc298 100644 --- a/community/@atlaskit__popup/src/1.0.0/motions/update-boundaries-props.ts +++ b/community/@atlaskit__popup/src/1.0.0/motions/update-boundaries-props.ts @@ -3,7 +3,7 @@ import { hasJSXAttributes, removeJSXAttributes, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; import { NodePath } from 'ast-types/lib/node-path'; function isUsingSupportedSpread( diff --git a/community/@atlaskit__popup/src/1.0.0/motions/update-offset.ts b/community/@atlaskit__popup/src/1.0.0/motions/update-offset.ts index a34de2689..a80094990 100644 --- a/community/@atlaskit__popup/src/1.0.0/motions/update-offset.ts +++ b/community/@atlaskit__popup/src/1.0.0/motions/update-offset.ts @@ -1,6 +1,6 @@ import core, { ASTPath, JSXElement, Collection } from 'jscodeshift'; -import { getJSXAttributes, insertCommentToStartOfFile } from '@codeshift/utils'; +import { getJSXAttributes, insertCommentToStartOfFile } from '@hypermod/utils'; export default function updateOffset( j: core.JSCodeshift, diff --git a/community/@atlaskit__popup/src/1.0.0/transform.ts b/community/@atlaskit__popup/src/1.0.0/transform.ts index 26a6bd615..5e0524d10 100644 --- a/community/@atlaskit__popup/src/1.0.0/transform.ts +++ b/community/@atlaskit__popup/src/1.0.0/transform.ts @@ -3,7 +3,7 @@ import { hasImportDeclaration, getDefaultImportSpecifierName, getImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; import updateBoundariesProps from './motions/update-boundaries-props'; import updateOffset from './motions/update-offset'; diff --git a/community/@atlaskit__popup/src/codeshift.config.js b/community/@atlaskit__popup/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__popup/src/codeshift.config.js rename to community/@atlaskit__popup/src/hypermod.config.js diff --git a/community/@atlaskit__progress-indicator/CHANGELOG.md b/community/@atlaskit__progress-indicator/CHANGELOG.md index 726b5b0e2..2416053fa 100644 --- a/community/@atlaskit__progress-indicator/CHANGELOG.md +++ b/community/@atlaskit__progress-indicator/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_progress-indicator +# @hypermod/mod-atlaskit\_\_progress-indicator ## 0.2.0 diff --git a/community/@atlaskit__progress-indicator/package.json b/community/@atlaskit__progress-indicator/package.json index 04681a0e3..3c5454e5c 100644 --- a/community/@atlaskit__progress-indicator/package.json +++ b/community/@atlaskit__progress-indicator/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__progress-indicator", + "name": "@hypermod/mod-atlaskit__progress-indicator", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__progress-indicator" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__progress-indicator" } diff --git a/community/@atlaskit__progress-indicator/src/9.0.0/transform.ts b/community/@atlaskit__progress-indicator/src/9.0.0/transform.ts index e2733f045..2d6662894 100644 --- a/community/@atlaskit__progress-indicator/src/9.0.0/transform.ts +++ b/community/@atlaskit__progress-indicator/src/9.0.0/transform.ts @@ -1,5 +1,5 @@ import core, { API, FileInfo, Options } from 'jscodeshift'; -import { hasImportDeclaration, hasImportSpecifier } from '@codeshift/utils'; +import { hasImportDeclaration, hasImportSpecifier } from '@hypermod/utils'; function hasVariableAlreadyDeclared( j: core.JSCodeshift, diff --git a/community/@atlaskit__progress-indicator/src/codeshift.config.js b/community/@atlaskit__progress-indicator/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__progress-indicator/src/codeshift.config.js rename to community/@atlaskit__progress-indicator/src/hypermod.config.js diff --git a/community/@atlaskit__range/CHANGELOG.md b/community/@atlaskit__range/CHANGELOG.md index 8a05b60f5..c40381da7 100644 --- a/community/@atlaskit__range/CHANGELOG.md +++ b/community/@atlaskit__range/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_range +# @hypermod/mod-atlaskit\_\_range ## 0.2.0 diff --git a/community/@atlaskit__range/package.json b/community/@atlaskit__range/package.json index f2f383bba..93eba2d74 100644 --- a/community/@atlaskit__range/package.json +++ b/community/@atlaskit__range/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__range", + "name": "@hypermod/mod-atlaskit__range", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__range" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__range" } diff --git a/community/@atlaskit__range/src/4.0.0/transform.ts b/community/@atlaskit__range/src/4.0.0/transform.ts index 7eea1a390..76f799b6c 100644 --- a/community/@atlaskit__range/src/4.0.0/transform.ts +++ b/community/@atlaskit__range/src/4.0.0/transform.ts @@ -2,7 +2,7 @@ import { API, FileInfo, Options } from 'jscodeshift'; import { getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; export default function transformer( fileInfo: FileInfo, diff --git a/community/@atlaskit__range/src/codeshift.config.js b/community/@atlaskit__range/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__range/src/codeshift.config.js rename to community/@atlaskit__range/src/hypermod.config.js diff --git a/community/@atlaskit__section-message/CHANGELOG.md b/community/@atlaskit__section-message/CHANGELOG.md index 97fd3be71..adddfe331 100644 --- a/community/@atlaskit__section-message/CHANGELOG.md +++ b/community/@atlaskit__section-message/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_section-message +# @hypermod/mod-atlaskit\_\_section-message ## 0.2.0 diff --git a/community/@atlaskit__section-message/package.json b/community/@atlaskit__section-message/package.json index 32713f345..9479524e4 100644 --- a/community/@atlaskit__section-message/package.json +++ b/community/@atlaskit__section-message/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__section-message", + "name": "@hypermod/mod-atlaskit__section-message", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__section-message" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__section-message" } diff --git a/community/@atlaskit__section-message/src/6.0.0/__tests__/change-appearance-prop.ts b/community/@atlaskit__section-message/src/6.0.0/__tests__/change-appearance-prop.ts index 43d8c4831..354cef9b0 100644 --- a/community/@atlaskit__section-message/src/6.0.0/__tests__/change-appearance-prop.ts +++ b/community/@atlaskit__section-message/src/6.0.0/__tests__/change-appearance-prop.ts @@ -301,7 +301,7 @@ describe('SectionMessage code-mods', () => { const { appearanceValue } = props; return ( { const { appearanceValue } = props; return ( { const App = () => { return ( { const SectionMessageDynamicImport = React.lazy(() => import('@atlaskit/section-message')); - /* TODO: (@codeshift) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ + /* TODO: (@hypermod) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ const SectionMessageAction = React.lazy(() => import("@atlaskit/section-message/section-message-action")); const actions = [ @@ -468,7 +468,7 @@ describe('map actions prop to components', () => { const SectionMessageDynamicImport = React.lazy(() => import('@atlaskit/section-message')); - /* TODO: (@codeshift) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ + /* TODO: (@hypermod) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ const SectionMessageAction = React.lazy(() => import("@atlaskit/section-message/section-message-action")); export default () => ( @@ -520,7 +520,7 @@ describe('map actions prop to components', () => { const SectionMessageDynamicImport = React.lazy(() => import('@atlaskit/section-message')); - /* TODO: (@codeshift) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ + /* TODO: (@hypermod) We have added \`React.lazy\` here. Feel free to change it to \`lazy\` or other named import depending upon how you imported. */ const AtlaskitSectionMessageAction = React.lazy(() => import("@atlaskit/section-message/section-message-action")); const SectionMessageAction = () => {}; diff --git a/community/@atlaskit__section-message/src/6.0.0/motions/change-appearance-prop.ts b/community/@atlaskit__section-message/src/6.0.0/motions/change-appearance-prop.ts index 9dc3f96f7..4bcce28ba 100644 --- a/community/@atlaskit__section-message/src/6.0.0/motions/change-appearance-prop.ts +++ b/community/@atlaskit__section-message/src/6.0.0/motions/change-appearance-prop.ts @@ -5,7 +5,7 @@ import { insertCommentBefore, getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; import { APPEARANCE_OLD_TO_NEW_MAPPING, diff --git a/community/@atlaskit__section-message/src/6.0.0/motions/map-actions-prop.ts b/community/@atlaskit__section-message/src/6.0.0/motions/map-actions-prop.ts index 3d33d6aa6..d7585325c 100644 --- a/community/@atlaskit__section-message/src/6.0.0/motions/map-actions-prop.ts +++ b/community/@atlaskit__section-message/src/6.0.0/motions/map-actions-prop.ts @@ -13,7 +13,7 @@ import { insertCommentBefore, getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; import { ACTIONS_PROP_NAME, diff --git a/community/@atlaskit__section-message/src/6.0.0/transform.ts b/community/@atlaskit__section-message/src/6.0.0/transform.ts index 7ce72543a..776f9d2fb 100644 --- a/community/@atlaskit__section-message/src/6.0.0/transform.ts +++ b/community/@atlaskit__section-message/src/6.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { applyMotions, hasImportDeclaration } from '@codeshift/utils'; +import { applyMotions, hasImportDeclaration } from '@hypermod/utils'; import { SECTION_MESSAGE_PACKAGE_NAME } from './constants'; import { getDynamicImportName } from './utils'; diff --git a/community/@atlaskit__section-message/src/codeshift.config.js b/community/@atlaskit__section-message/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__section-message/src/codeshift.config.js rename to community/@atlaskit__section-message/src/hypermod.config.js diff --git a/community/@atlaskit__side-navigation/CHANGELOG.md b/community/@atlaskit__side-navigation/CHANGELOG.md index c1cbab361..c62289dc5 100644 --- a/community/@atlaskit__side-navigation/CHANGELOG.md +++ b/community/@atlaskit__side-navigation/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_side-navigation +# @hypermod/mod-atlaskit\_\_side-navigation ## 0.2.0 diff --git a/community/@atlaskit__side-navigation/package.json b/community/@atlaskit__side-navigation/package.json index 5d8c8f45b..2e4a7fd8f 100644 --- a/community/@atlaskit__side-navigation/package.json +++ b/community/@atlaskit__side-navigation/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__side-navigation", + "name": "@hypermod/mod-atlaskit__side-navigation", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__side-navigation" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__side-navigation" } diff --git a/community/@atlaskit__side-navigation/src/0.8.0/__tests__/transform.spec.ts b/community/@atlaskit__side-navigation/src/0.8.0/__tests__/transform.spec.ts index 2505b2481..9e3a6c5bf 100644 --- a/community/@atlaskit__side-navigation/src/0.8.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__side-navigation/src/0.8.0/__tests__/transform.spec.ts @@ -173,7 +173,7 @@ describe('@atlaskit/side-navigation@0.8.0 transform', () => { return ( { return ( { return ( { const defaultSpecifier = getDefaultImportSpecifierName( diff --git a/community/@atlaskit__tag/src/11.0.0/motions/rename-remove-button-text.ts b/community/@atlaskit__tag/src/11.0.0/motions/rename-remove-button-text.ts index e92cc3a8c..b0204be67 100644 --- a/community/@atlaskit__tag/src/11.0.0/motions/rename-remove-button-text.ts +++ b/community/@atlaskit__tag/src/11.0.0/motions/rename-remove-button-text.ts @@ -2,7 +2,7 @@ import core from 'jscodeshift'; import { getJSXAttributes, getDefaultImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; export const renameRemoveButtonText = (j: core.JSCodeshift, source: any) => { const defaultSpecifier = getDefaultImportSpecifierName( diff --git a/community/@atlaskit__tag/src/11.0.0/motions/replace-import-statements.ts b/community/@atlaskit__tag/src/11.0.0/motions/replace-import-statements.ts index daa3308c3..b5f9bd0a5 100644 --- a/community/@atlaskit__tag/src/11.0.0/motions/replace-import-statements.ts +++ b/community/@atlaskit__tag/src/11.0.0/motions/replace-import-statements.ts @@ -1,5 +1,5 @@ import core from 'jscodeshift'; -import { getImportDeclaration } from '@codeshift/utils'; +import { getImportDeclaration } from '@hypermod/utils'; const convertMap: Record = { Tag: '@atlaskit/tag/removable-tag', diff --git a/community/@atlaskit__tag/src/11.0.0/transform.ts b/community/@atlaskit__tag/src/11.0.0/transform.ts index 1644a14d3..fffd52da8 100644 --- a/community/@atlaskit__tag/src/11.0.0/transform.ts +++ b/community/@atlaskit__tag/src/11.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { applyMotions, hasImportDeclaration } from '@codeshift/utils'; +import { applyMotions, hasImportDeclaration } from '@hypermod/utils'; import { addIsRemovableFlag } from './motions/add-isRemovable-flag'; import { renameRemoveButtonText } from './motions/rename-remove-button-text'; diff --git a/community/@atlaskit__tag/src/codeshift.config.js b/community/@atlaskit__tag/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__tag/src/codeshift.config.js rename to community/@atlaskit__tag/src/hypermod.config.js diff --git a/community/@atlaskit__textarea/CHANGELOG.md b/community/@atlaskit__textarea/CHANGELOG.md index 81178afe1..beff34877 100644 --- a/community/@atlaskit__textarea/CHANGELOG.md +++ b/community/@atlaskit__textarea/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_textarea +# @hypermod/mod-atlaskit\_\_textarea ## 0.2.0 diff --git a/community/@atlaskit__textarea/package.json b/community/@atlaskit__textarea/package.json index 4fd0a8dba..59531a1f2 100644 --- a/community/@atlaskit__textarea/package.json +++ b/community/@atlaskit__textarea/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__textarea", + "name": "@hypermod/mod-atlaskit__textarea", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__textarea" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textarea" } diff --git a/community/@atlaskit__textarea/src/4.0.0/transform.ts b/community/@atlaskit__textarea/src/4.0.0/transform.ts index 0489bd164..5eb964d16 100644 --- a/community/@atlaskit__textarea/src/4.0.0/transform.ts +++ b/community/@atlaskit__textarea/src/4.0.0/transform.ts @@ -2,7 +2,7 @@ import { API, FileInfo, Options } from 'jscodeshift'; import { getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; export default function transformer( fileInfo: FileInfo, diff --git a/community/@atlaskit__textarea/src/codeshift.config.js b/community/@atlaskit__textarea/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__textarea/src/codeshift.config.js rename to community/@atlaskit__textarea/src/hypermod.config.js diff --git a/community/@atlaskit__textfield/CHANGELOG.md b/community/@atlaskit__textfield/CHANGELOG.md index 6f705a086..a4dead937 100644 --- a/community/@atlaskit__textfield/CHANGELOG.md +++ b/community/@atlaskit__textfield/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_textfield +# @hypermod/mod-atlaskit\_\_textfield ## 0.2.0 diff --git a/community/@atlaskit__textfield/package.json b/community/@atlaskit__textfield/package.json index bcabcfd7e..19e96b7fc 100644 --- a/community/@atlaskit__textfield/package.json +++ b/community/@atlaskit__textfield/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__textfield", + "name": "@hypermod/mod-atlaskit__textfield", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__textfield" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textfield" } diff --git a/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-imports.spec.ts b/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-imports.spec.ts index 64cd0ed9f..74aa608b5 100644 --- a/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-imports.spec.ts +++ b/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-imports.spec.ts @@ -16,7 +16,7 @@ function transformer( } const importToDoComment = ` -/* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/textfield which +/* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/textfield which has now been removed due to its poor performance characteristics. */`; describe('Remove imports', () => { diff --git a/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-prop.spec.ts b/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-prop.spec.ts index c77994d55..d500e485e 100644 --- a/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-prop.spec.ts +++ b/community/@atlaskit__textfield/src/5.0.0/__tests__/remove-prop.spec.ts @@ -16,7 +16,7 @@ function transformer( } const themeToDoComment = ` -/* TODO: (@codeshift) This file uses the @atlaskit/textfield \`theme\` prop which +/* TODO: (@hypermod) This file uses the @atlaskit/textfield \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. The appearance of TextField will have likely changed. */`; diff --git a/community/@atlaskit__textfield/src/5.0.0/__tests__/transform.spec.ts b/community/@atlaskit__textfield/src/5.0.0/__tests__/transform.spec.ts index 72347c65b..3570e30a1 100644 --- a/community/@atlaskit__textfield/src/5.0.0/__tests__/transform.spec.ts +++ b/community/@atlaskit__textfield/src/5.0.0/__tests__/transform.spec.ts @@ -20,11 +20,11 @@ describe('@atlaskit/textfield@5.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/textfield \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/textfield \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. The appearance of TextField will have likely changed. */ - /* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/textfield which + /* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/textfield which has now been removed due to its poor performance characteristics. */ import Textfield, { Appearance, TextFieldColors as ColorTokens } from '@atlaskit/textfield'; import customeTheme from './theme'; @@ -67,11 +67,11 @@ describe('@atlaskit/textfield@5.0.0 transform', () => { } `, ` - /* TODO: (@codeshift) This file uses the @atlaskit/textfield \`theme\` prop which + /* TODO: (@hypermod) This file uses the @atlaskit/textfield \`theme\` prop which has now been removed due to its poor performance characteristics. We have not replaced theme with an equivalent API due to minimal usage of the \`theme\` prop. The appearance of TextField will have likely changed. */ - /* TODO: (@codeshift) This file uses exports used to help theme @atlaskit/textfield which + /* TODO: (@hypermod) This file uses exports used to help theme @atlaskit/textfield which has now been removed due to its poor performance characteristics. */ import Textfield from '@atlaskit/textfield'; import React from 'react'; diff --git a/community/@atlaskit__textfield/src/5.0.0/motions/remove-imports.ts b/community/@atlaskit__textfield/src/5.0.0/motions/remove-imports.ts index 3313650ed..1c44455c4 100644 --- a/community/@atlaskit__textfield/src/5.0.0/motions/remove-imports.ts +++ b/community/@atlaskit__textfield/src/5.0.0/motions/remove-imports.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getImportDeclaration, hasImportDeclaration, -} from '@codeshift/utils'; +} from '@hypermod/utils'; export const removeThemeImports = ( j: core.JSCodeshift, diff --git a/community/@atlaskit__textfield/src/5.0.0/motions/remove-props.ts b/community/@atlaskit__textfield/src/5.0.0/motions/remove-props.ts index b1c8374a2..89ffbdb67 100644 --- a/community/@atlaskit__textfield/src/5.0.0/motions/remove-props.ts +++ b/community/@atlaskit__textfield/src/5.0.0/motions/remove-props.ts @@ -3,7 +3,7 @@ import { insertCommentToStartOfFile, getDefaultImportSpecifierName, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; export const removeThemeProp = ( j: core.JSCodeshift, diff --git a/community/@atlaskit__textfield/src/5.0.0/motions/rename-imports.ts b/community/@atlaskit__textfield/src/5.0.0/motions/rename-imports.ts index 3e055776e..c50cbfc1b 100644 --- a/community/@atlaskit__textfield/src/5.0.0/motions/rename-imports.ts +++ b/community/@atlaskit__textfield/src/5.0.0/motions/rename-imports.ts @@ -1,5 +1,5 @@ import core, { Collection } from 'jscodeshift'; -import { getImportDeclaration, getImportSpecifierName } from '@codeshift/utils'; +import { getImportDeclaration, getImportSpecifierName } from '@hypermod/utils'; function getSafeImportName( j: core.JSCodeshift, diff --git a/community/@atlaskit__textfield/src/5.0.0/transform.ts b/community/@atlaskit__textfield/src/5.0.0/transform.ts index c03090f9d..c15102c86 100644 --- a/community/@atlaskit__textfield/src/5.0.0/transform.ts +++ b/community/@atlaskit__textfield/src/5.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { applyMotions, hasImportDeclaration } from '@codeshift/utils'; +import { applyMotions, hasImportDeclaration } from '@hypermod/utils'; import { removeThemeImports } from './motions/remove-imports'; import { removeThemeProp } from './motions/remove-props'; diff --git a/community/@atlaskit__textfield/src/codeshift.config.js b/community/@atlaskit__textfield/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__textfield/src/codeshift.config.js rename to community/@atlaskit__textfield/src/hypermod.config.js diff --git a/community/@atlaskit__toggle/CHANGELOG.md b/community/@atlaskit__toggle/CHANGELOG.md index 6c8ef191e..f439314f1 100644 --- a/community/@atlaskit__toggle/CHANGELOG.md +++ b/community/@atlaskit__toggle/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-atlaskit\_\_toggle +# @hypermod/mod-atlaskit\_\_toggle ## 0.2.0 diff --git a/community/@atlaskit__toggle/package.json b/community/@atlaskit__toggle/package.json index 42e14e09b..52b5039f9 100644 --- a/community/@atlaskit__toggle/package.json +++ b/community/@atlaskit__toggle/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-atlaskit__toggle", + "name": "@hypermod/mod-atlaskit__toggle", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@atlaskit__toggle" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__toggle" } diff --git a/community/@atlaskit__toggle/src/11.0.0/transform.ts b/community/@atlaskit__toggle/src/11.0.0/transform.ts index 37f3ad72c..fad7952ea 100644 --- a/community/@atlaskit__toggle/src/11.0.0/transform.ts +++ b/community/@atlaskit__toggle/src/11.0.0/transform.ts @@ -3,7 +3,7 @@ import { getDefaultImportSpecifierName, hasImportDeclaration, getJSXAttributes, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function findIdentifierAndReplaceAttribute( j: core.JSCodeshift, diff --git a/community/@atlaskit__toggle/src/12.0.0/motions/elevate-stateless.ts b/community/@atlaskit__toggle/src/12.0.0/motions/elevate-stateless.ts index d7fe8070c..f47a26fc3 100644 --- a/community/@atlaskit__toggle/src/12.0.0/motions/elevate-stateless.ts +++ b/community/@atlaskit__toggle/src/12.0.0/motions/elevate-stateless.ts @@ -1,5 +1,5 @@ import core from 'jscodeshift'; -import { getImportDeclaration } from '@codeshift/utils'; +import { getImportDeclaration } from '@hypermod/utils'; const elevateStateless = (j: core.JSCodeshift, root: any) => { getImportDeclaration(j, root, '@atlaskit/toggle').forEach(path => { diff --git a/community/@atlaskit__toggle/src/12.0.0/motions/rename-togglestateless.ts b/community/@atlaskit__toggle/src/12.0.0/motions/rename-togglestateless.ts index 8c2dcabec..d239e6280 100644 --- a/community/@atlaskit__toggle/src/12.0.0/motions/rename-togglestateless.ts +++ b/community/@atlaskit__toggle/src/12.0.0/motions/rename-togglestateless.ts @@ -2,7 +2,7 @@ import core, { ASTPath, Collection, Identifier } from 'jscodeshift'; import { getImportDeclaration, getDefaultImportSpecifierName, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function getSafeImportName( j: core.JSCodeshift, diff --git a/community/@atlaskit__toggle/src/12.0.0/transform.ts b/community/@atlaskit__toggle/src/12.0.0/transform.ts index 66a99a42b..577208c9d 100644 --- a/community/@atlaskit__toggle/src/12.0.0/transform.ts +++ b/community/@atlaskit__toggle/src/12.0.0/transform.ts @@ -1,5 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { hasImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration } from '@hypermod/utils'; import elevateStateless from './motions/elevate-stateless'; import renameToggleStateless from './motions/rename-togglestateless'; diff --git a/community/@atlaskit__toggle/src/codeshift.config.js b/community/@atlaskit__toggle/src/hypermod.config.js similarity index 100% rename from community/@atlaskit__toggle/src/codeshift.config.js rename to community/@atlaskit__toggle/src/hypermod.config.js diff --git a/community/@emotion__monorepo/CHANGELOG.md b/community/@emotion__monorepo/CHANGELOG.md index 30308d65d..36d3658a8 100644 --- a/community/@emotion__monorepo/CHANGELOG.md +++ b/community/@emotion__monorepo/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-emotion\_\_monorepo +# @hypermod/mod-emotion\_\_monorepo ## 0.2.0 diff --git a/community/@emotion__monorepo/package.json b/community/@emotion__monorepo/package.json index 9bdff84a7..3376ebd82 100644 --- a/community/@emotion__monorepo/package.json +++ b/community/@emotion__monorepo/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-emotion__monorepo", + "name": "@hypermod/mod-emotion__monorepo", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/@emotion__monorepo" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@emotion__monorepo" } diff --git a/community/@emotion__monorepo/src/11.0.0/transform.spec.ts b/community/@emotion__monorepo/src/11.0.0/transform.spec.ts index 4119d8ada..07eb6cb3a 100644 --- a/community/@emotion__monorepo/src/11.0.0/transform.spec.ts +++ b/community/@emotion__monorepo/src/11.0.0/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('@emotion@11.0.0 transform', () => { diff --git a/community/@emotion__monorepo/src/11.0.0/transform.ts b/community/@emotion__monorepo/src/11.0.0/transform.ts index e156b74e9..6af47723b 100644 --- a/community/@emotion__monorepo/src/11.0.0/transform.ts +++ b/community/@emotion__monorepo/src/11.0.0/transform.ts @@ -1,8 +1,5 @@ import { API, FileInfo, Options } from 'jscodeshift'; -import { - hasImportDeclaration, - renameImportDeclaration, -} from '@codeshift/utils'; +import { hasImportDeclaration, renameImportDeclaration } from '@hypermod/utils'; const importMap = { '@emotion/core': '@emotion/react', diff --git a/community/@emotion__monorepo/src/codeshift.config.js b/community/@emotion__monorepo/src/hypermod.config.js similarity index 100% rename from community/@emotion__monorepo/src/codeshift.config.js rename to community/@emotion__monorepo/src/hypermod.config.js diff --git a/community/javascript/CHANGELOG.md b/community/javascript/CHANGELOG.md index abf89e562..f7c263935 100644 --- a/community/javascript/CHANGELOG.md +++ b/community/javascript/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-javascript +# @hypermod/mod-javascript ## 0.2.0 diff --git a/community/javascript/package.json b/community/javascript/package.json index f0ccc07ef..504548771 100644 --- a/community/javascript/package.json +++ b/community/javascript/package.json @@ -1,24 +1,23 @@ { - "name": "@codeshift/mod-javascript", + "name": "@hypermod/mod-javascript", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "@putout/plugin-remove-unused-variables": "^5.1.0", "jscodeshift": "^0.13.1", "putout": "^29.5.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -26,5 +25,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/javascript" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/javascript" } diff --git a/community/javascript/src/codeshift.config.js b/community/javascript/src/hypermod.config.js similarity index 100% rename from community/javascript/src/codeshift.config.js rename to community/javascript/src/hypermod.config.js diff --git a/community/javascript/src/remove-console-log/transform.spec.ts b/community/javascript/src/remove-console-log/transform.spec.ts index 637a2b8ef..f823281db 100644 --- a/community/javascript/src/remove-console-log/transform.spec.ts +++ b/community/javascript/src/remove-console-log/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('javascript#remove-console-log transform', () => { diff --git a/community/javascript/src/remove-debugger/transform.spec.ts b/community/javascript/src/remove-debugger/transform.spec.ts index 05a0b96b3..d4d44f2f9 100644 --- a/community/javascript/src/remove-debugger/transform.spec.ts +++ b/community/javascript/src/remove-debugger/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('javascript#remove-debugger transform', () => { diff --git a/community/javascript/src/remove-unused-vars/transform.spec.ts b/community/javascript/src/remove-unused-vars/transform.spec.ts index fb3e60be2..851324bbe 100644 --- a/community/javascript/src/remove-unused-vars/transform.spec.ts +++ b/community/javascript/src/remove-unused-vars/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('javascript#remove-unused-vars transform', () => { diff --git a/community/javascript/src/sort-object-props/transform.spec.ts b/community/javascript/src/sort-object-props/transform.spec.ts index ae71d7fe6..59bc5906f 100644 --- a/community/javascript/src/sort-object-props/transform.spec.ts +++ b/community/javascript/src/sort-object-props/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('javascript#sort-object-props transform', () => { diff --git a/community/javascript/src/var-to-let/transform.spec.ts b/community/javascript/src/var-to-let/transform.spec.ts index 58910286e..34c0c69f1 100644 --- a/community/javascript/src/var-to-let/transform.spec.ts +++ b/community/javascript/src/var-to-let/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('javascript#var-to-let transform', () => { diff --git a/community/memoize-one/CHANGELOG.md b/community/memoize-one/CHANGELOG.md index 3631a5500..bed45106e 100644 --- a/community/memoize-one/CHANGELOG.md +++ b/community/memoize-one/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-memoize-one +# @hypermod/mod-memoize-one ## 0.2.0 diff --git a/community/memoize-one/package.json b/community/memoize-one/package.json index 1c1645560..6901fd962 100644 --- a/community/memoize-one/package.json +++ b/community/memoize-one/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-memoize-one", + "name": "@hypermod/mod-memoize-one", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/memoize-one" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/memoize-one" } diff --git a/community/memoize-one/src/5.0.0/transform.spec.ts b/community/memoize-one/src/5.0.0/transform.spec.ts index ecad3ff15..5bff1543c 100644 --- a/community/memoize-one/src/5.0.0/transform.spec.ts +++ b/community/memoize-one/src/5.0.0/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; import prettier from 'prettier'; @@ -179,7 +179,7 @@ describe('memoize-one@5.0.0 transform', () => { expect(result).toEqual( format(` - /* TODO: (@codeshift) Unable to migrate memoize-one custom equality function. + /* TODO: (@hypermod) Unable to migrate memoize-one custom equality function. Expected a function or an identifier */ import memoize from 'memoize-one'; diff --git a/community/memoize-one/src/5.0.0/transform.ts b/community/memoize-one/src/5.0.0/transform.ts index 33fa0a24b..6559a70ec 100644 --- a/community/memoize-one/src/5.0.0/transform.ts +++ b/community/memoize-one/src/5.0.0/transform.ts @@ -2,7 +2,7 @@ import { hasImportDeclaration, getDefaultImportSpecifierName, insertCommentToStartOfFile, -} from '@codeshift/utils'; +} from '@hypermod/utils'; import { API, FileInfo, Options } from 'jscodeshift'; export default function transformer( diff --git a/community/memoize-one/src/codeshift.config.js b/community/memoize-one/src/hypermod.config.js similarity index 100% rename from community/memoize-one/src/codeshift.config.js rename to community/memoize-one/src/hypermod.config.js diff --git a/community/react/CHANGELOG.md b/community/react/CHANGELOG.md index 7df3f9efc..f8014ce8f 100644 --- a/community/react/CHANGELOG.md +++ b/community/react/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/mod-react +# @hypermod/mod-react ## 0.2.0 diff --git a/community/react/package.json b/community/react/package.json index 1c0e855aa..af8cbe945 100644 --- a/community/react/package.json +++ b/community/react/package.json @@ -1,22 +1,21 @@ { - "name": "@codeshift/mod-react", + "name": "@hypermod/mod-react", "version": "0.2.0", "license": "MIT", - "source": "src/codeshift.config.js", - "main": "dist/codeshift.config.js", + "source": "src/hypermod.config.js", + "main": "dist/hypermod.config.js", "scripts": { - "dev": "codeshift", + "dev": "hypermod", "build": "parcel build", "test": "jest --watch", - "validate": "codeshift validate ." + "validate": "hypermod validate ." }, "dependencies": { - "@codeshift/utils": "^0.2.3", + "@hypermod/utils": "^0.2.3", "jscodeshift": "^0.13.1" }, "devDependencies": { - "@codeshift/cli": "^0.15.0", - "@codeshift/test-utils": "^0.3.1", + "@hypermod/cli": "^0.15.0", "@types/jest": "^29.0.0", "@types/node": "^16.11.0", "jest": "^29.0.0", @@ -24,5 +23,5 @@ "ts-jest": "^29.0.0", "typescript": "^4.5.5" }, - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/react" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/react" } diff --git a/community/react/src/add-react-import/transform.spec.ts b/community/react/src/add-react-import/transform.spec.ts index 16fc19684..d27da02dc 100644 --- a/community/react/src/add-react-import/transform.spec.ts +++ b/community/react/src/add-react-import/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#add-react-import transform', () => { diff --git a/community/react/src/create-element-to-jsx/transform.spec.ts b/community/react/src/create-element-to-jsx/transform.spec.ts index 72535ab1f..463d0b17f 100644 --- a/community/react/src/create-element-to-jsx/transform.spec.ts +++ b/community/react/src/create-element-to-jsx/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#create element to jsx transform', () => { diff --git a/community/react/src/error-boundaries/transform.spec.ts b/community/react/src/error-boundaries/transform.spec.ts index 5f9081693..406b4d96f 100644 --- a/community/react/src/error-boundaries/transform.spec.ts +++ b/community/react/src/error-boundaries/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#error-boundaries transform', () => { diff --git a/community/react/src/codeshift.config.js b/community/react/src/hypermod.config.js similarity index 100% rename from community/react/src/codeshift.config.js rename to community/react/src/hypermod.config.js diff --git a/community/react/src/remove-default-props/transform.spec.ts b/community/react/src/remove-default-props/transform.spec.ts index abf768b13..6674c1417 100644 --- a/community/react/src/remove-default-props/transform.spec.ts +++ b/community/react/src/remove-default-props/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#remove-default-props transform', () => { diff --git a/community/react/src/remove-default-props/transform.ts b/community/react/src/remove-default-props/transform.ts index 3246ad3e4..0ceccdde4 100644 --- a/community/react/src/remove-default-props/transform.ts +++ b/community/react/src/remove-default-props/transform.ts @@ -1,5 +1,5 @@ import { FileInfo, API } from 'jscodeshift'; -import { applyMotions } from '@codeshift/utils'; +import { applyMotions } from '@hypermod/utils'; import { moveDefaultPropsToArrowFunctionExpression } from './motions/moveDefaultPropsToArrowFunctionExpression'; import { moveDefaultPropsToFunctionDeclaration } from './motions/moveDefaultPropsToFunctionDeclaration'; diff --git a/community/react/src/remove-prop-types/transform.spec.ts b/community/react/src/remove-prop-types/transform.spec.ts index a7a7ee0b9..f83c2bee1 100644 --- a/community/react/src/remove-prop-types/transform.spec.ts +++ b/community/react/src/remove-prop-types/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react@#remove-prop-types transform', () => { diff --git a/community/react/src/rename-unsafe-lifecycles/transform.spec.ts b/community/react/src/rename-unsafe-lifecycles/transform.spec.ts index 349c7b280..ea5b76e44 100644 --- a/community/react/src/rename-unsafe-lifecycles/transform.spec.ts +++ b/community/react/src/rename-unsafe-lifecycles/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#rename-unsafe-lifecycles transform', () => { diff --git a/community/react/src/sort-jsx-props/transform.spec.ts b/community/react/src/sort-jsx-props/transform.spec.ts index aa9ce2397..33a2db5c6 100644 --- a/community/react/src/sort-jsx-props/transform.spec.ts +++ b/community/react/src/sort-jsx-props/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#sort-jsx-props transform', () => { diff --git a/community/react/src/use-string-literal-props/transform.spec.ts b/community/react/src/use-string-literal-props/transform.spec.ts index 007838e24..5b8fc3bb8 100644 --- a/community/react/src/use-string-literal-props/transform.spec.ts +++ b/community/react/src/use-string-literal-props/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('react#use-string-literal-props transform', () => { diff --git a/jest.config.js b/jest.config.js index c24c4d4c2..239ff437c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -15,6 +15,7 @@ module.exports = { 'jest-watch-typeahead/testname', ], moduleNameMapper: { + '@hypermod/(.*)$': '/packages/$1/src', '@codeshift/(.*)$': '/packages/$1/src', }, testPathIgnorePatterns: [ diff --git a/package.json b/package.json index d8cedc258..b9dfd2d9e 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "codeshift-community", + "name": "hypermod-community", "version": "0.1.0", "description": "Codemods for everyone", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity", - "author": "Daniel Del Core ", + "repository": "https://github.com/hypermod-io/hypermod-community", + "author": "Daniel Del Core ", "license": "MIT", "private": true, "scripts": { @@ -25,10 +25,10 @@ "types:check": "tsc --noEmit --skipLibCheck", "monorepo:check": "manypkg check", "monorepo:fix": "manypkg fix", - "cli:start": "ts-node packages/cli/bin/codeshift-cli.js", - "cli:validate": "ts-node packages/cli/bin/codeshift-cli.js validate", - "cli:init": "ts-node packages/cli/bin/codeshift-cli.js init", - "cli:list": "ts-node packages/cli/bin/codeshift-cli.js list", + "cli:start": "ts-node packages/cli/bin/hypermod-cli.js", + "cli:validate": "ts-node packages/cli/bin/hypermod-cli.js validate", + "cli:init": "ts-node packages/cli/bin/hypermod-cli.js init", + "cli:list": "ts-node packages/cli/bin/hypermod-cli.js list", "community:init": "ts-node scripts/initialize.ts", "community:init:preset": "ts-node scripts/initialize-preset.ts", "community:validate": "ts-node scripts/validate.ts ./community", diff --git a/packages/cli-alias/.npmignore b/packages/cli-alias/.npmignore new file mode 100644 index 000000000..8eba6c8dd --- /dev/null +++ b/packages/cli-alias/.npmignore @@ -0,0 +1 @@ +src/ diff --git a/packages/cli-alias/CHANGELOG.md b/packages/cli-alias/CHANGELOG.md new file mode 100644 index 000000000..c9a4222dd --- /dev/null +++ b/packages/cli-alias/CHANGELOG.md @@ -0,0 +1,415 @@ +# @codeshift/cli + +## 0.15.6 + +### Patch Changes + +- b9d4ba1: Bumps defective version of live-plugin-manager +- Updated dependencies [b9d4ba1] + - @codeshift/fetcher@0.3.4 + +## 0.15.5 + +### Patch Changes + +- dd4867b: Bumps live-plugin-manager to surface minor bug fixes +- Updated dependencies [dd4867b] + - @codeshift/fetcher@0.3.3 + +## 0.15.4 + +### Patch Changes + +- b7f614e: Correctly checks remote pacakge entrypoints for configs (as opposed to just checking for codeshift.config.js files) +- Updated dependencies [b7f614e] + - @codeshift/fetcher@0.3.2 + +## 0.15.3 + +### Patch Changes + +- 8cf9a4b: Fixes config path parsing +- Updated dependencies [8cf9a4b] + - @codeshift/core@0.1.2 + +## 0.15.2 + +### Patch Changes + +- 4d55055: Parcel now bundles these deps with a Node target +- 157f755: Removes typescript/js interop layer from the CLI in favour of just pointing to the built dist files. +- Updated dependencies [157f755] +- Updated dependencies [4d55055] + - @codeshift/core@0.1.1 + - @codeshift/initializer@0.4.9 + - @codeshift/validator@0.5.1 + - @codeshift/fetcher@0.3.1 + +## 0.15.1 + +### Patch Changes + +- e3f5a15: Fixes bin entrypoint for CLI + +## 0.15.0 + +### Minor Changes + +- 1a74e85: Internal refactor in order to remove the use of require.resolve in codeshift.config.js files. + +### Patch Changes + +- Updated dependencies [5416983] +- Updated dependencies [1a74e85] + - @codeshift/fetcher@0.3.0 + - @codeshift/core@0.1.0 + - @codeshift/validator@0.5.0 + +## 0.14.1 + +### Patch Changes + +- 8255eb2: Packages are now built with pareljs. Entrypoints have been updated to match +- Updated dependencies [8255eb2] +- Updated dependencies [8255eb2] + - @codeshift/core@0.0.1 + - @codeshift/fetcher@0.2.1 + - @codeshift/initializer@0.4.7 + - @codeshift/types@0.0.7 + - @codeshift/validator@0.4.4 + +## 0.14.0 + +### Minor Changes + +- bbc8fb8: Allow for an alternate npm registry and registryToken to be passed when calling the cli. + +### Patch Changes + +- @codeshift/initializer@0.4.4 + +## 0.13.0 + +### Minor Changes + +- 72abeaa: Allows to use the sequence flag in a monorepo development context + +### Patch Changes + +- @codeshift/initializer@0.4.3 + +## 0.12.0 + +### Minor Changes + +- 6d624ad: CLI will now list all matching codeshift.config files based on your workspace configuration (To support monorepos) + +### Patch Changes + +- 985c0e9: Correctly output "next steps" logs when using the init command, based on the --config-only command +- Updated dependencies [25164fe] +- Updated dependencies [6d624ad] + - @codeshift/initializer@0.4.0 + - @codeshift/fetcher@0.2.0 + - @codeshift/validator@0.4.3 + +## 0.11.4 + +### Patch Changes + +- 1ffc6bf: Omitting transforms from the package flag will now display a prompt instead of throwing an error + - @codeshift/initializer@0.3.5 + +## 0.11.3 + +### Patch Changes + +- fb7c59a: dependencies installed by the CLI will now be output to a nested node_modules dir instead of .plugin_packages + - @codeshift/initializer@0.3.4 + +## 0.11.2 + +### Patch Changes + +- 4d54ea0: Emit the full stack trace when a fetch package + eval config error occurs +- 60f1196: Registers ts-node regardless of dev/prod usage to allow for requires/require.resolve of ts files via configs + - @codeshift/initializer@0.3.3 + +## 0.11.1 + +### Patch Changes + +- Updated dependencies [2a116ba] + - @codeshift/types@0.0.6 + - @codeshift/fetcher@0.1.1 + - @codeshift/validator@0.4.2 + - @codeshift/initializer@0.3.2 + +## 0.11.0 + +### Minor Changes + +- c24d9e9: CLI now prompts users with codemods from their local codeshift.config.js files. + +### Patch Changes + +- Updated dependencies [c24d9e9] + - @codeshift/fetcher@0.1.0 + - @codeshift/initializer@0.3.1 + - @codeshift/validator@0.4.1 + +## 0.10.0 + +### Minor Changes + +- 380ed84: Codeshift projects can now be initialized a config file only via the `init --config-only` command. + + Initialized projects now contain a README with helpful getting started information. + + The init command now outputs getting started tips + commands + +### Patch Changes + +- 1d034ab: The internal package fetching logic has now been abstracted and reused in both the list and main CLI commands +- Updated dependencies [380ed84] + - @codeshift/initializer@0.3.0 + - @codeshift/validator@0.4.0 + +## 0.9.1 + +### Patch Changes + +- e5787a9: Updates validator logic to check for invalid properties in config files. Also requires configs via absolute paths to make the validation logic more robust +- Updated dependencies [e5787a9] + - @codeshift/fetcher@0.0.3 + - @codeshift/validator@0.3.1 + - @codeshift/initializer@0.2.2 + +## 0.9.0 + +### Minor Changes + +- e491844: Codemods and dependencies are downloaded relative to the CLI package installation for consistency/stability reasons + +## 0.8.0 + +### Minor Changes + +- 0379577: Adds sensible defaults as CLI options. Affecting flags --ignore-path, --extensions and --parser +- 3c390c1: Improves loading behaviour with spinners and status updates. Also exposes --verbose flag for more granular logging + +### Patch Changes + +- Updated dependencies [78959ae] + - @codeshift/initializer@0.2.0 + - @codeshift/validator@0.3.0 + +## 0.7.8 + +### Patch Changes + +- d0ebfd5: Fixed bug where --version & --help are presented as errors +- Updated dependencies [427405c] +- Updated dependencies [49b7bcb] + - @codeshift/initializer@0.1.9 + +## 0.7.7 + +### Patch Changes + +- 7e3a6d9: Internal refactor, CLI now uses fetcher package +- Updated dependencies [b35609d] +- Updated dependencies [7e3a6d9] + - @codeshift/validator@0.2.4 + - @codeshift/fetcher@0.0.2 + +## 0.7.6 + +### Patch Changes + +- f6bd632: Fixes --help command. Top-level options will now be shown correctly + +## 0.7.5 + +### Patch Changes + +- 5133c81: Minor fix to list command +- cee218e: Update generated project dependencies to avoid colors.js vulnrability. + +## 0.7.4 + +### Patch Changes + +- 276e5bb: Return if list finds an invalid package + +## 0.7.3 + +### Patch Changes + +- e776f9c: Fixes colors.js vulnrability by bumping jscodeshift +- Updated dependencies [e776f9c] + - @codeshift/initializer@0.1.8 + - @codeshift/validator@0.2.3 + +## 0.7.2 + +### Patch Changes + +- 1cf710f: Fixes how the CLI renders errors to users + +## 0.7.1 + +### Patch Changes + +- caaaf9a: Locks version of colors.js to avoid vulnrability +- 728624f: Init command can now be called without the transform or preset flag and output an empty directory +- 4781125: List CLI command no longer exits on error. Instead it will log a message +- 450c977: Adds new primary CLI alias `codeshift` (as opposed to just `codeshift-cli`) +- Updated dependencies [caaaf9a] +- Updated dependencies [728624f] + - @codeshift/initializer@0.1.7 + - @codeshift/validator@0.2.2 + +## 0.7.0 + +### Minor Changes + +- 2f5f72f: Adds the ability to specify a comma seperated list of transforms via the -t flag + +## 0.6.3 + +### Patch Changes + +- 6e160cc: Additional init path releated fixes +- Updated dependencies [6e160cc] + - @codeshift/initializer@0.1.6 + +## 0.6.2 + +### Patch Changes + +- Updated dependencies [2decf6a] + - @codeshift/initializer@0.1.5 + +## 0.6.1 + +### Patch Changes + +- e8cf76e: Releasing all packages to fix version mismatch +- Updated dependencies [e8cf76e] + - @codeshift/initializer@0.1.4 + - @codeshift/validator@0.2.1 + +## 0.6.0 + +### Minor Changes + +- 30bf0cf: Codemods can now be sourced from standalone npm packages such as react as long as they provide a codeshift.config.js. This allows for greater flexibility for where codemods may be distributed + +### Patch Changes + +- Updated dependencies [30bf0cf] + - @codeshift/validator@0.2.0 + +## 0.5.0 + +### Minor Changes + +- 8bbe2a6: Adds auxiliary flags for jscodeshift + +## 0.4.0 + +### Minor Changes + +- b316132: CLI Init command now supports the ability to create a stub preset + +## 0.3.0 + +### Minor Changes + +- 7f1e99c: CLI now supports configs exported with cjs and es module types + +### Patch Changes + +- bbca56f: Fixes a bug where consistent option names used across default and subcommands were breaking. +- e9b263e: CLI will no longer error if either transforms or presets were undefined in the config + +## 0.2.2 + +### Patch Changes + +- 216dd18: Reverts binary change + +## 0.2.1 + +### Patch Changes + +- 73f5a59: Use default binary name + +## 0.2.0 + +### Minor Changes + +- 83923eb: CLI now supports the concept of presets, for cases where non-versioned codemods are necessary. Also exposes the cli binary as @codeshift/cli + +## 0.1.9 + +### Patch Changes + +- ad76039: CLI can now properly run packaged codemods without dangerously looking for files +- 49b5762: Updates cli identifier to the correct name + updates docs accordingly + +## 0.1.8 + +### Patch Changes + +- Updated dependencies [3d14938] + - @codeshift/initializer@0.1.3 + +## 0.1.7 + +### Patch Changes + +- Updated dependencies [de8f2e5] + - @codeshift/initializer@0.1.2 + +## 0.1.6 + +### Patch Changes + +- a78ad25: Update package configuration and refactors repo scripts +- Updated dependencies [a78ad25] + - @codeshift/initializer@0.1.1 + - @codeshift/validator@0.1.1 + +## 0.1.5 + +### Patch Changes + +- 5748332: Adds npmignore to avoid publishing unwanted files and folders + +## 0.1.4 + +### Patch Changes + +- 9f1d028: Updates babel config to fix cli issue + +## 0.1.3 + +### Patch Changes + +- 07212c0: Fix entrypoint + +## 0.1.2 + +### Patch Changes + +- 71388b0: Swaps out Meow for Commander.js +- 1e3c85b: Refactor CLI internals to better leverage commander.js + Adds list command + +## 0.1.1 + +### Patch Changes + +- c412dc7: Adds sequence flag +- 473473e: Minor internal tweaks diff --git a/packages/cli-alias/README.md b/packages/cli-alias/README.md new file mode 100755 index 000000000..2a90c23a0 --- /dev/null +++ b/packages/cli-alias/README.md @@ -0,0 +1,7 @@ +# @codeshift/cli + +**THIS PACKAGE IS DEPRECATED IN FAVOUR OF [@hypermod/cli](https://www.codeshiftcommunity.com/docs/cli)** + +No API changes were performed as part of this change, use `@hypermod/cli` as a direct replacement the package has simply been renamed. + +This package will continue to exist as a way for existing users to continue to receive updates **but will be removed in the future**. diff --git a/packages/cli/bin/codeshift-cli.js b/packages/cli-alias/bin/codeshift-cli.js similarity index 100% rename from packages/cli/bin/codeshift-cli.js rename to packages/cli-alias/bin/codeshift-cli.js diff --git a/packages/cli-alias/package.json b/packages/cli-alias/package.json new file mode 100644 index 000000000..b6429f095 --- /dev/null +++ b/packages/cli-alias/package.json @@ -0,0 +1,24 @@ +{ + "name": "@codeshift/cli", + "version": "0.15.6", + "source": "src/index.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "license": "MIT", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/cli-alias", + "bin": { + "codeshift": "./bin/codeshift-cli.js", + "codeshift-cli": "./bin/codeshift-cli.js" + }, + "scripts": { + "start": "./bin/codeshift-cli.js", + "start:dev": "ts-node src/index.ts" + }, + "dependencies": { + "@hypermod/cli": "^0.15.6", + "ts-node": "^10.9.1" + }, + "engines": { + "node": ">=14" + } +} diff --git a/packages/cli-alias/src/index.ts b/packages/cli-alias/src/index.ts new file mode 100644 index 000000000..769c40bde --- /dev/null +++ b/packages/cli-alias/src/index.ts @@ -0,0 +1 @@ +import '@hypermod/cli'; diff --git a/packages/cli-alias/tsconfig.json b/packages/cli-alias/tsconfig.json new file mode 100644 index 000000000..c9be2ae34 --- /dev/null +++ b/packages/cli-alias/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "./", + "target": "es6", + "esModuleInterop": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "lib": [ + "es5", + "scripthost", + "es2015.core", + "es2015.collection", + "es2015.symbol", + "es2015.iterable", + "es2015.promise", + "es2016", + "es2017" + ] + }, + "include": ["./src/**/*.ts"] +} diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index c9a4222dd..4c50f5f6f 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/cli +# @hypermod/cli ## 0.15.6 diff --git a/packages/cli/README.md b/packages/cli/README.md index 39cc72d8a..f2416a7df 100755 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1,13 +1,13 @@ -# @codeshift/cli +# @hypermod/cli -To download and run codemods, we provide a CLI tool called @codeshift/cli. +To download and run codemods, we provide a CLI tool called @hypermod/cli. -`@codeshift/cli` is responsible for running the provided transform against your entire codebase. Under the hood, it is a wrapper of jscodeshift's CLI, which provides additional functionality. +`@hypermod/cli` is responsible for running the provided transform against your entire codebase. Under the hood, it is a wrapper of jscodeshift's CLI, which provides additional functionality. -Ability to run community codemods hosted on npm -Runs versioned codemods in sequence -Always runs the latest version of a codemod -The CLI allows you to run transforms either from the the [public registry](https://www.codeshiftcommunity.com/docs/registry) or on your local machine as per the original implementation of jscodeshift +- Ability to run community codemods hosted on npm +- Runs versioned codemods in sequence +- Always runs the latest version of a codemod +- The CLI allows you to run transforms either from the the [public registry](https://www.codeshiftcommunity.com/docs/registry) or on your local machine as per the original implementation of jscodeshift _Note:_ Codemods are designed to do the heavy lifting, but they may not be perfect, so some manual work may still be required in order to successfully migrate. diff --git a/packages/cli/bin/hypermod-cli.js b/packages/cli/bin/hypermod-cli.js new file mode 100755 index 000000000..3fa08db45 --- /dev/null +++ b/packages/cli/bin/hypermod-cli.js @@ -0,0 +1,6 @@ +#!/usr/bin/env node +const path = require('path'); + +const packageJson = require('../package.json'); + +require(path.join('..', packageJson.main)); diff --git a/packages/cli/package.json b/packages/cli/package.json index 846df5f6a..381005004 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,25 +1,27 @@ { - "name": "@codeshift/cli", + "name": "@hypermod/cli", "version": "0.15.6", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/cli", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/cli", "bin": { - "codeshift": "./bin/codeshift-cli.js", - "codeshift-cli": "./bin/codeshift-cli.js" + "hypermod": "./bin/hypermod-cli.js", + "hypermod-cli": "./bin/hypermod-cli.js", + "codeshift": "./bin/hypermod-cli.js", + "codeshift-cli": "./bin/hypermod-cli.js" }, "scripts": { - "start": "./bin/codeshift-cli.js", + "start": "./bin/hypermod-cli.js", "start:dev": "ts-node src/index.ts" }, "dependencies": { - "@codeshift/core": "^0.1.2", - "@codeshift/fetcher": "^0.3.4", - "@codeshift/initializer": "^0.4.9", - "@codeshift/types": "*", - "@codeshift/validator": "^0.5.1", + "@hypermod/core": "^0.1.2", + "@hypermod/fetcher": "^0.3.4", + "@hypermod/initializer": "^0.4.9", + "@hypermod/types": "*", + "@hypermod/validator": "^0.5.1", "chalk": "^4.1.0", "commander": "^8.2.0", "find-up": "^5.0.0", diff --git a/packages/cli/src/init.ts b/packages/cli/src/init.ts index 8ce2650f9..8bfae0044 100644 --- a/packages/cli/src/init.ts +++ b/packages/cli/src/init.ts @@ -4,7 +4,7 @@ import { initConfig, initDirectory, initTransform, -} from '@codeshift/initializer'; +} from '@hypermod/initializer'; export default async function init( transform?: string, diff --git a/packages/cli/src/list.spec.ts b/packages/cli/src/list.spec.ts index 28f6170c8..ca7c08f2f 100644 --- a/packages/cli/src/list.spec.ts +++ b/packages/cli/src/list.spec.ts @@ -34,7 +34,7 @@ describe('list', () => { const result = (console.log as jest.Mock).mock.calls.join('\n'); - expect(result).toEqual(`${chalk.bold('@codeshift/mod-foobar')} + expect(result).toEqual(`${chalk.bold('@hypermod/mod-foobar')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 @@ -54,7 +54,7 @@ ${chalk.bold('foobar')} const result = (console.log as jest.Mock).mock.calls.join('\n'); - expect(result).toEqual(`${chalk.bold('@codeshift/mod-foo__bar')} + expect(result).toEqual(`${chalk.bold('@hypermod/mod-foo__bar')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 @@ -74,7 +74,7 @@ ${chalk.bold('@foo/bar')} const result = (console.log as jest.Mock).mock.calls.join('\n'); - expect(result).toEqual(`${chalk.bold('@codeshift/mod-bar')} + expect(result).toEqual(`${chalk.bold('@hypermod/mod-bar')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 @@ -86,7 +86,7 @@ ${chalk.bold('bar')} | └─ 19.0.0 └─ presets └─ sort-imports -${chalk.bold('@codeshift/mod-foo__bar')} +${chalk.bold('@hypermod/mod-foo__bar')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 @@ -157,7 +157,7 @@ ${chalk.bold('@foo/bar')} const result = (console.log as jest.Mock).mock.calls.join('\n'); - expect(result).toEqual(`${chalk.bold('@codeshift/mod-found1')} + expect(result).toEqual(`${chalk.bold('@hypermod/mod-found1')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 @@ -169,7 +169,7 @@ ${chalk.bold('found1')} | └─ 19.0.0 └─ presets └─ sort-imports -${chalk.bold('@codeshift/mod-found2')} +${chalk.bold('@hypermod/mod-found2')} ├─ transforms | ├─ 18.0.0 | └─ 19.0.0 diff --git a/packages/cli/src/main.spec.ts b/packages/cli/src/main.spec.ts index 0780e9ba1..2230532bd 100644 --- a/packages/cli/src/main.spec.ts +++ b/packages/cli/src/main.spec.ts @@ -1,7 +1,7 @@ jest.mock('globby'); jest.mock('live-plugin-manager'); jest.mock('find-up'); -jest.mock('@codeshift/core', () => ({ +jest.mock('@hypermod/core', () => ({ run: jest.fn().mockImplementation(() => Promise.resolve()), })); @@ -10,7 +10,7 @@ import path from 'path'; import { PluginManager } from 'live-plugin-manager'; import globby from 'globby'; -import * as core from '@codeshift/core'; +import * as core from '@hypermod/core'; import main from './main'; @@ -123,10 +123,10 @@ describe('main', () => { (PluginManager as jest.Mock).mockImplementation(() => ({ install: jest.fn().mockResolvedValue(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), require: jest.fn().mockImplementation((packageName: string) => { - if (!packageName.startsWith('@codeshift')) { + if (!packageName.startsWith('@hypermod')) { throw new Error('Attempted to fetch codemod from npm'); } @@ -151,7 +151,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@18.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@18.0.0', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -167,17 +167,17 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(3); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@18.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@18.0.0', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@19.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@19.0.0', expect.any(Array), expect.any(Object), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); @@ -191,7 +191,7 @@ describe('main', () => { }); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myscope__mylib/path/to/source/codeshift.config.js@19.0.0', + '@hypermod/mod-myscope__mylib/path/to/source/hypermod.config.js@19.0.0', expect.any(Array), expect.any(Object), ); @@ -206,12 +206,12 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myotherlib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-myotherlib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); @@ -226,12 +226,12 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myscope__mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-myscope__mylib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myotherscope__myotherlib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-myotherscope__myotherlib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); @@ -246,12 +246,12 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myscope__mylib/path/to/source/codeshift.config.js@19.0.0', + '@hypermod/mod-myscope__mylib/path/to/source/hypermod.config.js@19.0.0', expect.any(Array), expect.any(Object), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-myscope__mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-myscope__mylib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); @@ -266,7 +266,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@20.0.0', expect.any(Array), expect.any(Object), ); @@ -316,7 +316,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@20.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@20.0.0', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -331,7 +331,7 @@ describe('main', () => { (PluginManager as jest.Mock).mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), require: () => ({ presets: { @@ -358,7 +358,7 @@ describe('main', () => { (PluginManager as jest.Mock).mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: () => ({ @@ -384,10 +384,10 @@ describe('main', () => { (PluginManager as jest.Mock).mockImplementation(() => ({ install: jest.fn().mockResolvedValue(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), require: jest.fn().mockImplementation((packageName: string) => { - if (!packageName.startsWith('@codeshift')) { + if (!packageName.startsWith('@hypermod')) { throw new Error('Attempted to fetch codemod from npm'); } @@ -411,7 +411,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js#update-formatting', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js#update-formatting', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -426,12 +426,12 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js#update-imports', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js#update-imports', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js#update-imports', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js#update-imports', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -446,12 +446,12 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(2); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js#update-formatting', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js#update-formatting', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js#update-imports', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js#update-imports', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -478,7 +478,7 @@ describe('main', () => { (PluginManager as jest.Mock).mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: () => ({ @@ -506,7 +506,7 @@ describe('main', () => { (PluginManager as jest.Mock).mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: () => ({ @@ -534,7 +534,7 @@ describe('main', () => { 'path', 'to', 'source', - 'codeshift.config.js', + 'hypermod.config.js', ); (globby as unknown as jest.Mock).mockImplementation(() => @@ -568,7 +568,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - 'mylib/path/to/source/codeshift.config.js@18.0.0', + 'mylib/path/to/source/hypermod.config.js@18.0.0', expect.arrayContaining([mockPath]), expect.anything(), ); @@ -584,7 +584,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - 'mylib/path/to/source/codeshift.config.js#update-formatting', + 'mylib/path/to/source/hypermod.config.js#update-formatting', expect.arrayContaining([mockPath]), expect.anything(), ); @@ -596,7 +596,7 @@ describe('main', () => { (PluginManager as jest.Mock).mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: jest.fn().mockImplementationOnce(() => ({ @@ -617,7 +617,7 @@ describe('main', () => { expect(core.run).toHaveBeenCalledTimes(1); expect(core.run).toHaveBeenCalledWith( - '@codeshift/mod-mylib/path/to/source/codeshift.config.js@18.0.0', + '@hypermod/mod-mylib/path/to/source/hypermod.config.js@18.0.0', expect.arrayContaining([mockPath]), expect.objectContaining({ parser: 'babel', extensions: 'js' }), ); @@ -631,7 +631,7 @@ describe('main', () => { spy.mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: jest.fn().mockImplementationOnce(() => ({ @@ -661,7 +661,7 @@ describe('main', () => { spy.mockReturnValue({ install: () => Promise.resolve(undefined), getInfo: jest.fn().mockImplementation((packageName: string) => ({ - location: `${packageName}/path/to/source/codeshift.config.js`, + location: `${packageName}/path/to/source/hypermod.config.js`, })), // @ts-ignore require: jest.fn().mockImplementationOnce(() => ({ diff --git a/packages/cli/src/main.ts b/packages/cli/src/main.ts index ef8ecfcb0..4ae27553d 100644 --- a/packages/cli/src/main.ts +++ b/packages/cli/src/main.ts @@ -6,9 +6,9 @@ import findUp from 'find-up'; import inquirer from 'inquirer'; import { PluginManager, PluginManagerOptions } from 'live-plugin-manager'; -import * as core from '@codeshift/core'; -import { CodeshiftConfig } from '@codeshift/types'; -import { fetchConfigAtPath, fetchConfigs } from '@codeshift/fetcher'; +import * as core from '@hypermod/core'; +import { CodeshiftConfig } from '@hypermod/types'; +import { fetchConfigAtPath, fetchConfigs } from '@hypermod/fetcher'; import { InvalidUserInputError } from './errors'; import { fetchPackages } from './utils/fetch-package'; diff --git a/packages/cli/src/prompt.ts b/packages/cli/src/prompt.ts index bbffba085..38d879cf1 100644 --- a/packages/cli/src/prompt.ts +++ b/packages/cli/src/prompt.ts @@ -1,6 +1,6 @@ import inquirer from 'inquirer'; -import { CodeshiftConfig } from '@codeshift/types'; +import { CodeshiftConfig } from '@hypermod/types'; export const getConfigPrompt = (config: CodeshiftConfig) => { const transforms = Object.keys(config.transforms || {}); diff --git a/packages/cli/src/utils/fetch-package.ts b/packages/cli/src/utils/fetch-package.ts index 18eeb4264..91a0c4760 100644 --- a/packages/cli/src/utils/fetch-package.ts +++ b/packages/cli/src/utils/fetch-package.ts @@ -6,8 +6,8 @@ import { fetchPackage, fetchRemotePackage, ConfigMeta, -} from '@codeshift/fetcher'; -import { isValidConfig } from '@codeshift/validator'; +} from '@hypermod/fetcher'; +import { isValidConfig } from '@hypermod/validator'; import { getCodeshiftPackageName } from './package-names'; diff --git a/packages/cli/src/utils/merge-configs.ts b/packages/cli/src/utils/merge-configs.ts index e10849235..66ecdaf8e 100644 --- a/packages/cli/src/utils/merge-configs.ts +++ b/packages/cli/src/utils/merge-configs.ts @@ -1,4 +1,4 @@ -import { ConfigMeta } from '@codeshift/fetcher'; +import { ConfigMeta } from '@hypermod/fetcher'; interface TransformedConfig { transforms: Record; diff --git a/packages/cli/src/utils/package-names.ts b/packages/cli/src/utils/package-names.ts index abb3a0daf..8f795844b 100644 --- a/packages/cli/src/utils/package-names.ts +++ b/packages/cli/src/utils/package-names.ts @@ -1,3 +1,3 @@ export function getCodeshiftPackageName(packageName: string) { - return `@codeshift/mod-${packageName.replace('@', '').replace('/', '__')}`; + return `@hypermod/mod-${packageName.replace('@', '').replace('/', '__')}`; } diff --git a/packages/cli/src/validate.ts b/packages/cli/src/validate.ts index b295177f0..e05f7e9ee 100644 --- a/packages/cli/src/validate.ts +++ b/packages/cli/src/validate.ts @@ -1,6 +1,6 @@ import chalk from 'chalk'; -import { isValidConfigAtPath } from '@codeshift/validator'; +import { isValidConfigAtPath } from '@hypermod/validator'; export default async function validate(targetPath = '.') { await isValidConfigAtPath(targetPath); diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 98b7ef043..9eff2fa50 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/core +# @hypermod/core ## 0.1.4 diff --git a/packages/core/package.json b/packages/core/package.json index 469ceef38..3de45bb1f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,11 +1,11 @@ { - "name": "@codeshift/core", + "name": "@hypermod/core", "version": "0.1.4", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/core", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/core", "dependencies": { "@babel/core": "^7.13.16", "@babel/parser": "^7.13.16", diff --git a/packages/fetcher/CHANGELOG.md b/packages/fetcher/CHANGELOG.md index 76209de1d..7a8c107f6 100644 --- a/packages/fetcher/CHANGELOG.md +++ b/packages/fetcher/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/fetcher +# @hypermod/fetcher ## 0.3.5 @@ -22,7 +22,7 @@ ### Patch Changes -- b7f614e: Correctly checks remote pacakge entrypoints for configs (as opposed to just checking for codeshift.config.js files) +- b7f614e: Correctly checks remote package entrypoints for configs (as opposed to just checking for codeshift.config.js files) ## 0.3.1 diff --git a/packages/fetcher/README.md b/packages/fetcher/README.md index 52a78c284..0975dc855 100755 --- a/packages/fetcher/README.md +++ b/packages/fetcher/README.md @@ -1,3 +1,3 @@ -# @codeshift/fetcher +# @hypermod/fetcher Responsible for fetching codemod packages and associated files. diff --git a/packages/fetcher/package.json b/packages/fetcher/package.json index 3be921a57..724828d82 100644 --- a/packages/fetcher/package.json +++ b/packages/fetcher/package.json @@ -1,13 +1,13 @@ { - "name": "@codeshift/fetcher", + "name": "@hypermod/fetcher", "version": "0.3.5", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/fetcher", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/fetcher", "dependencies": { - "@codeshift/types": "*", + "@hypermod/types": "*", "chalk": "^4.1.0", "fs-extra": "^9.1.0", "globby": "^11.1.0", diff --git a/packages/fetcher/src/index.ts b/packages/fetcher/src/index.ts index 2309be5cb..16824b17f 100644 --- a/packages/fetcher/src/index.ts +++ b/packages/fetcher/src/index.ts @@ -3,7 +3,7 @@ import path from 'path'; import globby from 'globby'; import { PluginManager } from 'live-plugin-manager'; -import { CodeshiftConfig } from '@codeshift/types'; +import { CodeshiftConfig } from '@hypermod/types'; export interface ConfigMeta { filePath: string; diff --git a/packages/initializer/CHANGELOG.md b/packages/initializer/CHANGELOG.md index 314d78922..adff0776f 100644 --- a/packages/initializer/CHANGELOG.md +++ b/packages/initializer/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/initializer +# @hypermod/initializer ## 0.4.9 diff --git a/packages/initializer/README.md b/packages/initializer/README.md index a43e6fb63..8e521722d 100755 --- a/packages/initializer/README.md +++ b/packages/initializer/README.md @@ -1,3 +1,3 @@ -# @codeshift/initializer +# @hypermod/initializer -Codegens codeshift packages +Codegens Hypermod packages diff --git a/packages/initializer/package.json b/packages/initializer/package.json index 888359ba2..24d9f9c7c 100644 --- a/packages/initializer/package.json +++ b/packages/initializer/package.json @@ -1,15 +1,14 @@ { - "name": "@codeshift/initializer", + "name": "@hypermod/initializer", "version": "0.4.9", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/initializer", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/initializer", "dependencies": { - "@codeshift/cli": "*", - "@codeshift/test-utils": "*", - "@codeshift/utils": "*", + "@hypermod/cli": "*", + "@hypermod/utils": "*", "fs-extra": "^9.1.0", "recast": "^0.20.4", "semver": "^7.3.5", diff --git a/packages/initializer/src/index.ts b/packages/initializer/src/index.ts index e9b815bc0..682d6c020 100644 --- a/packages/initializer/src/index.ts +++ b/packages/initializer/src/index.ts @@ -2,9 +2,8 @@ import fs from 'fs-extra'; import path from 'path'; import semver from 'semver'; import * as recast from 'recast'; -import { version as cliVersion } from '@codeshift/cli/package.json'; -import { version as utilVersion } from '@codeshift/utils/package.json'; -import { version as testUtilVersion } from '@codeshift/test-utils/package.json'; +import { version as cliVersion } from '@hypermod/cli/package.json'; +import { version as utilVersion } from '@hypermod/utils/package.json'; const TEMPLATE_PATH = path.join(__dirname, '..', 'template'); @@ -14,21 +13,20 @@ export function getPackageJson(packageName: string, version = '0.0.0') { name: packageName, version: version, license: 'MIT', - source: 'src/codeshift.config.js', - main: 'dist/codeshift.config.js', + source: 'src/hypermod.config.js', + main: 'dist/hypermod.config.js', scripts: { - dev: 'codeshift', + dev: 'hypermod', build: 'parcel build', test: 'jest --watch', - validate: 'codeshift validate .', + validate: 'hypermod validate .', }, dependencies: { - '@codeshift/utils': `^${utilVersion}`, + '@hypermod/utils': `^${utilVersion}`, jscodeshift: '^0.13.1', }, devDependencies: { - '@codeshift/cli': `^${cliVersion}`, - '@codeshift/test-utils': `^${testUtilVersion}`, + '@hypermod/cli': `^${cliVersion}`, '@types/jest': '^26.0.15', '@types/node': '^16.11.0', jest: '^26.6.0', @@ -72,7 +70,7 @@ function updateConfig( transformName: string, type: 'version' | 'preset', ) { - const configPath = path.join(targetPath, 'codeshift.config.js'); + const configPath = path.join(targetPath, 'hypermod.config.js'); const source = fs.readFileSync(configPath, 'utf8'); const ast = recast.parse(source); const b = recast.types.builders; @@ -120,7 +118,7 @@ function updateConfig( } export function initConfig(packageName: string, targetPath = './') { - const configPath = path.join(targetPath, 'codeshift.config.js'); + const configPath = path.join(targetPath, 'hypermod.config.js'); if (!fs.existsSync(configPath)) { fs.mkdirSync(targetPath, { recursive: true }); @@ -141,7 +139,7 @@ export function initDirectory( path.join(targetPath, 'package.json'), getPackageJson( isReduced - ? `@codeshift/mod-${packageName.replace('/', '__').replace('@', '')}` + ? `@hypermod/mod-${packageName.replace('/', '__').replace('@', '')}` : packageName, ), ); diff --git a/packages/initializer/template/codemods/codemod/transform.spec.ts b/packages/initializer/template/codemods/codemod/transform.spec.ts index 90c9cda37..25ceb9f7e 100644 --- a/packages/initializer/template/codemods/codemod/transform.spec.ts +++ b/packages/initializer/template/codemods/codemod/transform.spec.ts @@ -1,4 +1,4 @@ -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; import * as transformer from './transform'; describe('<% packageName %><% seperator %><% transform %> transform', () => { diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md deleted file mode 100644 index ed4aca54e..000000000 --- a/packages/test-utils/CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -# @codeshift/test-utils - -## 0.3.2 - -### Patch Changes - -- 4d55055: Parcel now bundles these deps with a Node target - -## 0.3.1 - -### Patch Changes - -- 8255eb2: Packages are now built with pareljs. Entrypoints have been updated to match - -## 0.3.0 - -### Minor Changes - -- 6e5fa3d: Allows to use an FileInfo in the applyTransform test util - -## 0.2.0 - -### Minor Changes - -- 8a8517c: applyTransfrom now returns a promise to support async transforms - -## 0.1.4 - -### Patch Changes - -- e776f9c: Fixes colors.js vulnrability by bumping jscodeshift - -## 0.1.3 - -### Patch Changes - -- caaaf9a: Locks version of colors.js to avoid vulnrability - -## 0.1.2 - -### Patch Changes - -- e8cf76e: Releasing all packages to fix version mismatch - -## 0.1.1 - -### Patch Changes - -- 473473e: Renames runTransform to applyTransform diff --git a/packages/test-utils/README.md b/packages/test-utils/README.md deleted file mode 100755 index 39dd6851d..000000000 --- a/packages/test-utils/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# @codeshift/test-utils - -## `applyTransform` - -Accepts a transform and a code string and runs the transform against it. - -Works well with Jest's `toMatchInlineSnapshot` and `toMatchSnapshot` assetions. - -Example: - -```ts -it('should wrap avatar in a tooltip', () => { - const result = applyTransform( - transformer, - ` - import Avatar from '@atlaskit/avatar'; - - const App = () => { - return ; - } - `, - { parser: 'tsx' }, - ); - - expect(result).toMatchInlineSnapshot(` - "import Tooltip from '@atlaskit/tooltip'; - import Avatar from '@atlaskit/avatar'; - - const App = () => { - return ; - }" - `); -}); -``` diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json deleted file mode 100644 index fdc37749e..000000000 --- a/packages/test-utils/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@codeshift/test-utils", - "version": "0.3.2", - "source": "src/index.ts", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/test-utils", - "dependencies": { - "jscodeshift": "^0.13.1" - }, - "engines": { - "node": ">=14" - } -} diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts deleted file mode 100644 index 76b9a6437..000000000 --- a/packages/test-utils/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as applyTransform } from './apply-transform'; diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 717ddd374..dfaf6fd68 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/types +# @hypermod/types ## 0.0.7 diff --git a/packages/types/README.md b/packages/types/README.md index 6b2f3538a..2e3e3ef93 100755 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -1 +1 @@ -# @codeshift/types +# @hypermod/types diff --git a/packages/types/package.json b/packages/types/package.json index 63b85982a..cf3012982 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,9 +1,9 @@ { - "name": "@codeshift/types", + "name": "@hypermod/types", "version": "0.0.7", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/types" + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/types" } diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 672910a8f..ea04771cc 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/utils +# @hypermod/utils ## 0.2.5 diff --git a/packages/utils/README.md b/packages/utils/README.md index 5c83bafea..4844b1d06 100755 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -1,3 +1,3 @@ -# @codeshift/utils +# @hypermod/utils [Documentation](https://www.codeshiftcommunity.com/docs/utils) diff --git a/packages/utils/package.json b/packages/utils/package.json index f8b9017cd..22cd380d0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,12 +1,15 @@ { - "name": "@codeshift/utils", + "name": "@hypermod/utils", "version": "0.2.5", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/utils", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/utils", "engines": { "node": ">=14" + }, + "dependencies": { + "jscodeshift": "^0.13.1" } } diff --git a/packages/utils/src/comments.ts b/packages/utils/src/comments.ts index c58746b89..7ec9773a8 100644 --- a/packages/utils/src/comments.ts +++ b/packages/utils/src/comments.ts @@ -12,7 +12,7 @@ export function insertCommentBefore( j: core.JSCodeshift, path: Collection, message: string, - prefix = ` TODO: (@codeshift)`, + prefix = ` TODO: (@hypermod)`, ) { const content = `${prefix} ${clean(message)} `; diff --git a/packages/utils/src/imports.spec.ts b/packages/utils/src/imports.spec.ts index 4f6deb1b7..91c7adabe 100644 --- a/packages/utils/src/imports.spec.ts +++ b/packages/utils/src/imports.spec.ts @@ -1,5 +1,6 @@ import { API, FileInfo } from 'jscodeshift'; -import { applyTransform } from '@codeshift/test-utils'; +import { applyTransform } from '@hypermod/utils'; + import * as importUtils from './imports'; describe('imports', () => { diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index f117d9c58..5aaf42b4b 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -3,3 +3,4 @@ export * from './nodes'; export * from './jsx'; export * from './motions'; export * from './comments'; +export * from './testing'; diff --git a/packages/utils/src/nodes.spec.ts b/packages/utils/src/nodes.spec.ts index 15d91307c..58fba0ae0 100644 --- a/packages/utils/src/nodes.spec.ts +++ b/packages/utils/src/nodes.spec.ts @@ -1,6 +1,5 @@ import { API, FileInfo } from 'jscodeshift'; -import { applyTransform } from '@codeshift/test-utils'; -import { isDecendantOfType } from '@codeshift/utils'; +import { applyTransform, isDecendantOfType } from '@hypermod/utils'; describe('nodes', () => { describe('isDecendantOfType', () => { diff --git a/packages/test-utils/src/apply-transform.ts b/packages/utils/src/testing.ts similarity index 94% rename from packages/test-utils/src/apply-transform.ts rename to packages/utils/src/testing.ts index 2a300c152..cdbdb034c 100644 --- a/packages/test-utils/src/apply-transform.ts +++ b/packages/utils/src/testing.ts @@ -6,7 +6,7 @@ interface Options { parser?: Parser; } -export default async function applyTransform( +export async function applyTransform( transform: any, input: string | FileInfo, options: Options = { diff --git a/packages/validator/CHANGELOG.md b/packages/validator/CHANGELOG.md index 5b7b5143d..39a96418c 100644 --- a/packages/validator/CHANGELOG.md +++ b/packages/validator/CHANGELOG.md @@ -1,4 +1,4 @@ -# @codeshift/validator +# @hypermod/validator ## 0.5.1 diff --git a/packages/validator/README.md b/packages/validator/README.md index d3c57d541..bbae078d8 100755 --- a/packages/validator/README.md +++ b/packages/validator/README.md @@ -1,3 +1,3 @@ -# @codeshift/validator +# @hypermod/validator Validates the file structure of the community directory diff --git a/packages/validator/package.json b/packages/validator/package.json index 9e0bdaa3d..49b20c333 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,14 +1,14 @@ { - "name": "@codeshift/validator", + "name": "@hypermod/validator", "version": "0.5.1", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", - "repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/packages/validator", + "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/validator", "dependencies": { - "@codeshift/fetcher": "^0.3.1", - "@codeshift/types": "^0.0.7", + "@hypermod/fetcher": "^0.3.1", + "@hypermod/types": "^0.0.7", "fs-extra": "^9.1.0", "lodash": "^4.17.21", "recast": "^0.20.4", diff --git a/packages/validator/src/index.spec.ts b/packages/validator/src/index.spec.ts index 887e35fa7..018282d61 100644 --- a/packages/validator/src/index.spec.ts +++ b/packages/validator/src/index.spec.ts @@ -1,7 +1,7 @@ jest.mock('fs-extra'); -jest.mock('@codeshift/fetcher'); +jest.mock('@hypermod/fetcher'); -import { fetchConfig } from '@codeshift/fetcher'; +import { fetchConfig } from '@hypermod/fetcher'; import { isValidPackageName, isValidConfig, isValidConfigAtPath } from '.'; diff --git a/packages/validator/src/index.ts b/packages/validator/src/index.ts index 190f89425..ca012a83d 100644 --- a/packages/validator/src/index.ts +++ b/packages/validator/src/index.ts @@ -1,7 +1,7 @@ import semver from 'semver'; -import { CodeshiftConfig } from '@codeshift/types'; -import { fetchConfig } from '@codeshift/fetcher'; +import { CodeshiftConfig } from '@hypermod/types'; +import { fetchConfig } from '@hypermod/fetcher'; function hasValidTransforms(config: CodeshiftConfig) { if (!config.transforms) return true; diff --git a/scripts/docs.ts b/scripts/docs.ts index 09bccc471..db51ca592 100644 --- a/scripts/docs.ts +++ b/scripts/docs.ts @@ -2,8 +2,8 @@ import fs from 'fs-extra'; import junk from 'junk'; import path from 'path'; -import { CodeshiftConfig } from '@codeshift/types'; -import { fetchConfig } from '@codeshift/fetcher'; +import { CodeshiftConfig } from '@hypermod/types'; +import { fetchConfig } from '@hypermod/fetcher'; const COMMUNITY_PATH = path.join(__dirname, '..', 'community'); const DOCS_PATH = path.join( @@ -53,7 +53,7 @@ function renderTransform( return `### ${id} :::info -[Source](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community/${urlSafePackageName}) | [Report an issue](https://github.com/CodeshiftCommunity/CodeshiftCommunity/issues/new?title=${safePackageName}@${id}) +[Source](https://github.com/hypermod-io/hypermod-community/tree/main/community/${urlSafePackageName}) | [Report an issue](https://github.com/hypermod-io/hypermod-community/issues/new?title=${safePackageName}@${id}) **Usage** \`$ codeshift --packages ${packageName}${seperator}${id} path/to/source\` ::: diff --git a/scripts/initialize-preset.ts b/scripts/initialize-preset.ts index 3bc141b61..98999b142 100644 --- a/scripts/initialize-preset.ts +++ b/scripts/initialize-preset.ts @@ -1,7 +1,7 @@ import chalk from 'chalk'; import path from 'path'; -import { initDirectory, initTransform } from '@codeshift/initializer'; +import { initDirectory, initTransform } from '@hypermod/initializer'; const communityPath = `${__dirname}/../community`; diff --git a/scripts/initialize.ts b/scripts/initialize.ts index 6fdbccacd..eae72f357 100644 --- a/scripts/initialize.ts +++ b/scripts/initialize.ts @@ -1,7 +1,7 @@ import chalk from 'chalk'; import path from 'path'; -import { initDirectory, initTransform } from '@codeshift/initializer'; +import { initDirectory, initTransform } from '@hypermod/initializer'; const communityPath = `${__dirname}/../community`; diff --git a/scripts/sync.ts b/scripts/sync.ts index 2f279d28c..9973529db 100644 --- a/scripts/sync.ts +++ b/scripts/sync.ts @@ -3,7 +3,7 @@ import junk from 'junk'; import path from 'path'; import axios from 'axios'; -import { fetchConfig } from '@codeshift/fetcher'; +import { fetchConfig } from '@hypermod/fetcher'; const COMMUNITY_PATH = path.join(__dirname, '..', 'community'); const CODESHIFT_WORKER_URL = 'http://codeshift.delcore.workers.dev/packages'; @@ -27,7 +27,7 @@ async function main() { throw new Error(`Unable to locate config for path: ${dir}`); } - const pkgName = `@codeshift/mod-${dir.replace('@', '').replace('/', '__')}`; + const pkgName = `@hypermod/mod-${dir.replace('@', '').replace('/', '__')}`; const rawPkgName = dir.replace('__', '/'); data.push({ pkgName, diff --git a/scripts/validate.ts b/scripts/validate.ts index 66ec5ae4f..7b664c5e2 100644 --- a/scripts/validate.ts +++ b/scripts/validate.ts @@ -2,10 +2,10 @@ import fs, { lstatSync, existsSync } from 'fs-extra'; import junk from 'junk'; import path from 'path'; import chalk from 'chalk'; -import { isValidPackageName, isValidConfigAtPath } from '@codeshift/validator'; +import { isValidPackageName, isValidConfigAtPath } from '@hypermod/validator'; const validPackageNameFormat = - /^@codeshift\/mod(-[a-zA-Z0-9]+)*(-(?!__)[a-zA-Z0-9]+)*(__([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?)?$/; + /^@hypermod\/mod(-[a-zA-Z0-9]+)*(-(?!__)[a-zA-Z0-9]+)*(__([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?)?$/; function isValidPackageJson(basePath: string) { const pkgJsonPath = path.join(basePath, 'package.json'); @@ -17,7 +17,7 @@ function isValidPackageJson(basePath: string) { if (!validPackageNameFormat.test(pkgJson.name)) { throw new Error(`Invalid package name: ${pkgJson.name} in: ${pkgJsonPath}. If this is a scoped package, please make sure rename the folder to use the "__" characters to denote submodule. -For example: @codeshift/mod-foo__bar`); +For example: @hypermod/mod-foo__bar`); } if (pkgJson.name === 'dist/codeshift.config.js') { diff --git a/tsconfig.json b/tsconfig.json index 097d6522a..bc88c9e15 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "resolveJsonModule": true, "esModuleInterop": true, "paths": { - "@codeshift/*": ["../packages/*/src"] + "@hypermod/*": ["../packages/*/src"], + "@hypermod/*": ["../packages/*/src"] } }, "include": ["packages/**/*", "community/**/*", "scripts"], diff --git a/website/docs/api/codeshift-test-utils.mdx b/website/docs/api/codeshift-test-utils.mdx deleted file mode 100644 index 2cb317552..000000000 --- a/website/docs/api/codeshift-test-utils.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: test-utils -title: codeshift/test-utils -slug: /test-utils ---- - -CodeshiftCommunity provides a set of test utilities to help unit test codemods. - -## Installation - -`@codeshift/test-utils` is pre-bundled with every codemod that is published to [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community), -so there's no need to install it manually. - -However, it is also available for use outside of this project and compatible with jscodeshift. - -`npm install --save-dev @codeshift/test-utils` or `yarn add -D @codeshift/test-utils` - -## API - -### `applyTransform` - -`applyTransform(transform, input, options = { parser: 'babel' })` - -Runs a transform against the provided code and returns the resulting file. - -We provide this method as opposed to [jscodeshift's test utils](https://github.com/facebook/jscodeshift#unit-testing) to maintain jest's skip/only and snapshot features - -**Returns** - -`Promise`: Resulting file after transform has been applied - -**Example** - -```jsx -import * as transformer from '../transform'; -import { applyTransform } from '@codeshift/test-utils'; - -it('should wrap avatar in a tooltip if name is defined', async () => { - const result = await applyTransform( - transformer, - ` - import Avatar from 'avatar'; - - const App = () => { - return ; - } - `, - { parser: 'tsx' }, - ); - - expect(result).toMatchInlineSnapshot(` - "import Tooltip from 'tooltip'; - import Avatar from 'avatar'; - - const App = () => { - return ; - }" - `); -}); -``` diff --git a/website/docs/api/codeshift-cli.mdx b/website/docs/api/hypermod-cli.mdx similarity index 84% rename from website/docs/api/codeshift-cli.mdx rename to website/docs/api/hypermod-cli.mdx index 5402983a3..69124c012 100644 --- a/website/docs/api/codeshift-cli.mdx +++ b/website/docs/api/hypermod-cli.mdx @@ -1,19 +1,19 @@ --- id: cli -title: codeshift/cli +title: hypermod/cli slug: /cli --- -To download and run codemods, we provide a CLI tool called `@codeshift/cli`. +To download and run codemods, we provide a CLI tool called `@hypermod/cli`. -`@codeshift/cli` is responsible for running the provided transform against your entire codebase. +`@hypermod/cli` is responsible for running the provided transform against your entire codebase. Under the hood, it is a wrapper of jscodeshift's CLI, which provides additional functionality 1. Ability to run community codemods hosted on npm 2. Runs versioned codemods in sequence 3. Always runs the latest version of a codemod -The CLI allows you to run transforms either from the [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community) or on your local machine as per the original implementation of jscodeshift +The CLI allows you to run transforms either from the [the public registry](https://github.com/hypermod-io/hypermod-community/tree/main/community) or on your local machine as per the original implementation of jscodeshift **Note:** Codemods will be designed to do the heavy lifting, but they'll often not be perfect so some manual work may still be required in order to successfully migrate. @@ -21,11 +21,11 @@ The CLI allows you to run transforms either from the [the public registry](https We recommend running the CLI with `$ npx` to ensure you always have the latest version. -`$ npx @codeshift/cli --packages mylib@1.0.0 /project/src` +`$ npx @hypermod/cli --packages mylib@1.0.0 /project/src` But it can also be installed globally: -`$ npm install -g @codeshift/cli` or `yarn global add @codeshift/cli` +`$ npm install -g @hypermod/cli` or `yarn global add @hypermod/cli` and run with: @@ -42,7 +42,7 @@ For running codemods as an end-user it's recommend to use the `--packages` flag, In special cases, codeshift package authors may choose to also expose codemod "presets", which can be considered as utility codemods for that package. Presets are also run via the `--packages` flag like so: `--packages react#remove-spread-props`. Notice that we have switched to a hash `#` here to denote that we want to run a preset. -Codeshift will then attempt to locate codemods from both [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community) and the primary npm package ie [React – NPM](https://www.npmjs.com/package/react). +Codeshift will then attempt to locate codemods from both [the public registry](https://github.com/hypermod-io/hypermod-community/tree/main/community) and the primary npm package ie [React – NPM](https://www.npmjs.com/package/react). (Note: Some packages wont have any codemods, you can use the [list](#list) subcommand to check if they exist.) Lastly, when authoring a package, it's possible to test your transforms by omitting both the `--packages` and `--transform` flags. In this interactive mode, the `codeshift/cli` will attempt to locate @@ -79,9 +79,9 @@ Allows you to execute local transform file(s). **example:** -- `$ codeshift --transform codemods/my-special-mod /project/src/file.js` -- `$ codeshift --transform codemods/my-special-mod/index.ts /project/src/file.js` -- `$ codeshift --transform path/to/transform1.ts,path/to/transform2.ts,path/to/transform3.ts /project/src/file.js` +- `$ hypermod --transform codemods/my-special-mod /project/src/file.js` +- `$ hypermod --transform codemods/my-special-mod/index.ts /project/src/file.js` +- `$ hypermod --transform path/to/transform1.ts,path/to/transform2.ts,path/to/transform3.ts /project/src/file.js` ### --packages @@ -89,8 +89,8 @@ Runs transforms for the specified comma separated list of packages, optionally i **example:** -- `$ codeshift --packages @atlaskit/button /project/src` -- `$ codeshift --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src` +- `$ hypermod --packages @atlaskit/button /project/src` +- `$ hypermod --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src` ### --parser, -p @@ -112,8 +112,8 @@ tsx is a superset of JavaScript + JSX and should be the most sensible default fo **example:** -- `$ codeshift --parser tsx /project/src/file.ts` -- `$ codeshift -p babel /project/src/file.js` +- `$ hypermod --parser tsx /project/src/file.ts` +- `$ hypermod -p babel /project/src/file.js` ### --extensions, -e @@ -125,8 +125,8 @@ Transform files with these file extensions (comma separated list). **example:** -- `$ codeshift --extensions ts,tsx /project/src/file.js` -- `$ codeshift -e js /project/src/file.js` +- `$ hypermod --extensions ts,tsx /project/src/file.js` +- `$ hypermod -e js /project/src/file.js` ### --sequence, -s diff --git a/website/docs/api/codeshift-utils.mdx b/website/docs/api/hypermod-utils.mdx similarity index 76% rename from website/docs/api/codeshift-utils.mdx rename to website/docs/api/hypermod-utils.mdx index 7977590c1..fc055d1a0 100644 --- a/website/docs/api/codeshift-utils.mdx +++ b/website/docs/api/hypermod-utils.mdx @@ -1,6 +1,6 @@ --- id: utils -title: codeshift/utils +title: hypermod/utils slug: /utils --- @@ -8,12 +8,12 @@ CodeshiftCommunity provides a set of utilities to help perform common codemod op ## Installation -`@codeshift/utils` is pre-bundled with every codemod that is published to [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community), +`@hypermod/utils` is pre-bundled with every codemod that is published to [the public registry](https://github.com/hypermod-io/hypermod-community/tree/main/community), so there's no need to install it manually. However, it is also available for use outside of this project and compatible with jscodeshift. -`npm install --save-dev @codeshift/utils` or `yarn add -D @codeshift/utils` +`npm install --save-dev @hypermod/utils` or `yarn add -D @hypermod/utils` ## Nodes @@ -70,7 +70,7 @@ import React from 'react'; ``` ```js -import { hasImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration } from '@hypermod/utils'; hasImportDeclaration(j, source, 'react'); // True ``` @@ -93,7 +93,7 @@ import React from 'react'; ``` ```js -import { getImportDeclaration } from '@codeshift/utils'; +import { getImportDeclaration } from '@hypermod/utils'; getImportDeclaration(j, source, 'react'); ``` @@ -116,7 +116,7 @@ import React from 'react'; ``` ```js -import { removeImportDeclaration } from '@codeshift/utils'; +import { removeImportDeclaration } from '@hypermod/utils'; removeImportDeclaration(j, source, 'react'); ``` @@ -144,7 +144,7 @@ import React from 'react'; ``` ```js -import { renameImportDeclaration } from '@codeshift/utils'; +import { renameImportDeclaration } from '@hypermod/utils'; renameImportDeclaration(j, source, 'react', 'preact'); ``` @@ -173,7 +173,7 @@ import React from 'react'; ``` ```js -import { getDefaultImportSpecifier } from '@codeshift/utils'; +import { getDefaultImportSpecifier } from '@hypermod/utils'; getDefaultImportSpecifier(j, source, 'react'); // Collection containing 'React' ``` @@ -196,7 +196,7 @@ import React from 'react'; ``` ```js -import { getDefaultImportSpecifierName } from '@codeshift/utils'; +import { getDefaultImportSpecifierName } from '@hypermod/utils'; getDefaultImportSpecifierName(j, source, 'react'); // Collection containing 'React' ``` @@ -219,7 +219,7 @@ import React from 'react'; ``` ```js -import { hasDefaultImportSpecifier } from '@codeshift/utils'; +import { hasDefaultImportSpecifier } from '@hypermod/utils'; hasDefaultImportSpecifier(j, source, 'react'); // True ``` @@ -242,7 +242,7 @@ import React, { useEffect } from 'react'; ``` ```js -import { removeDefaultImportSpecifier } from '@codeshift/utils'; +import { removeDefaultImportSpecifier } from '@hypermod/utils'; removeDefaultImportSpecifier(j, source, 'React'); ``` @@ -270,7 +270,7 @@ import React, { useEffect } from 'react'; ``` ```js -import { hasImportSpecifier } from '@codeshift/utils'; +import { hasImportSpecifier } from '@hypermod/utils'; hasImportSpecifier(j, source, 'react', 'useEffect'); // True ``` @@ -293,7 +293,7 @@ import React, { useEffect } from 'react'; ``` ```js -import { getImportSpecifier } from '@codeshift/utils'; +import { getImportSpecifier } from '@hypermod/utils'; getImportSpecifier(j, source, 'useEffect'); // Collection containing 'useEffect' ``` @@ -316,7 +316,7 @@ import React, { useEffect as foo } from 'react'; ``` ```js -import { getImportSpecifierName } from '@codeshift/utils'; +import { getImportSpecifierName } from '@hypermod/utils'; getImportSpecifierName(j, source, 'useEffect', 'react'); // 'foo' ``` @@ -339,7 +339,7 @@ import React, { useEffect } from 'react'; ``` ```js -import { insertImportSpecifier } from '@codeshift/utils'; +import { insertImportSpecifier } from '@hypermod/utils'; insertImportSpecifier(j, source, 'useMemo', 'react'); // Collection containing 'useEffect' ``` @@ -368,7 +368,7 @@ import React, { useEffect } from 'react'; ``` ```js -import { removeImportSpecifier } from '@codeshift/utils'; +import { removeImportSpecifier } from '@hypermod/utils'; removeImportSpecifier(j, source, 'useMemo', 'react'); // Collection containing 'useEffect' ``` @@ -401,7 +401,7 @@ const App = () => ; ``` ```js -import { getJSXAttributes } from '@codeshift/utils'; +import { getJSXAttributes } from '@hypermod/utils'; getJSXAttributes(j, source, 'primary'); // Collection containing 'primary' ``` @@ -426,7 +426,7 @@ const App = () => ; ``` ```js -import { hasJSXAttributes } from '@codeshift/utils'; +import { hasJSXAttributes } from '@hypermod/utils'; hasJSXAttributes(j, source, 'primary'); // Found! ``` @@ -453,7 +453,7 @@ const App = () => ; ``` ```js -import { insertCommentBefore } from '@codeshift/utils'; +import { insertCommentBefore } from '@hypermod/utils'; insertCommentBefore( j, @@ -466,7 +466,7 @@ insertCommentBefore( // src/App.js import React from 'react'; -// TODO: (@codeshift) This should be removed in favour of mylib +// TODO: (@hypermod) This should be removed in favour of mylib const App = () => ; ``` @@ -490,7 +490,7 @@ const App = () => ; ``` ```js -import { insertCommentToStartOfFile } from '@codeshift/utils'; +import { insertCommentToStartOfFile } from '@hypermod/utils'; insertCommentToStartOfFile( j, @@ -522,8 +522,52 @@ A helper function to apply an array of motions in sequence. **Example** ```js -import { applyMotions } from '@codeshift/utils'; +import { applyMotions } from '@hypermod/utils'; import { sortImports } from './motions'; applyMotions(j, j(fileInfo.source), [sortImports, removeVar]); ``` + +## Testing + +### `applyTransform` + +`applyTransform(transform, input, options = { parser: 'babel' })` + +Runs a transform against the provided code and returns the resulting file. + +We provide this method as opposed to [jscodeshift's test utils](https://github.com/facebook/jscodeshift#unit-testing) to maintain jest's skip/only and snapshot features + +**Returns** + +`Promise`: Resulting file after transform has been applied + +**Example** + +```jsx +import * as transformer from '../transform'; +import { applyTransform } from '@hypermod/utils'; + +it('should wrap avatar in a tooltip if name is defined', async () => { + const result = await applyTransform( + transformer, + ` + import Avatar from 'avatar'; + + const App = () => { + return ; + } + `, + { parser: 'tsx' }, + ); + + expect(result).toMatchInlineSnapshot(` + "import Tooltip from 'tooltip'; + import Avatar from 'avatar'; + + const App = () => { + return ; + }" + `); +}); +``` diff --git a/website/docs/authoring.mdx b/website/docs/authoring.mdx index 952a520d6..ed47ea2e7 100644 --- a/website/docs/authoring.mdx +++ b/website/docs/authoring.mdx @@ -16,7 +16,7 @@ Which one to use depends on your particular use case. ## 1. Contribute to the public registry -The public registry is the public directory of codemods hosted and published directly from this repository, [visible here](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community). +The public registry is the public directory of codemods hosted and published directly from this repository, [visible here](https://github.com/hypermod-io/hypermod-community/tree/main/community). This directory can be compared to and treated the same as the Typescript type definition registry: [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). _Please see the [Contribution guide](contribution) for more information._ diff --git a/website/docs/consuming.mdx b/website/docs/consuming.mdx index e2346a06b..a95450b1c 100644 --- a/website/docs/consuming.mdx +++ b/website/docs/consuming.mdx @@ -7,18 +7,18 @@ keywords: [codemod, consuming, refactor, codebase, development workflow, command line] --- -Running codemods is made simple through our CLI tool, [@codeshift/cli](/docs/cli). +Running codemods is made simple through our CLI tool, [@hypermod/cli](/docs/cli). -> @codeshift/cli is responsible for running the provided transform against your entire codebase. Under the hood, it is a wrapper of jscodeshift's cli, which provides additional functionality +> @hypermod/cli is responsible for running the provided transform against your entire codebase. Under the hood, it is a wrapper of jscodeshift's cli, which provides additional functionality -For usage please refer to the [@codeshift/cli API reference](/docs/cli). +For usage please refer to the [@hypermod/cli API reference](/docs/cli). ## How to run Community codemods -To run a codeshift package, install and use the `@codeshift/cli`. +To run a hypermod package, install and use the `@hypermod/cli`. -- **npm:** `npm install -g @codeshift/cli` or -- **yarn:** `yarn global add @codeshift/cli` +- **npm:** `npm install -g @hypermod/cli` or +- **yarn:** `yarn global add @hypermod/cli` For example, say we want to run transforms for `@mylib/button` and migrate from version 13 to the latest version 14, we could run the following: @@ -28,9 +28,9 @@ codemod-cli --packages @mylib/button@14.0.0 project/path/to/src The following sequence of events will follow: -1. `@codeshift/cli` will then attempt to download a codeshift package for the `@mylib/button` package matching version `14.0.0` +1. `@hypermod/cli` will then attempt to download a Hypermod package for the `@mylib/button` package matching version `14.0.0` 1. Download the package from NPM -1. Locate the `codeshift.config.js` +1. Locate the `hypermod.config.js` 1. Attempt to find a `transform` for `14.0.0` 1. Run the transform against the path `project/path/to/src` @@ -38,7 +38,7 @@ The following sequence of events will follow: It's also possible to run a series of codemods, one after the other, to migrate your usage of `@mylib/button` across multiple major versions, from say v14, v15 and finally v16. Assuming codemods for those versions exist. -This is done my providing the `--sequence` (or `-s`) flag to `@codeshift/cli`. +This is done my providing the `--sequence` (or `-s`) flag to `@hypermod/cli`. ``` codemod-cli --packages @mylib/button@14.0.0 --sequence project/path/to/src @@ -57,8 +57,8 @@ codemod-cli --transform path/to/transform.ts project/path/to/src ## Parsing TypeScript & Flow -By default `@codeshift/cli` will use `babel` as the default parser and only transform files with a `.js` extensions. +By default `@hypermod/cli` will use `babel` as the default parser and only transform files with a `.js` extensions. If your repo depends on flow or typescript, it's important to remember to specify `ts`, `tsx` or `flow` as the `--parser` and or `jsx, ts, tsx` as `--extensions` to make sure jscodeshift can interpret the files properly. -Please refer to the [@codeshift/cli API reference](/docs/cli) for more information. +Please refer to the [@hypermod/cli API reference](/docs/cli) for more information. diff --git a/website/docs/contribution.mdx b/website/docs/contribution.mdx index 2678d4341..db8f10af4 100644 --- a/website/docs/contribution.mdx +++ b/website/docs/contribution.mdx @@ -8,7 +8,7 @@ keywords: [codemod, contribution, authoring, publishing, tips, best practices] This page covers the process of authoring and publishing codemods, including tips and best practices for creating high-quality codemods that others can use and benefit from. -It is intended to explain in detail contribution to [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community) and is for authors who want: +It is intended to explain in detail contribution to [the public registry](https://github.com/hypermod-io/hypermod-community/tree/main/community) and is for authors who want: - Codemods to be open source - Build tooling, dependency management and project setup to be handled for you @@ -55,7 +55,7 @@ Transformers are the main entrypoint to your codemod, they are responsible for a **Example:** ```ts -import { hasImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration } from '@hypermod/utils'; export default function transformer(file, { jscodeshift: j }, options) { const source = j(file.source); diff --git a/website/docs/external-packages.mdx b/website/docs/external-packages.mdx index 5ad4e54e8..02deec866 100644 --- a/website/docs/external-packages.mdx +++ b/website/docs/external-packages.mdx @@ -8,7 +8,7 @@ keywords: [codeshift, package, creation, npm, tips, best practices] This page covers creation of stand-alone codeshift packages and is for authors who want: -- Control over where and how your codeshift package is hosted +- Control over where and how your Hypermod package is hosted - Control over tooling, dependencies and techstack - The option to create completely generic codemods that don't target specific packages @@ -16,28 +16,28 @@ If you prefer to not to maintain a separate package, please see the [Authoring g ## Initializing -To create a standalone codeshift package automatically, install the install and use the `codeshift/cli`. +To create a standalone Hypermod package automatically, install the install and use the `hypermod/cli`. -- **npm:** `npm install -g @codeshift/cli` or -- **yarn:** `yarn global add @codeshift/cli` +- **npm:** `npm install -g @hypermod/cli` or +- **yarn:** `yarn global add @hypermod/cli` Then given you want to initialize a new project called "foobar", with a codemod targeting version `10.0.0` you can run the following command: -`$ codeshift init --package-name="foobar" --version="10.0.0" ~/Desktop` +`$ hypermod init --package-name="foobar" --version="10.0.0" ~/Desktop` This will create a new directory called "foobar" in the `~/Desktop` directory. You can then also initialize subsequent transforms and presets by running the command again: -`$ codeshift init --package-name="foobar" --preset="sort-imports" ~/Desktop` +`$ hypermod init --package-name="foobar" --preset="sort-imports" ~/Desktop` ### File structure -The file structure of your new codeshift package will look like this: +The file structure of your new hypermod package will look like this: ``` react-cool-library/ - codeshift.config.js // main entrypoint containing configuration and references to your transforms + hypermod.config.js // main entrypoint containing configuration and references to your transforms package.json tsconfig.json jest.config.js @@ -56,9 +56,9 @@ See the [Testing guide](testing) for help getting started with unit tests. ## Publishing -Since your new codeshift package can simply be treated as an NPM package you can simply run `npm version [patch\minor\major]` and `npm publish`. +Since your new hypermod package can simply be treated as an NPM package you can simply run `npm version [patch\minor\major]` and `npm publish`. -Your package will now be accessible via the `codeshift/cli`. Refer to the [Consuming guide](consuming) for information about how to run your new codemods. +Your package will now be accessible via the `hypermod/cli`. Refer to the [Consuming guide](consuming) for information about how to run your new codemods. ## Examples diff --git a/website/docs/guides/css-codemods.mdx b/website/docs/guides/css-codemods.mdx index 8f26fd87d..4f1b208ee 100644 --- a/website/docs/guides/css-codemods.mdx +++ b/website/docs/guides/css-codemods.mdx @@ -20,9 +20,9 @@ As an example, We'll take the JS/CSS use-case and use the popular [PostCSS](http ## Step 1: Installing dependencies -Get started by creating a new Codeshift package with `npx @codeshift/cli init --package-name css-codemod --preset update-css-api .`. +Get started by creating a new Hypermod package with `npx @hypermod/cli init --package-name css-codemod --preset update-css-api .`. -This will create a new Codeshift package with a configuration file and empty transform file for the preset you specified. +This will create a new Hypermod package with a configuration file and empty transform file for the preset you specified. Navigate into your new directory with `cd css-codemod` and install the relevant dependencies: `npm install -s postcss` @@ -108,5 +108,5 @@ const plugin = (): Plugin => { You've created your very first CSS codemod, nice work! We can now run it against some code to verify that's it's working correctly. ``` -npx @codeshift/cli -t css-codemod/src/update-css-api.ts -e css path/to/src +npx @hypermod/cli -t css-codemod/src/update-css-api.ts -e css path/to/src ``` diff --git a/website/docs/guides/monorepos.mdx b/website/docs/guides/monorepos.mdx index d28b9f41d..a0a4a681d 100644 --- a/website/docs/guides/monorepos.mdx +++ b/website/docs/guides/monorepos.mdx @@ -2,15 +2,15 @@ id: monorepos title: Integrating with monorepos slug: /monorepos -description: Learn about monorepos and how they can be used with codeshift. This page covers the benefits of using a monorepo for your codebase, including improved organization, collaboration, and scalability. We'll also discuss how to use codeshift to automatically refactor code in a monorepo and the best practices for working with monorepos and codemods. +description: Learn about monorepos and how they can be used with Hypermod. This page covers the benefits of using a monorepo for your codebase, including improved organization, collaboration, and scalability. We'll also discuss how to use hypermod to automatically refactor code in a monorepo and the best practices for working with monorepos and codemods. keywords: [monorepos, workspaces, lerna, yarn, scalability, packages] --- -Codeshift is specifically designed to play nicely with monorepos (AKA multi-package repositories, multi-project repositories, or monolithic repositories) such as [Turborepo](https://turborepo.org/), [Yarn](https://classic.yarnpkg.com/lang/en/docs/workspaces/), [npm](https://docs.npmjs.com/cli/v7/using-npm/workspaces/) and [pnpm](https://pnpm.io/workspaces) workspaces and [Lerna](https://lerna.js.org/). +Hypermod is specifically designed to play nicely with monorepos (AKA multi-package repositories, multi-project repositories, or monolithic repositories) such as [Turborepo](https://turborepo.org/), [Yarn](https://classic.yarnpkg.com/lang/en/docs/workspaces/), [npm](https://docs.npmjs.com/cli/v7/using-npm/workspaces/) and [pnpm](https://pnpm.io/workspaces) workspaces and [Lerna](https://lerna.js.org/). ## Configuration -Configuring Codeshift in a monorepo can be done in the exact same way as [any existing npm package](/docs/authoring#2-add-codeshift-to-an-existing-package), simply by adding `codeshift.config.js` files and codemods to your packages. +Configuring Hypermod in a monorepo can be done in the exact same way as [any existing npm package](/docs/authoring#2-add-hypermod-to-an-existing-package), simply by adding `hypermod.config.js` files and codemods to your packages. Given you are using a workspace-based monorepo, it's recommended to co-locate codemods with your package source files so they can be published as part of the package, for use by both external and internal users. @@ -22,7 +22,7 @@ packages/ + transform.ts + transform.spec.ts + 2.0.0/ -+ codeshift.config.js ++ hypermod.config.js src/ ... package.json @@ -34,7 +34,7 @@ packages/ package.json ``` -Codeshift config files can be located in either the root, `/src` or `/codemods` directory of a package. +Hypermod config files can be located in either the root, `/src` or `/codemods` directory of a package. ```diff packages/ @@ -47,7 +47,7 @@ packages/ package.json rollup.config.json jest.config.js -+ codeshift.config.js ++ hypermod.config.js dialog/ modal/ @@ -61,12 +61,12 @@ See the [configuration guide](/docs/configuration) for help writing config files ## Initializing -Codeshift provides a CLI to quickly codegen a working codemod package around your existing source files. To do so, run `init` with the `--config-only` flag, +Hypermod provides a CLI to quickly codegen a working codemod package around your existing source files. To do so, run `init` with the `--config-only` flag, which will output a bare-bones configuration. If you provide a `--transform` or `--preset` it will also generate empty transform files in addition. -`$ codeshift init --config-only --transform 10.0.0 --preset foobar packages/my-package` +`$ hypermod init --config-only --transform 10.0.0 --preset foobar packages/my-package` -(Note: this script assumes you have installed `@codeshift/cli` globally) +(Note: this script assumes you have installed `@hypermod/cli` globally) The output of this command will give you a filestructure matching the above example. @@ -76,7 +76,7 @@ When writing codemod(s) it's recommended to use a [test-driven development appro Once you're confident that your codemod works as expected, you will likely want to manually verify against real code. That's where you can use the following command: -`$ codeshift path/to/test/code`. +`$ hypermod path/to/test/code`. When used at the root directory of your monorepo, the CLI will leverage your workspaces config located in your `package.json` to determine which codemods in the monorepo it can run. @@ -95,7 +95,7 @@ And show an interactive list for you to search and can choose from. ## Publishing The workflow to publishing your codemod enhanced packages should remain completely unchanged. -However, it's important to verify that your `codeshift.config.js` and codemods are not ignored by npm (via `.npmignore` or similar) so that they are successfully published to the registry. +However, it's important to verify that your `hypermod.config.js` and codemods are not ignored by npm (via `.npmignore` or similar) so that they are successfully published to the registry. In some cases you may need to add these to the `files` property of your package's `package.json` like so: @@ -104,19 +104,19 @@ In some cases you may need to add these to the `files` property of your package' "name": "@monorepo/my-package", "version": "0.6.0", "main": "./dist/index.js", - "files": ["dist", "src", "codemods", "codeshift.config.js"] + "files": ["dist", "src", "codemods", "hypermod.config.js"] } ``` ## Running -Running a codemod as a consumer can now be done via the `@codeshift/cli`, assuming your package is named `@monorepo/my-package` and your codemod is `1.0.0`: +Running a codemod as a consumer can now be done via the `@hypermod/cli`, assuming your package is named `@monorepo/my-package` and your codemod is `1.0.0`: -`$ codeshift --packages @monorepo/my-package@1.0.0 /path/to/source` +`$ hypermod --packages @monorepo/my-package@1.0.0 /path/to/source` You can even omit the codemod name to be prompted with all codemods as an interactive list: -`$ codeshift --packages @monorepo/my-package /path/to/source` +`$ hypermod --packages @monorepo/my-package /path/to/source` ## Examples diff --git a/website/docs/introduction.mdx b/website/docs/introduction.mdx index 4f9eceda1..82edc4d06 100644 --- a/website/docs/introduction.mdx +++ b/website/docs/introduction.mdx @@ -2,7 +2,7 @@ id: introduction title: Introduction slug: / -description: 'Welcome to the codeshiftcommunity. This is a community of developers who use codeshift to automatically refactor their codebase. Join us to learn more about codeshift, share your own codemods, and collaborate with others.' +description: 'Welcome to the codeshiftcommunity. This is a community of developers who use Hypermod to automatically refactor their codebase. Join us to learn more about Hypermod, share your own codemods, and collaborate with others.' keywords: [codeshift, getting started, best practices] --- @@ -36,7 +36,7 @@ To accomplish this, CodeshiftCommunity aims to address three key challenges: ### Fragmentation in the ecosystem -CodeshiftCommunity offers a platform-agnostic toolchain for creating, publishing, and using codemods, centered around the @codeshift/cli. This CLI provides common infrastructure and eliminates the need for developers to constantly recreate the same tools. +CodeshiftCommunity offers a platform-agnostic toolchain for creating, publishing, and using codemods, centered around the @hypermod/cli. This CLI provides common infrastructure and eliminates the need for developers to constantly recreate the same tools. Some popular libraries in the ecosystem, such as [React](https://github.com/reactjs/react-codemod), [material-ui](https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod) and [next.js](https://nextjs.org/docs/advanced-features/codemods), all offer their own solutions for codemods, CLI, and distribution services. These services are inconsistent and often difficult for the average user to access. While providing these services can be helpful for upgrading libraries, it also places a significant burden on the projects that offer them. @@ -52,7 +52,7 @@ Writing a changelog and constantly answering the same questions about how to mig ### Lack of documentation & familiarity -Writing codemods can often feel like a specialized skill that only a few people in a company know how to do. CodeshiftCommunity aims to change this by providing a hub for documentation and guidance. +Writing codemods can often feel like a specialized skill that only a few people in a company know how to do. Hypermod aims to change this by providing a hub for documentation and guidance. By offering guides, recipes, and reference materials, we hope to demystify codemods and make them more accessible to everyone. With the right documentation in place, it will be easier to normalize the use of codemods and reduce their learning curve. @@ -76,7 +76,7 @@ By using NPM, we aim to make it easy for developers to adopt codemods. All they Our goal is to achieve broad coverage of common JS dependencies, such as React, Jest, and Chalk, by collaborating with the wider JS community to produce high-quality, versioned codemods. -CodeshiftCommunity offers a registry that hosts and automatically publishes codemods under the [/community directory](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community). This directory organizes codemods by package name and version, and publishes them to npm as modules that can be updated or improved. This ensures that users who run codemods always have access to the latest version. +CodeshiftCommunity offers a registry that hosts and automatically publishes codemods under the [/community directory](https://github.com/hypermod-io/hypermod-community/tree/main/community). This directory organizes codemods by package name and version, and publishes them to npm as modules that can be updated or improved. This ensures that users who run codemods always have access to the latest version. ### Rich documentation diff --git a/website/docs/motions.mdx b/website/docs/motions.mdx index 337648033..d7036a311 100644 --- a/website/docs/motions.mdx +++ b/website/docs/motions.mdx @@ -19,7 +19,7 @@ function removeDeprecatedProps(j, source) { Motions can then be applied from the main transform, just like any other function. ```ts -import { hasImportDeclaration } from '@codeshift/utils'; +import { hasImportDeclaration } from '@hypermod/utils'; import removeDeprecatedProps from './motions/remove-deprecated-props'; import restructureImports from './motions/restructure-imports'; @@ -39,7 +39,7 @@ Each motion receives a reference to the AST (`source`) which it can then manipul Alternatively, you can use the utility function [applyMotions](./utils#applymotionsj-source-motions) to run motions in sequence. ```ts -import { applyMotions } from '@codeshift/utils'; +import { applyMotions } from '@hypermod/utils'; import removeDeprecatedProps from './motions/remove-deprecated-props'; import restructureImports from './motions/restructure-imports'; diff --git a/website/docs/recipes/import-manipulation.mdx b/website/docs/recipes/import-manipulation.mdx index f5425944d..ea288fabb 100644 --- a/website/docs/recipes/import-manipulation.mdx +++ b/website/docs/recipes/import-manipulation.mdx @@ -29,7 +29,7 @@ The anatomy of an `ImportDeclaration` includes: - `ImportSpecifier`: `useEffect` - A `source` which can either be a module name or path: `react` -**Note: `@codeshift/utils` provides utilities for import manipulation, please see the docs** +**Note: `@hypermod/utils` provides utilities for import manipulation, please see the docs** ### Finding an import declaration @@ -196,17 +196,18 @@ export default function transformer(file, { jscodeshift: j }, options) { .find(j.ImportDeclaration) // Find all nodes that match a type of `ImportDeclaration` .filter(path => path.node.source.value === 'react'); // Filter imports by source equal to the target ie "react" - reactImports.forEach(( - reactImport, // Iterate over react imports - ) => - // Replace the existing node with a new one - j(reactImport).replaceWith( - // Build a new import declaration node based on the existing one - j.importDeclaration( - reactImport.node.specifiers, // copy over the existing import specificers - j.stringLiteral('hot-new-library'), // Replace the source with our new source + reactImports.forEach( + ( + reactImport, // Iterate over react imports + ) => + // Replace the existing node with a new one + j(reactImport).replaceWith( + // Build a new import declaration node based on the existing one + j.importDeclaration( + reactImport.node.specifiers, // copy over the existing import specificers + j.stringLiteral('hot-new-library'), // Replace the source with our new source + ), ), - ), ); return source.toSource(); diff --git a/website/docs/recipes/react.mdx b/website/docs/recipes/react.mdx index 00a8b829f..f91df487f 100644 --- a/website/docs/recipes/react.mdx +++ b/website/docs/recipes/react.mdx @@ -92,7 +92,10 @@ export default function transformer(file, { jscodeshift: j }, options) { element.node.openingElement.attributes = [ ...element.node.openingElement.attributes, // build and insert our new prop - j.jsxAttribute(j.jsxIdentifier('className'), j.stringLiteral('helloWorld')), + j.jsxAttribute( + j.jsxIdentifier('className'), + j.stringLiteral('helloWorld'), + ), ]; }); @@ -339,8 +342,6 @@ const Button = () => { ## JSX - - ### Wrapping components Wrapping react components with react components is a fairly common operation. @@ -473,7 +474,7 @@ This might seem difficult on the surface, but think about it like every other co **Transform:** ```javascript -import { getJSXAttributes } from '@codeshift/utils'; +import { getJSXAttributes } from '@hypermod/utils'; export default function transformer(file, { jscodeshift: j }, options) { const source = j(file.source); diff --git a/website/docs/registry.mdx b/website/docs/registry.mdx index 73d53f720..af35136bc 100644 --- a/website/docs/registry.mdx +++ b/website/docs/registry.mdx @@ -17,7 +17,7 @@ keywords: Welcome to the CodeshiftCommunity Public Registry. This is a collection of high-quality codemods that have been contributed by members of the community. Browse our registry to find codemods that can help you automatically refactor your codebase, or contribute your own codemods to share with the community. -Source for these packages can be found in the [/community folder](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community). +Source for these packages can be found in the [/community folder](https://github.com/hypermod-io/hypermod-community/tree/main/community). ## Contribution @@ -27,10 +27,10 @@ For other publishing options, including private and external codemod packages, p ## Running registry codemods -Codemods from the registry can be run via the Codeshift CLI, for example: +Codemods from the registry can be run via the Hypermod CLI, for example: ``` -$ npx @codeshift/cli --packages @atlaskit/button /project/src +$ npx @hypermod/cli --packages @atlaskit/button /project/src ``` See the [CLI reference](/docs/cli) for more information. diff --git a/website/docs/testing.mdx b/website/docs/testing.mdx index a3bc285a0..7e4154be2 100644 --- a/website/docs/testing.mdx +++ b/website/docs/testing.mdx @@ -20,7 +20,7 @@ We'll also discuss best practices for writing effective tests that can help you It's very likely that consumers will run into all sorts of edge-cases when running your codemod. That's why it's important to always start by writing tests (TDD style) to assert its behavior. Think about a start and end state. How you might be able to achieve that? What edge-cases can potentially arise? -CodeshiftCommunity (and [jscodeshift](https://github.com/facebook/jscodeshift#unit-testing)) exposes [testing utilities](/docs/test-utils) to help. +CodeshiftCommunity (and [jscodeshift](https://github.com/facebook/jscodeshift#unit-testing)) exposes [testing utilities](/docs/utils) to help. > Codemods are a textbook example of where TDD works. You have an input file, you run the script and you get output. Thus I would really recommend using TDD for codemod projects. > Not only does it make codemods more stable, but having projects with test workflow setup, will help you learn. @@ -30,7 +30,7 @@ CodeshiftCommunity (and [jscodeshift](https://github.com/facebook/jscodeshift#un ## Folder structure -If you're planning to publish a codemod to [the public registry](https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/main/community), follow the [Authoring guide](/docs/authoring#initializing). +If you're planning to publish a codemod to [the public registry](https://github.com/hypermod-io/hypermod-community/tree/main/community), follow the [Authoring guide](/docs/authoring#initializing). Once you've initialized, your file structure should look something like this: @@ -43,11 +43,12 @@ community/[package-name]/[version] ## An example To give an example, consider you're trying to write a codemod that removes deprecated props from a component. -In this case, you would be able to write a simple test using `jest` & `@codeshift/test-utils` like so.. +In this case, you would be able to write a simple test using `jest` & `@hypermod/utils` like so.. ```jsx +import { applyTransform } from '@hypermod/utils'; + import * as transformer from '../transform'; -import { applyTransform } from '@codeshift/test-utils'; it('should remove all deleted props', async () => { const result = await applyTransform( diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index bf9fb833f..de9b31465 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -64,7 +64,7 @@ module.exports = { position: 'right', }, { - href: 'https://github.com/CodeshiftCommunity/CodeshiftCommunity', + href: 'https://github.com/hypermod-io/hypermod-community', label: 'GitHub', position: 'right', }, @@ -111,7 +111,7 @@ module.exports = { }, { label: 'Discussions', - href: 'https://github.com/CodeshiftCommunity/CodeshiftCommunity/discussions', + href: 'https://github.com/hypermod-io/hypermod-community/discussions', }, { label: 'Stack Overflow', @@ -128,11 +128,11 @@ module.exports = { items: [ { label: 'GitHub', - href: 'https://github.com/CodeshiftCommunity/CodeshiftCommunity', + href: 'https://github.com/hypermod-io/hypermod-community', }, { label: 'Roadmap', - href: 'https://github.com/CodeshiftCommunity/CodeshiftCommunity/projects/1', + href: 'https://github.com/hypermod-io/hypermod-community/projects/1', }, ], }, @@ -147,7 +147,7 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), editUrl: - 'https://github.com/CodeshiftCommunity/CodeshiftCommunity/edit/main/website/', + 'https://github.com/hypermod-io/hypermod-community/edit/main/website/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/website/sidebars.js b/website/sidebars.js index 75b775ded..109ee9ba2 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -56,7 +56,7 @@ module.exports = { type: 'category', collapsible: false, collapsed: false, - items: ['api/cli', 'api/utils', 'api/test-utils'], + items: ['api/cli', 'api/utils'], }, ], registry: [ diff --git a/website/src/pages/index.js b/website/src/pages/index.js index bd7003795..77c69da53 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -207,13 +207,13 @@ const App = () => ( 1. Initialize your project

- Instantly create a brand new codeshift package that can be + Instantly create a brand new Hypermod package that can be run from anywhere.

- $ npx @codeshift/cli init foobar + $ npx @hypermod/cli init foobar
@@ -266,7 +266,7 @@ const App = () => ( {`import { hasImportDeclaration, renameImportDeclaration, -} from '@codeshift/utils'; +} from '@hypermod/utils'; function transformer(file, { jscodeshift: j }) { const source = j(file.source); @@ -317,7 +317,7 @@ export default transformer;`}
- $ npx @codeshift/cli -p foobar@12.0.0 path/to/src + $ npx @hypermod/cli -p foobar@12.0.0 path/to/src