ci: remove lerna
This commit is contained in:
parent
3eb76b08e3
commit
8a02c0232d
31
build/tasks.js
Normal file
31
build/tasks.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const {join} = require('path');
|
||||
|
||||
const {processCode, spawnWith} = require('@flecks/core/src/server');
|
||||
const {glob} = require('glob');
|
||||
|
||||
const {
|
||||
FLECKS_CORE_ROOT = process.cwd(),
|
||||
} = process.env;
|
||||
|
||||
const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
|
||||
|
||||
(async () => {
|
||||
const paths = (
|
||||
await Promise.all(workspaces.map((workspace) => glob(join(FLECKS_CORE_ROOT, workspace))))
|
||||
)
|
||||
.flat();
|
||||
const cpus = new Array(require('os').cpus().length).fill(Promise.resolve(0));
|
||||
for (let i = 0; i < paths.length; ++i) {
|
||||
cpus[i % cpus.length] = cpus[i % cpus.length]
|
||||
.then(
|
||||
((cwd) => (
|
||||
(code) => {
|
||||
if (0 === code) {
|
||||
return processCode(spawnWith(['npm', 'run', ...process.argv.slice(2)], {cwd}));
|
||||
}
|
||||
}
|
||||
))(paths[i]),
|
||||
);
|
||||
}
|
||||
process.exitCode = (await Promise.all(cpus)).find((code) => code !== 0) || 0;
|
||||
})();
|
|
@ -7,16 +7,14 @@
|
|||
"url": "git+https://github.com/cha0s/flecks.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "lerna run build",
|
||||
"build": "node build/tasks build",
|
||||
"ci": "act -j verify",
|
||||
"clean": "lerna run clean",
|
||||
"dox:bump": "npm run dox:gh-pages && cd dox && git add . && git commit -m $(git -C .. rev-parse HEAD) && git push origin gh-pages",
|
||||
"dox:gh-pages": "flecks dox docusaurus && cd website && DOCUSAURUS_GENERATED_FILES_DIR_NAME=node_modules/.cache/docusaurus node_modules/.bin/docusaurus build --out-dir ../dox-tmp && cd .. && rm -rf dox/* && mv dox-tmp/* dox && rmdir dox-tmp",
|
||||
"dox:serve": "flecks dox docusaurus && cd website && DOCUSAURUS_GENERATED_FILES_DIR_NAME=node_modules/.cache/docusaurus node_modules/.bin/docusaurus build --no-minify --out-dir ../dox-tmp && node_modules/.bin/docusaurus serve --dir ../dox-tmp",
|
||||
"dox": "flecks dox docusaurus && cd website && DOCUSAURUS_GENERATED_FILES_DIR_NAME=node_modules/.cache/docusaurus node_modules/.bin/docusaurus",
|
||||
"lint": "lerna run lint",
|
||||
"publish": "lerna publish --conventional-commits --contents=dist --registry https://registry.npmjs.org",
|
||||
"test": "lerna run test"
|
||||
"lint": "node build/tasks lint",
|
||||
"test": "node build/tasks test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^9.0.7",
|
||||
|
|
Loading…
Reference in New Issue
Block a user