Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
feat: CSS modules should export camelCased names (#585)
Browse files Browse the repository at this point in the history
* export camelcased names

* tweaks

* add repository info

* remove allowBranch config
  • Loading branch information
egoist authored Apr 30, 2020
1 parent 3e6c9d2 commit 5567a8c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 40 deletions.
10 changes: 7 additions & 3 deletions core/poi/lib/plugins/config-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@ exports.apply = api => {
const cssLoaderOptions = Object.assign(
{
sourceMap,
modules,
localIdentName: '[name]_[local]_[hash:base64:5]',
modules: modules
? {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
: false,
importLoaders:
1 + // stylePostLoader injected by vue-loader
(hasPostCSSConfig ? 1 : 0) +
(needInlineMinification ? 1 : 0),
exportOnlyLocals: isServer
onlyLocals: isServer,
localsConvention: 'camelCase'
},
loaderOptions.css
)
Expand Down
2 changes: 1 addition & 1 deletion core/poi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "^2.4.1",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^2.1.1",
"css-loader": "^3.0.0",
"cssnano": "^4.1.7",
"dotenv": "^8.1.0",
"dotenv-expand": "^4.2.0",
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"ignoreChanges": ["**/__fixtures__/**", "**/__tests__/**", "**/*.md"],
"command": {
"publish": {
"allowBranch": ["master"],
"message": "chore(release): publish"
}
}
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"commit": "git-cz",
"release": "lerna version --conventional-commits"
},
"repository": {
"type": "git",
"url": "git@github.com:egoist/poi.git"
},
"workspaces": [
"core/*",
"plugins/*",
Expand Down
4 changes: 2 additions & 2 deletions plugins/astroturf/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ test('astroturf', async () => {
await project.run('poi')
expect(project.require('dist/index.js')).toEqual({
default: {
box: 'index-styles-module_box_1SCdY',
footer: 'index-styles-module_footer_1xrFU'
box: 'index-styles.module_box_1SCdY',
footer: 'index-styles.module_footer_1xrFU'
}
})
})
77 changes: 44 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4837,21 +4837,22 @@ css-declaration-sorter@^4.0.1:
postcss "^7.0.1"
timsort "^0.3.0"

css-loader@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-2.1.1.tgz#d8254f72e412bb2238bb44dd674ffbef497333ea"
integrity sha512-OcKJU/lt232vl1P9EEDamhoO9iKY3tIjY5GU+XDLblAykTdgs6Ux9P1hTHve8nFKy5KPpOXOsVI/hIwi3841+w==
css-loader@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.0.0.tgz#bdd48a4921eefedf1f0a55266585944d4e5efc63"
integrity sha512-WR6KZuCkFbnMhRrGPlkwAA7SSCtwqPwpyXJAPhotYkYsc0mKU9n/fu5wufy4jl2WhBw9Ia8gUQMIp/1w98DuPw==
dependencies:
camelcase "^5.2.0"
icss-utils "^4.1.0"
camelcase "^5.3.1"
cssesc "^3.0.0"
icss-utils "^4.1.1"
loader-utils "^1.2.3"
normalize-path "^3.0.0"
postcss "^7.0.14"
postcss "^7.0.17"
postcss-modules-extract-imports "^2.0.0"
postcss-modules-local-by-default "^2.0.6"
postcss-modules-local-by-default "^3.0.2"
postcss-modules-scope "^2.1.0"
postcss-modules-values "^2.0.0"
postcss-value-parser "^3.3.0"
postcss-modules-values "^3.0.0"
postcss-value-parser "^4.0.0"
schema-utils "^1.0.0"

css-select-base-adapter@~0.1.0:
Expand Down Expand Up @@ -7904,15 +7905,10 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
dependencies:
safer-buffer ">= 2.1.2 < 3"

icss-replace-symbols@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded"
integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=

icss-utils@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.0.tgz#339dbbffb9f8729a243b701e1c29d4cc58c52f0e"
integrity sha512-3DEun4VOeMvSczifM3F2cKQrDQ5Pj6WKhkOq6HD4QTnDUAq8MQRxy5TX6Sy1iY6WPBe4gQ3p5vTECjbIkglkkQ==
icss-utils@^4.0.0, icss-utils@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.1.tgz#21170b53789ee27447c2f47dd683081403f9a467"
integrity sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==
dependencies:
postcss "^7.0.14"

Expand Down Expand Up @@ -11851,14 +11847,15 @@ postcss-modules-extract-imports@^2.0.0:
dependencies:
postcss "^7.0.5"

postcss-modules-local-by-default@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-2.0.6.tgz#dd9953f6dd476b5fd1ef2d8830c8929760b56e63"
integrity sha512-oLUV5YNkeIBa0yQl7EYnxMgy4N6noxmiwZStaEJUSe2xPMcdNc8WmBQuQCx18H5psYbVxz8zoHk0RAAYZXP9gA==
postcss-modules-local-by-default@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz#e8a6561be914aaf3c052876377524ca90dbb7915"
integrity sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==
dependencies:
postcss "^7.0.6"
postcss-selector-parser "^6.0.0"
postcss-value-parser "^3.3.1"
icss-utils "^4.1.1"
postcss "^7.0.16"
postcss-selector-parser "^6.0.2"
postcss-value-parser "^4.0.0"

postcss-modules-scope@^2.1.0:
version "2.1.0"
Expand All @@ -11868,12 +11865,12 @@ postcss-modules-scope@^2.1.0:
postcss "^7.0.6"
postcss-selector-parser "^6.0.0"

postcss-modules-values@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-2.0.0.tgz#479b46dc0c5ca3dc7fa5270851836b9ec7152f64"
integrity sha512-Ki7JZa7ff1N3EIMlPnGTZfUMe69FFwiQPnVSXC9mnn3jozCRBYIxiZd44yJOV2AmabOo4qFf8s0dC/+lweG7+w==
postcss-modules-values@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz#5b5000d6ebae29b4255301b4a3a54574423e7f10"
integrity sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==
dependencies:
icss-replace-symbols "^1.1.0"
icss-utils "^4.0.0"
postcss "^7.0.6"

postcss-nested@^4.1.1:
Expand Down Expand Up @@ -12021,7 +12018,7 @@ postcss-selector-parser@^5.0.0-rc.4:
indexes-of "^1.0.1"
uniq "^1.0.1"

postcss-selector-parser@^6.0.0:
postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz#934cf799d016c83411859e09dcecade01286ec5c"
integrity sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==
Expand Down Expand Up @@ -12049,11 +12046,16 @@ postcss-unique-selectors@^4.0.1:
postcss "^7.0.0"
uniqs "^2.0.0"

postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0, postcss-value-parser@^3.3.1:
postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.1:
version "3.3.1"
resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281"
integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==

postcss-value-parser@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz#99a983d365f7b2ad8d0f9b8c3094926eab4b936d"
integrity sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ==

postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.5:
version "7.0.6"
resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.6.tgz#6dcaa1e999cdd4a255dcd7d4d9547f4ca010cdc2"
Expand All @@ -12072,6 +12074,15 @@ postcss@^7.0.14, postcss@^7.0.6:
source-map "^0.6.1"
supports-color "^6.1.0"

postcss@^7.0.16, postcss@^7.0.17:
version "7.0.17"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.17.tgz#4da1bdff5322d4a0acaab4d87f3e782436bad31f"
integrity sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==
dependencies:
chalk "^2.4.2"
source-map "^0.6.1"
supports-color "^6.1.0"

posthtml-parser@^0.3.3:
version "0.3.3"
resolved "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.3.3.tgz#3fe986fca9f00c0f109d731ba590b192f26e776d"
Expand Down

0 comments on commit 5567a8c

Please sign in to comment.