Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated: Type package #26429

Merged
merged 4 commits into from
Nov 13, 2020
Merged
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
6 changes: 5 additions & 1 deletion packages/block-editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"rootDir": "src",
"declarationDir": "build-types"
},
"references": [ { "path": "../element" }, { "path": "../hooks" } ],
"references": [
{ "path": "../deprecated" },
{ "path": "../element" },
{ "path": "../hooks" }
],
// NOTE: This package is being progressively typed. You are encouraged to
// expand this array with files which can be type-checked. At some point in
// the future, this can be simplified to an `includes` of `src/**/*`.
Expand Down
1 change: 1 addition & 0 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"declarationDir": "build-types"
},
"references": [
{ "path": "../deprecated" },
{ "path": "../element" },
{ "path": "../hooks" },
{ "path": "../primitives" }
Expand Down
4 changes: 4 additions & 0 deletions packages/deprecated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### New Feature

- Include TypeScript type declarations ([#26429](https://github.com/WordPress/gutenberg/pull/26429))

## 2.6.0 (2019-08-29)

### Bug Fix
Expand Down
14 changes: 7 additions & 7 deletions packages/deprecated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ deprecated( 'Eating meat', {
_Parameters_

- _feature_ `string`: Name of the deprecated feature.
- _options_ `?Object`: Personalisation options
- _options.version_ `?string`: Version in which the feature will be removed.
- _options.alternative_ `?string`: Feature to use instead
- _options.plugin_ `?string`: Plugin name if it's a plugin feature
- _options.link_ `?string`: Link to documentation
- _options.hint_ `?string`: Additional message to help transition away from the deprecated feature.
- _options_ `[Object]`: Personalisation options
- _options.version_ `[string]`: Version in which the feature will be removed.
- _options.alternative_ `[string]`: Feature to use instead
- _options.plugin_ `[string]`: Plugin name if it's a plugin feature
- _options.link_ `[string]`: Link to documentation
- _options.hint_ `[string]`: Additional message to help transition away from the deprecated feature.

<a name="logged" href="#logged">#</a> **logged**

Expand All @@ -68,7 +68,7 @@ message is only logged once.

_Type_

- `Object`
- `Record<string,(|undefined)>`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't picked up properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, is it logged somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now 🙂

#26971



<!-- END TOKEN(Autogenerated API docs) -->
Expand Down
1 change: 1 addition & 0 deletions packages/deprecated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"types": "build-types",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.11.2",
Expand Down
16 changes: 8 additions & 8 deletions packages/deprecated/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { doAction } from '@wordpress/hooks';
* Object map tracking messages which have been logged, for use in ensuring a
* message is only logged once.
*
* @type {Object}
* @type {Record<string,true|undefined>}
*/
export const logged = Object.create( null );

/**
* Logs a message to notify developers about a deprecated feature.
*
* @param {string} feature Name of the deprecated feature.
* @param {?Object} options Personalisation options
* @param {?string} options.version Version in which the feature will be removed.
* @param {?string} options.alternative Feature to use instead
* @param {?string} options.plugin Plugin name if it's a plugin feature
* @param {?string} options.link Link to documentation
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
* @param {string} feature Name of the deprecated feature.
* @param {Object} [options] Personalisation options
* @param {string} [options.version] Version in which the feature will be removed.
* @param {string} [options.alternative] Feature to use instead
* @param {string} [options.plugin] Plugin name if it's a plugin feature
* @param {string} [options.link] Link to documentation
* @param {string} [options.hint] Additional message to help transition away from the deprecated feature.
*
* @example
* ```js
Expand Down
9 changes: 9 additions & 0 deletions packages/deprecated/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "build-types"
},
"references": [ { "path": "../hooks" } ],
"include": [ "src/**/*" ]
}
2 changes: 2 additions & 0 deletions packages/eslint-plugin/configs/jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const typescriptUtilityTypes = [
'NodeJS',
'AsyncIterableIterator',
'NodeRequire',
'true',
'false',
];

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{ "path": "packages/blob" },
{ "path": "packages/block-editor" },
{ "path": "packages/components" },
{ "path": "packages/deprecated" },
{ "path": "packages/element" },
{ "path": "packages/dependency-extraction-webpack-plugin" },
{ "path": "packages/dom-ready" },
Expand Down