Skip to content

Commit

Permalink
chore: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Jun 20, 2024
1 parent 0a9caab commit bc7d9a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ jobs:
run: |
pnpm run test:artifact
pnpm run test:e2e
- name: Examples Test
if: steps.changes.outputs.changed == 'true'
run: |
pnpm run build:examples
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"scripts": {
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* --parallel=10",
"build:examples": "cross-env NX_DAEMON=false nx run-many -t build --projects @examples/* --parallel=10",
"check-dependency-version": "check-dependency-version-consistency .",
"lint": "biome check . --diagnostic-level=warn",
"prebundle": "nx run-many -t prebundle",
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs';
import { dirname, isAbsolute, join } from 'node:path';
import {
type RsbuildConfig,
createRsbuild,
defineConfig as defineRsbuildConfig,
mergeRsbuildConfig,
} from '@rsbuild/core';
Expand Down Expand Up @@ -138,7 +139,6 @@ export function convertLibConfigtoRsbuildConfig(
export async function composeCreateRsbuildConfig(
rslibConfig: RslibConfig,
): Promise<RsbuildConfig[]> {
const { mergeRsbuildConfig } = await import('@rsbuild/core');
const internalRsbuildConfig = await createInternalRsbuildConfig();

const { lib: libConfigsArray, ...sharedRsbuildConfig } = rslibConfig;
Expand All @@ -164,12 +164,11 @@ export async function composeCreateRsbuildConfig(
}

export async function initRsbuild(rslibConfig: RslibConfig) {
const { createRsbuild } = await import('@rsbuild/core');
// TODO: use environment API instead
const rsbuildConfigArray = await composeCreateRsbuildConfig(rslibConfig);

const rsbuildPromises = rsbuildConfigArray.map(
async (rsbuildConfig: RslibConfig) => {
async (rsbuildConfig: RsbuildConfig) => {
return createRsbuild({ rsbuildConfig });
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface LibConfig extends RsbuildConfig {
}

export interface RslibConfig extends RsbuildConfig {
lib?: LibConfig[];
lib: LibConfig[];
}

export type ConfigParams = {
Expand Down

0 comments on commit bc7d9a2

Please sign in to comment.