Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): swc should be an optional peer dependency (#10461)
- Loading branch information
1 parent
33b5142
commit c9897c6
Showing
16 changed files
with
194 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { swcCoreVersion } from 'nx/src/utils/versions'; | ||
|
||
export const nxVersion = require('../../package.json').version; | ||
|
||
export const swcCoreVersion = '~1.2.143'; | ||
export const swcCliVersion = '~0.1.55'; | ||
export const swcHelpersVersion = '~0.3.3'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { addDependenciesToPackageJson, formatFiles, Tree } from '@nrwl/devkit'; | ||
import { swcCoreVersion, swcNodeVersion } from 'nx/src/utils/versions'; | ||
import { WORKSPACE_PLUGIN_DIR } from '../../generators/workspace-rules-project/workspace-rules-project'; | ||
|
||
export default async function addSwcNodeIfNeeded(tree: Tree) { | ||
try { | ||
if (tree.exists(WORKSPACE_PLUGIN_DIR)) { | ||
addDependenciesToPackageJson( | ||
tree, | ||
{}, | ||
{ '@swc-node/register': swcNodeVersion, '@swc/core': swcCoreVersion } | ||
); | ||
await formatFiles(tree); | ||
return; | ||
} | ||
} catch {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/nx-plugin/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
addDependenciesToPackageJson, | ||
formatFiles, | ||
installPackagesTask, | ||
Tree, | ||
} from '@nrwl/devkit'; | ||
import { swcCoreVersion, swcNodeVersion } from 'nx/src/utils/versions'; | ||
|
||
export default async function addSwcNodeIfNeeded(tree: Tree) { | ||
addDependenciesToPackageJson( | ||
tree, | ||
{}, | ||
{ '@swc-node/register': swcNodeVersion, '@swc/core': swcCoreVersion } | ||
); | ||
await formatFiles(tree); | ||
return installPackagesTask(tree); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c9897c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev