Skip to content

Commit ed438ce

Browse files
committedJun 7, 2020
Initial commit with @wearerequired/postcss-config package
1 parent 70fb03e commit ed438ce

12 files changed

+188
-2
lines changed
 

‎.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
12+
13+
[{*.json,*.yml}]
14+
indent_style = space
15+
indent_size = 2

‎.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/**/node_modules/*
2+
!.*.js

‎.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: [ '@wearerequired/eslint-config' ],
3+
};

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/**/node_modules/*
2+
package-lock.json

‎README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# js
2-
Monorepo for JavaScript Packages
1+
# Monorepo for JavaScript Packages
2+
3+
## Packages
4+
5+
* [@wearerequired/postcss-config](packages/postcss-config)
6+
Shareable PostCSS config

‎lerna.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "independent",
6+
"command": {
7+
"version": {
8+
"allowBranch": "master",
9+
"message": "Publish",
10+
"signGitTag": true
11+
}
12+
},
13+
"ignoreChanges": [
14+
"**/CHANGELOG.md"
15+
]
16+
}

‎package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "@wearerequired/js",
3+
"private": true,
4+
"author": {
5+
"name": "required gmbh",
6+
"email": "info@required.com",
7+
"url": "https://required.com"
8+
},
9+
"devDependencies": {
10+
"@wearerequired/eslint-config": "^1.5.0",
11+
"@wordpress/eslint-plugin": "^6.1.0",
12+
"eslint": "^6.8.0",
13+
"lerna": "^3.22.0"
14+
},
15+
"scripts": {
16+
"publish:check": "lerna updated",
17+
"publish:dev": "lerna publish --dist-tag next",
18+
"publish:patch": "lerna publish --dist-tag patch",
19+
"publish:prod": "lerna publish"
20+
}
21+
}

‎packages/postcss-config/CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
### Added
10+
11+
* Initial release.
12+
13+
[Unreleased]: https://github.com/wearerequired/js/compare/v0.1.0...HEAD
14+
[v0.1.0]: https://github.com/wearerequired/js/compare/v0.1.0...HEAD

‎packages/postcss-config/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# @wearerequired/postcss-config
2+
3+
Shareable PostCSS config used by @wearerequired.
4+
5+
## Installation
6+
7+
Install the package:
8+
9+
```bash
10+
npm install @wearerequired/postcss-config --save
11+
```
12+
13+
## Usage
14+
15+
To use this config, simply reference `@wearerequired/postcss-config` in your PostCSS configuration.
16+
17+
For example, using `postcss.config.js`:
18+
19+
```js
20+
module.exports = require( '@wearerequired/postcss-config' );
21+
```
22+
23+
## Included Plugins
24+
25+
* [postcss-import](https://github.com/postcss/postcss-import)
26+
Plugin to transform `@import` rules by inlining content.
27+
* [postcss-mixins](https://github.com/postcss/postcss-mixins)
28+
Plugin for mixins.
29+
* [postcss-nested](https://github.com/postcss/postcss-nested)
30+
Plugin to unwrap nested rules like how Sass does it.
31+
* [postcss-preset-env](https://github.com/csstools/postcss-preset-env)
32+
Convert modern CSS into something most browsers can understand, determining the polyfills based on targeted browsers.
33+
* [postcss-hexrgba](https://github.com/seaneking/postcss-hexrgba)
34+
Plugin that adds shorthand hex methods to `rgba()` values.
35+
* [css-mqpacker](https://github.com/hail2u/node-css-mqpacker)
36+
Plugin for packing same CSS media query rules into one.
37+
* [cssnano](https://github.com/cssnano/cssnano)
38+
A modern, modular compression tool. Only used for production builds.

‎packages/postcss-config/index.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = ( ctx ) => {
2+
const config = {
3+
plugins: {
4+
'postcss-import': {},
5+
'postcss-mixins': {},
6+
'postcss-nested': {},
7+
'postcss-preset-env': {
8+
stage: 0,
9+
preserve: false, // Omit pre-polyfilled CSS.
10+
features: {
11+
'nesting-rules': false /* Uses postcss-nesting which doesn't behave like Sass. */,
12+
},
13+
autoprefixer: {
14+
grid: true,
15+
},
16+
},
17+
'postcss-hexrgba': {},
18+
'css-mqpacker': {
19+
sort: true,
20+
},
21+
},
22+
};
23+
24+
if ( 'development' === ctx.env ) {
25+
config.map = true;
26+
} else {
27+
config.map = false;
28+
config.plugins.cssnano = {
29+
safe: true,
30+
};
31+
}
32+
33+
return config;
34+
};

‎packages/postcss-config/package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@wearerequired/postcss-config",
3+
"version": "0.0.0",
4+
"description": "Shareable PostCSS config used by @wearerequired.",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/wearerequired/js.git"
8+
},
9+
"keywords": [
10+
"postcss",
11+
"postcss-config",
12+
"css"
13+
],
14+
"author": {
15+
"name": "required gmbh",
16+
"email": "info@required.com",
17+
"url": "https://required.com"
18+
},
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/wearerequired/js/issues"
22+
},
23+
"homepage": "https://github.com/wearerequired/js/packages/postcss-config#readme",
24+
"dependencies": {
25+
"css-mqpacker": "^7.0.0",
26+
"cssnano": "^4.1.10",
27+
"postcss-hexrgba": "^2.0.0",
28+
"postcss-import": "^12.0.1",
29+
"postcss-mixins": "^6.2.3",
30+
"postcss-nested": "^4.2.1",
31+
"postcss-preset-env": "^6.7.0"
32+
},
33+
"publishConfig": {
34+
"access": "public"
35+
}
36+
}

‎postcss.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require( './packages/postcss-config' );

0 commit comments

Comments
 (0)
Please sign in to comment.