Skip to content

Commit

Permalink
Packages: Extract viewport package (#7975)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored Jul 16, 2018
1 parent a6c36e5 commit b00aea3
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 7 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@wordpress/plugins": "file:packages/plugins",
"@wordpress/shortcode": "file:packages/shortcode",
"@wordpress/url": "file:packages/url",
"@wordpress/viewport": "file:packages/viewport",
"@wordpress/wordcount": "file:packages/wordcount",
"classnames": "2.2.5",
"clipboard": "1.7.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/core-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"lodash": "^4.17.10",
"rememo": "^3.0.0"
},
"devDependencies": {
"deep-freeze": "^0.0.1"
},
"publishConfig": {
"access": "public"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
},
"devDependencies": {
"deep-freeze": "^0.0.1",
"enzyme": "^3.3.0"
"enzyme": "^3.3.0",
"react-test-renderer": "^16.4.1"
},
"publishConfig": {
"access": "public"
Expand Down
13 changes: 10 additions & 3 deletions viewport/README.md → packages/viewport/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Viewport
========
# @wordpress/viewport

Viewport is a module for responding to changes in the browser viewport size. It registers its own [data module](https://github.com/WordPress/gutenberg/tree/master/data), updated in response to browser media queries on a standard set of supported breakpoints. This data and the included higher-order components can be used in your own modules and components to implement viewport-dependent behaviors.
Viewport is a module for responding to changes in the browser viewport size. It registers its own [data module](https://github.com/WordPress/gutenberg/tree/master/packages/data), updated in response to browser media queries on a standard set of supported breakpoints. This data and the included higher-order components can be used in your own modules and components to implement viewport-dependent behaviors.

## Installation

Install the module

```bash
npm install @wordpress/viewport --save
```

## Breakpoints

Expand Down
34 changes: 34 additions & 0 deletions packages/viewport/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@wordpress/viewport",
"version": "1.0.0-alpha.3",
"description": "Viewport module for WordPress",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"wordpress",
"viewport"
],
"homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/viewport/README.md",
"repository": {
"type": "git",
"url": "https://github.com/WordPress/gutenberg.git"
},
"bugs": {
"url": "https://github.com/WordPress/gutenberg/issues"
},
"main": "build/index.js",
"module": "build-module/index.js",
"dependencies": {
"@wordpress/compose": "file:../compose",
"@wordpress/data": "file:../data",
"@wordpress/element": "file:../element",
"lodash": "^4.17.10"
},
"devDependencies": {
"deep-freeze": "^0.0.1",
"react-test-renderer": "^16.4.1"
},
"publishConfig": {
"access": "public"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/unit/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"rootDir": "../../",
"collectCoverageFrom": [
"(blocks|components|editor|utils|edit-post|viewport|core-blocks|nux)/**/*.js",
"(blocks|components|editor|utils|edit-post|core-blocks|nux)/**/*.js",
"packages/**/*.js"
],
"coveragePathIgnorePatterns": [
Expand All @@ -11,7 +11,7 @@
"<rootDir>/packages/.*/benchmark/"
],
"moduleNameMapper": {
"@wordpress\\/(blocks|components|editor|utils|edit-post|viewport|core-blocks|nux)$": "$1",
"@wordpress\\/(blocks|components|editor|utils|edit-post|core-blocks|nux)$": "$1",
"@wordpress\\/(a-z0-9-)$": "packages/$1/src"
},
"preset": "@wordpress/jest-preset-default",
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const entryPointNames = [
'components',
'editor',
'utils',
'viewport',
'edit-post',
'core-blocks',
'nux',
Expand All @@ -165,6 +164,7 @@ const gutenbergPackages = [
'keycodes',
'plugins',
'shortcode',
'viewport',
];

const externals = {
Expand Down

0 comments on commit b00aea3

Please sign in to comment.