File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 11## 0.0.1-beta.1
22
33- Introduce package. Create skeleton.
4+ - Expose [ getMeta()] ( './src/utils/meta/Readme.md )
Original file line number Diff line number Diff line change 1+ /*
2+ * Utils
3+ */
4+ export * from './utils/meta' ;
Original file line number Diff line number Diff line change 1+ # Site Admin Meta Helper
2+
3+ Returns the name, description, and version of the Site Admin package.
4+
5+ ## Usage
6+ ``` typescript
7+ import { getSiteAdminMeta } from ' @automattic/site-admin' ;
8+
9+ const meta = getSiteAdminMeta ();
10+ console .log (` The package version is ${meta .version } ` );
11+ ```
Original file line number Diff line number Diff line change 1+ /**
2+ * Internal dependencies
3+ */
4+ import { name , version , description } from '../../../package.json' ;
5+
6+ type Meta = {
7+ name : string ;
8+ version : string ;
9+ description : string ;
10+ } ;
11+
12+ /**
13+ * Get the site admin meta data.
14+ * @returns {Meta } Site admin meta data.
15+ */
16+ export function getMeta ( ) : Meta {
17+ return {
18+ name,
19+ version,
20+ description,
21+ } ;
22+ }
You can’t perform that action at this time.
0 commit comments