Skip to content

Commit 8b0c3a5

Browse files
aduthjsnajdrmirka
authored
UI: Ensure Stack is exported from root package exports (#73928)
* UI: Ensure Stack is exported from root package exports * Remove unused references to private-apis * Avoid path.join for glob paths fast-glob requires forward slashes. path.join produces backslashes in Windows environment. Simple fix is to avoid path.join * Update package-lock.json * Use cwd option with fast-glob to avoid mixed slashes Co-authored-by: Lena Morita <lena@jaguchi.com> * Fix lint errors --------- Co-authored-by: Lena Morita <lena@jaguchi.com> Co-authored-by: aduth <aduth@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
1 parent 01b8c77 commit 8b0c3a5

8 files changed

Lines changed: 31 additions & 20 deletions

File tree

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ui/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->
2+
3+
## Unreleased
4+
5+
### New Features
6+
7+
- Add `Stack` component

packages/ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"sideEffects": false,
3838
"dependencies": {
3939
"@wordpress/element": "file:../element",
40-
"@wordpress/private-apis": "file:../private-apis",
4140
"clsx": "^2.1.1"
4241
},
4342
"devDependencies": {

packages/ui/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './box';
2+
export * from './stack';

packages/ui/src/lock-unlock.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/ui/src/stack/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
/**
2-
* Internal dependencies
3-
*/
41
export { Stack } from './stack';

packages/ui/src/test/index.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { join, dirname, basename } from 'node:path';
2+
import { readFile } from 'node:fs/promises';
3+
import glob from 'fast-glob';
4+
5+
describe( 'index', () => {
6+
it( 'should export something from each component', async () => {
7+
// As described in the CONTRIBUTING.md file, each component should be
8+
// exported from an index.ts in its implementation directory.
9+
const components = await glob( '*/index.ts', {
10+
cwd: join( __dirname, '..' ),
11+
} );
12+
const directories = components.map( ( c ) => basename( dirname( c ) ) );
13+
const index = await readFile(
14+
join( __dirname, '../index.ts' ),
15+
'utf-8'
16+
);
17+
18+
for ( const directory of directories ) {
19+
expect( index ).toContain( `'./${ directory }'` );
20+
}
21+
} );
22+
} );

packages/ui/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"compilerOptions": {
55
"types": [ "node", "jest", "@testing-library/jest-dom" ]
66
},
7-
"references": [
8-
{ "path": "../element" },
9-
{ "path": "../private-apis" },
10-
{ "path": "../theme" }
11-
],
7+
"references": [ { "path": "../element" }, { "path": "../theme" } ],
128
"exclude": []
139
}

0 commit comments

Comments
 (0)