Skip to content

Commit 5ff2c43

Browse files
ci: script publish manager react components update (#13448)
ref: MANAGER-14822 Signed-off-by: Alex Boungnaseng <[email protected]>
1 parent 2642dca commit 5ff2c43

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

scripts/publish.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#!/usr/bin/env node
22
const execa = require('execa');
33
const pSeries = require('p-series');
4+
const fs = require('fs');
45

56
execa('lerna', ['ls', '-pl', '--json', '--toposort'])
67
.then(({ stdout }) => {
78
const packages = JSON.parse(stdout);
89

910
return Promise.all(
10-
packages.map((pkg) =>
11-
execa('npm', ['info', `${pkg.name}@${pkg.version}`])
11+
packages.map((pkg) => {
12+
const parseFullPkg = JSON.parse(
13+
fs.readFileSync(`${pkg.location}/package.json`, {
14+
encoding: 'utf-8',
15+
}),
16+
);
17+
return execa('npm', ['info', `${pkg.name}@${pkg.version}`])
1218
.then((output) =>
13-
Object.assign(pkg, { publish: output.stdout.length > 0 }),
19+
Object.assign(pkg, {
20+
publish: output.stdout.length > 0,
21+
ignoreDependencies: parseFullPkg.ignoreDependencies,
22+
}),
1423
)
1524
.catch((err) => {
1625
if (!err.stderr.includes('404')) {
1726
console.error(err);
1827
process.exit(1);
1928
}
20-
return Object.assign(pkg, { publish: false });
21-
}),
22-
),
29+
return Object.assign(pkg, {
30+
publish: false,
31+
ignoreDependencies: parseFullPkg.ignoreDependencies,
32+
});
33+
});
34+
}),
2335
);
2436
})
2537
.then((packages) =>

0 commit comments

Comments
 (0)