Skip to content

Commit 5407604

Browse files
committed
fixes react package
1 parent 83bca6e commit 5407604

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

.changeset/thick-impalas-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/publisher': patch
3+
---
4+
5+
Minor adjustments to build script

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Repo
22
.tmp/
33
plugin_packages/
4+
.vscode/
45

56
# Generated website pages
67
website/docs/registry-generated/*

community/react/codeshift.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module.exports = {
33
targets: ['react', 'react-dom'],
44
description: 'Codemods for react',
55
transforms: {},
6-
76
presets: {
87
'add-react-import': require.resolve('./add-react-import/transform'),
98
'create-element-to-jsx': require.resolve(

community/react/use-string-literal-props/transform.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ export default function transformer(
2424

2525
const withoutTemplateLiterals = j(withoutStringLiterals)
2626
.find(j.JSXAttribute)
27-
.filter(path => {
27+
.filter((path: any) => {
2828
return (
2929
path.value &&
3030
path.value.value &&
31-
// @ts-expect-error
3231
path.value.value.expression &&
3332
path.value.value.type === 'JSXExpressionContainer' &&
3433
path.value.value.expression &&

packages/publisher/src/build.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,20 @@ export default function buildPackages(path: string, packages: string[]) {
44
return Promise.all(
55
packages.map(
66
pkg =>
7-
new Promise<void>((resolve, reject) =>
7+
new Promise<string>((resolve, reject) => {
88
exec(
99
`yarn build`,
1010
{ cwd: `${path}/${pkg}` },
1111
(error, stdout, stderr) => {
1212
if (error) {
1313
console.error(`exec error for package ${pkg}\n${error}`);
1414
reject(`Unable to build codeshift package: ${pkg}\n${error}`);
15-
return;
1615
}
1716

18-
if (stderr) {
19-
console.error(stderr);
20-
}
21-
22-
console.log(stdout);
23-
24-
resolve();
17+
resolve(stdout ? stdout : stderr);
2518
},
26-
),
27-
),
19+
);
20+
}),
2821
),
2922
);
3023
}

0 commit comments

Comments
 (0)