Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions kbn_pm/src/commands/bootstrap/bootstrap_command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const command = {
const quiet = args.getBooleanValue('quiet') ?? false;
const vscodeConfig =
!IS_CI && (args.getBooleanValue('vscode') ?? !process.env.KBN_BOOTSTRAP_NO_VSCODE);
const allowRoot = args.getBooleanValue('allow-root') ?? false;
const forceInstall = args.getBooleanValue('force-install');
const shouldInstall =
forceInstall || !(await areNodeModulesPresent()) || !(await checkYarnIntegrity(log));
Expand Down Expand Up @@ -105,40 +104,49 @@ export const command = {
}
});

await time('pre-build webpack bundles for packages', async () => {
log.info('pre-build webpack bundles for packages');
await run(
'yarn',
['kbn', 'build-shared']
.concat(quiet ? ['--quiet'] : [])
.concat(forceInstall ? ['--no-cache'] : [])
.concat(allowRoot ? ['--allow-root'] : []),
{
pipe: true,
}
);
log.success('shared webpack bundles built');
});

await time('sort package json', async () => {
await sortPackageJson(log);
});

await Promise.all([
const backgroundTasks = [
validate
? time('validate dependencies', async () => {
// now that deps are installed we can import `@kbn/yarn-lock-validator`
const { readYarnLock, validateDependencies } = External['@kbn/yarn-lock-validator']();
await validateDependencies(log, await readYarnLock());
log.success('yarn.lock analysis completed without any issues');
})
: undefined,
vscodeConfig
? time('update vscode config', async () => {
// Update vscode settings
await run('node', ['scripts/update_vscode_config']);
const moonArgs = ['run', 'kibana:update-vscode-config'];
if (forceInstall) {
moonArgs.push('--force', '--updateCache');
}
await run('moon', moonArgs);
log.success('vscode config updated');
})
: undefined,
]);
];

await time('pre-build webpack bundles for packages', async () => {
log.info('pre-build webpack bundles for packages');
const moonArgs = ['run', ':build-webpack'];
if (quiet) {
moonArgs.push('--quiet');
}
if (forceInstall) {
moonArgs.push('--updateCache', '--force');
}
await run('moon', moonArgs, {
pipe: !quiet,
});
log.success('shared webpack bundles built');
});

await time('sort package json', async () => {
await sortPackageJson(log);
});

await Promise.all(backgroundTasks);

log.success('bootstrap complete');
},
};
13 changes: 13 additions & 0 deletions moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ tasks:
cache: false
bootstrap:
script: yarn kbn bootstrap
update-vscode-config:
script: node scripts/update_vscode_config.js
inputs:
- "packages/kbn-managed-vscode-config/src/**/*.ts"
- "packages/kbn-managed-vscode-config/index.ts"
- "packages/kbn-managed-vscode-config-cli/index.ts"
- "packages/kbn-kibana-manifest-schema/src/**/*.ts"
outputs:
- ".vscode/settings.json"
- ".vscode/kibana-*.json"
options:
cache: true


workspace:
inheritedTasks:
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,4 @@ export async function validateDependencies(log: SomeDevLog, yarnLock: YarnLock)

process.exit(1);
}

log.success('yarn.lock analysis completed without any issues');
}