Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./*": {
"types": "./dist/components/*/index.d.ts",
"node": "./lib-commonjs/components/*/index.js",
"import": "./lib/components/*/index.js",
"require": "./lib-commonjs/components/*/index.js"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"node": "./lib-commonjs/utils/index.js",
"import": "./lib/utils/index.js",
"require": "./lib-commonjs/utils/index.js"
},
"./package.json": "./package.json"
},
"beachball": {
Expand Down
10 changes: 9 additions & 1 deletion tools/workspace-plugin/src/executors/build/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NormalizedOptions, normalizeOptions, processAsyncQueue, runInParallel,

import { measureEnd, measureStart } from '../../utils';
import generateApiExecutor from '../generate-api/executor';
import { type GenerateApiExecutorSchema } from '../generate-api/schema';

import { type BuildExecutorSchema } from './schema';

Expand All @@ -22,7 +23,14 @@ const runExecutor: PromiseExecutor<BuildExecutorSchema> = async (schema, context
() =>
runInParallel(
() => runBuild(options, context),
() => (options.generateApi ? generateApiExecutor({}, context).then(res => res.success) : Promise.resolve(true)),
() => {
if (!options.generateApi) {
return Promise.resolve(true);
}
const generateApiSchema: GenerateApiExecutorSchema =
typeof options.generateApi === 'object' ? options.generateApi : {};
return generateApiExecutor(generateApiSchema, context).then(res => res.success);
},
),
() => copyAssets(assetFiles),
);
Expand Down
2 changes: 1 addition & 1 deletion tools/workspace-plugin/src/executors/build/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface BuildExecutorSchema {
/**
* Generate rolluped 'd.ts' bundle including 'api.md' that provides project public API
*/
generateApi?: boolean;
generateApi?: boolean | { exportSubpaths?: boolean | { apiReport?: boolean } };
/**
* Enable Griffel raw styles output.
* This will generate additional files with '.styles.raw.js' extension that contain Griffel raw styles
Expand Down
28 changes: 26 additions & 2 deletions tools/workspace-plugin/src/executors/build/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,32 @@
}
},
"generateApi": {
"type": "boolean",
"description": "Generate rolluped 'd.ts' bundle including 'api.md' that provides project public API",
"oneOf": [
{ "type": "boolean" },
{
"type": "object",
"properties": {
"exportSubpaths": {
"oneOf": [
{ "type": "boolean" },
{
"type": "object",
"properties": {
"apiReport": {
"type": "boolean",
"description": "Whether to generate api.md reports for each resolved sub-path entry."
}
},
"additionalProperties": false
}
],
"description": "Whether to read non-root export map entries from package.json and run api-extractor for each resolved sub-path."
}
},
"additionalProperties": false
}
],
"description": "Generate rolluped 'd.ts' bundle including 'api.md' that provides project public API. Pass an object to configure generate-api executor options.",
"default": true
},
"enableGriffelRawStyles": {
Expand Down
Loading
Loading