Skip to content
Open
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: 6 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./node_modules/@wordpress/scripts/config/.markdownlint.json",
"MD024": { "siblings_only": true },
"MD033": { "allowed_elements": [ "details", "summary" ] },
"MD041": false
}
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ By contributing, you agree that your contributions will be licensed under its [G
As a WordPress project, WP Feature Notifications follows the [WordPress Etiquette principles](https://wordpress.org/about/etiquette/), reproduced below:

> In the WordPress open source project, we realize that our biggest asset is the community that we foster. The project, as a whole, follows these basic philosophical principles from The Cathedral and The Bazaar.
>
> - Contributions to the WordPress open source project are for the benefit of the WordPress community as a whole, not specific businesses or individuals. All actions taken as a contributor should be made with the best interests of the community in mind.
> - Participation in the WordPress open source project is open to all who wish to join, regardless of ability, skill, financial status, or any other criteria.
> - The WordPress open source project is a volunteer-run community. Even in cases where contributors are sponsored by companies, that time is donated for the benefit of the entire open source community.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Tested up to: 6.2
- Requires PHP: 7.4
- License: GPLv2 or later
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
- License URI: <https://www.gnu.org/licenses/gpl-2.0.html>

See also [Trac ticket #43484](https://core.trac.wordpress.org/ticket/43484).

Expand All @@ -30,10 +30,10 @@ We recommend using [nvm](https://github.com/nvm-sh/nvm) to ensure a compatible n
### Installation

```bash
$ git clone https://github.com/WordPress/wp-feature-notifications.git
$ cd wp-feature-notifications
$ nvm use && npm i && composer install
$ wp-env start
git clone https://github.com/WordPress/wp-feature-notifications.git
cd wp-feature-notifications
nvm use && npm i && composer install
wp-env start
```

We take advantage of [wp-scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) to compile scripts and styles for this plugin.
Expand All @@ -51,7 +51,7 @@ Have an improvement, suggestion or bug? The first step is to [open an issue](htt
Once your issue has been opened, it will be triaged, labelled and moved to the relevant [project board](https://github.com/WordPress/wp-feature-notifications/projects?type=classic).

> [!IMPORTANT]
> If your issue is a security vulnerabilty, please practice responsible disclosure and submit this at https://github.com/WordPress/wp-feature-notifications/security/advisories/new.
> If your issue is a security vulnerabilty, please practice responsible disclosure and submit this at <https://github.com/WordPress/wp-feature-notifications/security/advisories/new>.


###  Working on an issue
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
"name": "wp-feature-notifications",
"version": "0.1.0",
"description": "A notification center for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"WordPress",
"notifications",
"dashboard"
],
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/WordPress/wp-feature-notifications#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/WordPress/wp-feature-notifications.git"
},
"bugs": {
"url": "https://github.com/WordPress/wp-feature-notifications/issues"
},
"homepage": "https://github.com/WordPress/wp-feature-notifications#readme",
"engines": {
"node": ">=20.19.0",
"npm": ">=10.2.3"
},
"directories": {
"doc": "docs",
"test": "tests"
Expand All @@ -26,35 +34,6 @@
"workspaces": [
"./storybook"
],
"scripts": {
"start": "wp-scripts start",
"start:storybook": "npm run start --workspace=storybook",
"build": "wp-scripts build",
"build:storybook": "npm run build --workspace=storybook",
"php-install": "wp-env run composer 'composer --ignore-platform-req=php install'",
"packages-update": "wp-scripts packages-update",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style ./src",
"lint:js": "wp-scripts lint-js ./src",
"lint:md:docs": "wp-scripts lint-md-docs ./src",
"lint:pkg-json": "wp-scripts lint-pkg-json ./src",
"plugin-zip": "wp-scripts plugin-zip",
"test:js": "echo \"🚧 TEST JS: WE'LL THINK ABOUT IT LATER 🚧\" && exit 0",
"test:php": "wp-env run phpunit 'phpunit --configuration=/var/www/html/wp-content/plugins/wp-feature-notifications/phpunit.xml.dist'",
"test": "npm run test:php && npm run test:js",
"docGen": "npx docgen src/scripts/wp-notifications.js",
"prepare": "husky"
},
"repository": {
"type": "git",
"url": "git+https://github.com/WordPress/wp-feature-notifications.git"
},
"engines": {
"node": ">=20.19.0",
"npm": ">=10.2.3"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@wordpress/api-fetch": "^7.46.0",
Expand All @@ -78,6 +57,27 @@
"re-resizable": "^6.11.2",
"typescript": "^6.0.3"
},
"scripts": {
"start": "wp-scripts start",
"start:storybook": "npm run start --workspace=storybook",
"build": "wp-scripts build",
"build:storybook": "npm run build --workspace=storybook",
"php-install": "wp-env run composer 'composer --ignore-platform-req=php install'",
"packages-update": "wp-scripts packages-update",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style ./src",
"lint:js": "wp-scripts lint-js ./src",
"lint:md:docs": "wp-scripts lint-md-docs README.md CONTRIBUTING.md \".github/*.md\" \"storybook/stories/**/*.md\"",
"lint:pkg-json": "wp-scripts lint-pkg-json .",
"plugin-zip": "wp-scripts plugin-zip",
"test:js": "echo \"🚧 TEST JS: WE'LL THINK ABOUT IT LATER 🚧\" && exit 0",
"test:php": "wp-env run phpunit 'phpunit --configuration=/var/www/html/wp-content/plugins/wp-feature-notifications/phpunit.xml.dist'",
"test": "npm run test:php && npm run test:js",
"docGen": "npx docgen src/scripts/wp-notifications.js",
"prepare": "husky"
},
"browserslist": [
"extends @wordpress/browserslist-config"
],
Expand Down
28 changes: 23 additions & 5 deletions storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
{
"name": "@wordpress/wp-feature-notifications-stories",
"version": "1.0.0",
"main": "stories/Introduction.stories.mdx",
"scripts": {
"start": "storybook dev -p 6006",
"build": "storybook build --output-dir ../docs/"
"private": true,
"description": "Storybook documentation for the WordPress Feature Notifications plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"WordPress",
"notifications",
"storybook"
],
"homepage": "https://github.com/WordPress/wp-feature-notifications#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/WordPress/wp-feature-notifications.git",
"directory": "storybook"
},
"bugs": {
"url": "https://github.com/WordPress/wp-feature-notifications/issues"
},
"main": "stories/Introduction.stories.mdx",
"devDependencies": {
"@storybook/addon-a11y": "^7.6.1",
"@storybook/addon-docs": "^7.6.1",
Expand All @@ -15,9 +29,9 @@
"@storybook/addon-mdx-gfm": "^7.6.1",
"@storybook/addons": "^7.6.1",
"@storybook/blocks": "^7.6.1",
"@storybook/source-loader": "^7.6.1",
"@storybook/react": "^7.6.1",
"@storybook/react-webpack5": "^7.6.1",
"@storybook/source-loader": "^7.6.1",
"@storybook/theming": "^7.6.1",
"@wordpress/wp-feature-notifications": "../",
"storybook": "^7.6.1"
Expand All @@ -26,6 +40,10 @@
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"scripts": {
"start": "storybook dev -p 6006",
"build": "storybook build --output-dir ../docs/"
},
"eslintConfig": {
"extends": [
"plugin:@wordpress/eslint-plugin/recommended"
Expand Down
18 changes: 9 additions & 9 deletions storybook/stories/docs/database-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ Message are translated at the time of emission to the preferences of the users s

- `meta: JSON` - Data that doesn’t have to be queried and may change while development of the notification system.

- `accept_label: string|null` - The translated accept action label.
- `accept_label: string|null` - The translated accept action label.

- `accept_link: string|null` - The URL of the accept action.
- `accept_link: string|null` - The URL of the accept action.

- `channel_title: string|null` - The translated, human-readable title of the channel the message was emitted from.
- `channel_title: string|null` - The translated, human-readable title of the channel the message was emitted from.

- `dismiss_label: string|null` - The translated dismiss action label.
- `dismiss_label: string|null` - The translated dismiss action label.

- `icon: string|null` - The icon of the notification message.
- `icon: string|null` - The icon of the notification message.

- `is_dismissible boolean|null` - Whether the notification is dismissible.
- `is_dismissible boolean|null` - Whether the notification is dismissible.

Most persisted notifications should be dismissible, otherwise they will not be able to be removed from the notification system by the user. But this is left as a way to maintain a compatible API with the existing notices.
Most persisted notifications should be dismissible, otherwise they will not be able to be removed from the notification system by the user. But this is left as a way to maintain a compatible API with the existing notices.

- `severity: string|null` - The severity of the message, examples: info, warning, alert.
- `severity: string|null` - The severity of the message, examples: info, warning, alert.

This should be a predefined list of values.
This should be a predefined list of values.

## Message Queue

Expand Down
6 changes: 3 additions & 3 deletions storybook/stories/docs/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Instead, a plugin or theme should store a key, which is linked to a translatable

For example, given the following list of translatable strings in a plugin

```
```php
$notifications = array(
'plugin_slug_new_podcast_title' => __('Some title', 'plugin-slug'),
'plugin_slug_message' => __('Some message', 'plugin-slug'),
Expand All @@ -17,9 +17,9 @@ $notifications = array(

When adding a notification to the wp_notifications table, the values will be stored as follows

```
```text
title_key = 'plugin_slug_new_podcast_title'
message_key = 'plugin_slug_message'
```

The plugin will then be responsible for looking up these strings, and returning the translated version.
The plugin will then be responsible for looking up these strings, and returning the translated version.
Loading