Skip to content

Commit

Permalink
2.3.0 (#60)
Browse files Browse the repository at this point in the history
* add @css, @lib & @src webpack aliases

* make `/src` the root of postcss @import calls

* webpack config cleanup

* delete unused/relic file

* remove redundant filename extension

* all dependencies updated

* version bump
  • Loading branch information
bstaruk committed Nov 13, 2019
1 parent dc32b52 commit 3c8897f
Show file tree
Hide file tree
Showing 13 changed files with 1,070 additions and 504 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"parser": "babel-eslint",
"extends": "airbnb-base",
"plugins": ["import"],
"rules": {
"comma-dangle": ["error", "never"],
"linebreak-style": 0,
Expand All @@ -12,5 +13,12 @@
"document": true,
"window": true,
"location": true
},
"settings": {
"import/resolver": {
"webpack": {
"config": "webpack/webpack.config.base.js"
}
}
}
}
1,501 changes: 1,022 additions & 479 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starbase",
"version": "2.2.0",
"version": "2.3.0",
"author": "Brian Staruk <[email protected]>",
"contributors": [
{
Expand Down Expand Up @@ -30,28 +30,30 @@
"keywords": [],
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.2.0",
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.10",
"eslint": "^6.5.1",
"eslint": "^6.6.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-loader": "^3.0.2",
"eslint-plugin-import": "^2.18.2",
"file-loader": "^4.2.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.0",
"offline-plugin": "^5.0.7",
"postcss": "^7.0.18",
"path": "^0.12.7",
"postcss": "^7.0.21",
"postcss-extend": "^1.0.5",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-nested": "^4.1.2",
"postcss-nested": "^4.2.1",
"postcss-preset-env": "^6.7.0",
"postcss-remove-root": "0.0.2",
"postcss-reporter": "^6.0.1",
Expand All @@ -60,8 +62,8 @@
"stylelint-config-standard": "^19.0.0",
"url-loader": "^2.2.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"webpack-merge": "^4.2.2"
},
"dependencies": {
Expand Down
7 changes: 0 additions & 7 deletions src/app.css

This file was deleted.

7 changes: 3 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// offline-plugin
import './lib/offline-plugin';
import '@lib/offline-plugin';

// application css
import './lib/fonts/fonts.css';
import './app.css';
// styles
import '@src/app.styles';

// fetch & promise polyfills (comment-out if not needed)
// require('es6-promise').polyfill();
Expand Down
8 changes: 8 additions & 0 deletions src/app.styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* ordered css imports */
import '@lib/fonts/fonts.css';
import '@css/root.css';

/* all other (alphabetical) css imports */
import '@css/footer.css';
import '@css/header.css';
import '@css/rich-text.css';
2 changes: 1 addition & 1 deletion src/css/footer.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./_variables.css";
@import "css/_variables";

.footer {
margin-top: 2.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/css/header.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./_variables.css";
@import "css/_variables";

.header {
&__brand {
Expand Down
2 changes: 1 addition & 1 deletion src/css/rich-text.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./_variables.css";
@import "css/_variables";

.rich-text {
h2 {
Expand Down
2 changes: 1 addition & 1 deletion src/css/root.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./_variables.css";
@import "css/_variables";

/*
This file is here to contain some baseline styles but
Expand Down
8 changes: 8 additions & 0 deletions webpack/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ module.exports = {
output: {
path: path.resolve(__dirname, '../dist')
},
resolve: {
alias: {
'@css': path.resolve(__dirname, '../src/css'),
'@lib': path.resolve(__dirname, '../src/lib'),
'@src': path.resolve(__dirname, '../src')
},
extensions: ['.js', '.json', '.css']
},
module: {
rules: [
{
Expand Down
4 changes: 3 additions & 1 deletion webpack/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ module.exports = webpackMerge(webpackConfigBase, {
plugins: () => [
stylelint(),
postcssReporter(),
postcssImport(),
postcssImport({
path: [path.resolve(__dirname, '../src')]
}),
postcssNested(),
postcssPresetEnv({
stage: 1,
Expand Down
5 changes: 4 additions & 1 deletion webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OfflinePlugin = require('offline-plugin');
const path = require('path');
const webpackMerge = require('webpack-merge');

// postcss plugins
Expand Down Expand Up @@ -37,7 +38,9 @@ module.exports = webpackMerge(webpackConfigBase, {
plugins: () => [
stylelint(),
postcssReporter(),
postcssImport(),
postcssImport({
path: [path.resolve(__dirname, '../src')]
}),
postcssNested(),
postcssPresetEnv({
stage: 1,
Expand Down

0 comments on commit 3c8897f

Please sign in to comment.